diff --git a/software/gpm.mdwn b/software/gpm.mdwn index 5b72f5dd..222bab5d 100644 --- a/software/gpm.mdwn +++ b/software/gpm.mdwn @@ -1,68 +1,28 @@ - general purpose mouse +[[!meta title="gpm - general purpose mouse"]] + -gpm is the mouse support for Linux on the console +## How to get gpm? -## how to get gpm - -### git -Currently the best way to get gpm is via git: +You can browse the [static archives](archives) or use git: git-clone git://git.schottelius.org/gpm - * Alternate clone URLs: - * http://git.schottelius.org/gpm (plain http instead of git://) - * Gitweb: - * [http://git.schottelius.org/](http://git.schottelius.org/?p=gpm) - -### archives and source browser - - * gpm2 (development branch): ***gpm-1.99.7***: - * [changes](browse_source/gpm-1.99.7/doc/changes/1.99.7) - * [browse source](browse_source/gpm-1.99.7) - * [tar.bz2](archives/gpm-1.99.7.tar.bz2) - * [tar.bz2.sha512sum](archives/gpm-1.99.7.tar.bz2.sha512sum) - * [tar.gz](archives/gpm-1.99.7.tar.gz) - * [tar.gz.sha512sum](archives/gpm-1.99.7.tar.gz.sha512sum) - * [tar.lzma](archives/gpm-1.99.7.tar.lzma) - * [gpm-1.99.7.tar.lzma.sha512sum](archives/gpm-1.99.7.tar.lzma.sha512sum) - * gpm1 (stable branch): ***gpm-1.20.6***: - * [changes](browse_source/gpm-1.20.6/doc/changes/1.20.6) - * [browse source](browse_source/gpm-1.20.6) - * [tar.bz2](archives/gpm-1.20.6.tar.bz2) - * [tar.bz2.sha512sum](archives/gpm-1.20.6.tar.bz2.sha512sum) - * [tar.gz](archives/gpm-1.20.6.tar.gz) - * [tar.gz.sha512sum](archives/gpm-1.20.6.tar.gz.sha512sum) - * [tar.lzma](archives/gpm-1.20.6.tar.lzma) - * [tar.lzma.sha512sum](archives/gpm-1.20.6.tar.lzma.sha512sum) - * [Older archives](archives) - * You can [browse the source](browse_source) of the old releases, too. - -There is the mirror -http://www.ar.linux.it/pub/gpm/ -available. +The archives are also mirrored at +[ar.linux.it](http://www.ar.linux.it/pub/gpm/). ## Support -### IRC + There is the irc channel [#gpm](irc.freenode.org/#gpm) on irc.freenode.org. -### mailing lists -#### development and discussion list The mailing list devoted to gpm is "gpm@lists.linux.it". In order to subscribe to the mailing list, visit -http://lists.linux.it/listinfo/gpm +[lists.linux.it](http://lists.linux.it/listinfo/gpm) or send a message with "subscribe" in its body to gpm-request@lists.linux.it. For example: echo subscribe | mail gpm-request@lists.linux.it -The mailing list archive can be found at -http://lists.linux.it/pipermail/gpm/ +Or you can browse the +[mailing list archive](http://lists.linux.it/pipermail/gpm/). -#### Commits mailinglist - -All published commits from the projects I am involved in are send -to this mailinglist, including those commits to gpm. - - * [Archive](http://l.schottelius.org/pipermail/commits/) - * [Mailinglist](http://l.schottelius.org/mailman/listinfo/commits/) +[[!tag gpm unix]] diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/.exclude b/software/gpm/browse_source/gpm-1.20.2-broken/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/.gitignore b/software/gpm/browse_source/gpm-1.20.2-broken/.gitignore deleted file mode 100644 index 2218321d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -acconfig.h -aclocal.m4 -*.o -*.a -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/BUGS b/software/gpm/browse_source/gpm-1.20.2-broken/BUGS deleted file mode 100644 index dfd719e6..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/BUGS +++ /dev/null @@ -1,43 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - - liblow.c:Gpm_Connect/Open (option.consolename is == NULL) - - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/COPYING b/software/gpm/browse_source/gpm-1.20.2-broken/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/Changelog b/software/gpm/browse_source/gpm-1.20.2-broken/Changelog deleted file mode 100644 index 12067c49..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/Changelog +++ /dev/null @@ -1,2097 +0,0 @@ -2005-04-26 Nico Schottelius - * added patches from Dmitry Torokhov : - many cleanups, evdev support - * changed old e-mail - -2004-05-18 Nico Schottelius - * added sources into the monotone tree - -2004-03-30 Nico Schottelius - * changed maintainer email - * applied two patches from Stepan Kasal - (gpm-no-makeinfo.patch, gpm-awksub.patch) - * applied patches from Maciej W. Rozycki - (gpm-1.20.1-ceil.patch, gpm-1.20.1-consolename.patch, - gpm-1.20.1-shlib.patch, gpm-1.20.1-contrib.patch) - * fixed bug in Makefile.in with ash (read -p text variable instead read -p text) - * added /dev/pts/0 to valid consoles (who contributed this patch?) - -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/Changes b/software/gpm/browse_source/gpm-1.20.2-broken/Changes deleted file mode 100644 index 74dcf577..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/Changes +++ /dev/null @@ -1,35 +0,0 @@ -* From 1.20.1 to 1.20.2: - o This is a "gpm is still alive and broken"-release! - o Have a look at included file doc/README.1.20.2 for more information. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/MANIFEST b/software/gpm/browse_source/gpm-1.20.2-broken/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/Makefile.in b/software/gpm/browse_source/gpm-1.20.2-broken/Makefile.in deleted file mode 100644 index 0940f0d3..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/Makefile.in +++ /dev/null @@ -1,123 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - rm -fr autom4te.cache - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @read -p "Hit Ctrl+C to abort." anything - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -f aclocal.m4 configure config.h.in - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.2-broken/Makefile.include.in deleted file mode 100644 index 5c68170c..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/Makefile.include.in +++ /dev/null @@ -1,67 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# -# Set ROOT, if you want to install to a virtual root. -# You can do that also via commandline: make ROOT=/mnt/newroot install -#ROOT = - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ --no-split -TEXI2HTML = texi2html -monolithic -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/README b/software/gpm/browse_source/gpm-1.20.2-broken/README deleted file mode 100644 index 98edea07..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/README +++ /dev/null @@ -1,341 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001-2004 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -The current homepage for gpm is available at - - http://linux.schottelius.org/gpm/ - -GPM is now using monotone as its version control system. -It's hosting site is linux.schottelius.org, the collection is -org.schottelius.gpm. - -Here's a small manual howto get gpm via monotone: - ----------------------------------------------------------------------- - -# create a database -scice% monotone --db=gpm.db db init - -# get the server key -scice% wget -q http://linux.schottelius.org/gpm/server-key.pub - -# read the server key -scice% monotone --db=gpm.db read < server-key.pub -monotone: read 1 packet - -# do an anonymous pull -scice% monotone --key="" --db=gpm.db pull linux.schottelius.org org.schottelius.gpm -monotone: warning: doing anonymous pull -monotone: rebuilding merkle trees for collection org.schottelius.gpm -monotone: connecting to linux.schottelius.org -monotone: [bytes in: 722110] [bytes out: 7405] -monotone: exchanged goodbyes and flushed output on fd 7 (peer linux.schottelius.org), disconnecting - -# extract source from the database to a directory -scice% monotone --db=gpm.db --branch=org.schottelius.gpm checkout your-destination-directory -monotone: fetching heads of branch 'org.schottelius.gpm' - ----------------------------------------------------------------------- - -GPM's cvs tree (and cvs in general) is DEPRECATED. - -Still, there is an 'old' cvs tree available: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nico-gpm@schottelius.org - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/README.gpm2 b/software/gpm/browse_source/gpm-1.20.2-broken/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/TODO b/software/gpm/browse_source/gpm-1.20.2-broken/TODO deleted file mode 100644 index fa2b54d4..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/autogen.sh b/software/gpm/browse_source/gpm-1.20.2-broken/autogen.sh deleted file mode 100644 index 0cdcd36e..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/autogen.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2006-08-27 -# - -set -e -echo "Running autotools ..." -aclocal -I m4 -autoheader -autoconf -echo "Done! Now just run ./configure" diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/configure.ac b/software/gpm/browse_source/gpm-1.20.2-broken/configure.ac deleted file mode 100644 index d3dc9a16..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/configure.ac +++ /dev/null @@ -1,191 +0,0 @@ -# -# gpm - configure.ac -# based on configure.in, written jan/1997 byT.E.Dickey -# Nico Schottelius -# -# heavily cleaned up - -############################# prework ################################# -AC_INIT(gpm, 1.20.2 (git), gpm@lists.linux.it) -AC_PREREQ(2.59) -AC_CONFIG_SRCDIR([src/gpm.c]) -AC_CONFIG_HEADER([src/headers/config.h]) - -############################# release version ################################# -release_date="Sometime 2005" -AC_DEFINE_UNQUOTED(GPM_RELEASE,PACKAGE_VERSION,[release version string]) -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date",[release date string]) - -# These are chosen so that we can switch to the libtool scheme transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -# check for programs -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -# emacs -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -# headers -AC_CHECK_HEADERS(linux/input.h linux/joystick.h linux/major.h linux/tty.h) -AC_CHECK_HEADERS(curses.h ncurses.h ncurses/curses.h sys/sysmacros.h syslog.h) -AC_CHECK_HEADERS([math.h], , [AC_MSG_ERROR([a mandatory header is missing])]) - -# curses -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -EVDEV_SRCS= -if test ${ac_cv_header_linux_input_h} = yes ; then - EVDEV_SRCS=evdev.c ; - AC_CHECK_TYPE(struct input_absinfo,AC_DEFINE_UNQUOTED(HAVE_INPUT_ABSINFO, 1, [define if struct input_absinfo defined in linux/input.h]),,[#include ]) -fi - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32, 1, [system has __u32 types]) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=lib/libgpm.so -else - SHLIB= -fi - -############################# functions ####################################### -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -dnl ceil() may be an inline, so check with no libm first -dnl need to use variables/return or gcc will optimize ceil() to a noop -AC_CACHE_CHECK([whether libm is needed for ceil], [gpm_cv_ceil_libm], -[ceil_found=no -for i in "" "-lm"; do - SAVELIBS=$LIBS - LIBS=$i - AC_LINK_IFELSE([AC_LANG_PROGRAM( -[#ifdef HAVE_MATH_H -#include -#endif], [float i=10.0; return ceil(i);])], [ceil_found=yes]) - LIBS=$SAVELIBS - if test x$ceil_found = xyes; then - break - fi -done -if test x$ceil_found = xno; then - gpm_cv_ceil_libm=missing -elif test x$i = x-lm; then - gpm_cv_ceil_libm=yes -else - gpm_cv_ceil_libm=no -fi]) -case $gpm_cv_ceil_libm in -no) - LIBM= - ;; -yes) - LIBM=-lm - ;; -*) - AC_MSG_ERROR([a mandatory function is missing]) - ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(EVDEV_SRCS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(LIBM) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -AC_OUTPUT(Makefile.include - Makefile - contrib/Makefile - doc/Makefile - doc/doc.gpm - src/Makefile) - -# old stuff -#AC_INIT(src/gpm.c) - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/Makefile.in deleted file mode 100644 index 349d5ab1..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(addprefix $(srcdir)/,$(ELISP)) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/`basename $$i` ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc Makefile diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/README b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/gm_psauxprint-0.01.c b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/gm_psauxprint-0.01.c deleted file mode 100644 index a700193d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/other/gm_psauxprint-0.01.c +++ /dev/null @@ -1,653 +0,0 @@ -// show effects of lost bytes on ps/2 mouse protocol -// Later: largely extended for mouse autodetect etc. (c) gunther mayer 13.05.2001 -#include -#include -#include -#include - -/* S48a reagiert auf Versapad: protokoll auf 4byte intellimouse - dto. auf logicord - -12.06.2001: MS PNP id - - */ - -#define GEN3U 1 -#define IM 2 -#define GEN3D 3 - -int reset=1; -int mspnp=0; -int logi=1; -int logicord=0; // dies irritiert manchmal genius 3U direkt nach hotplug -int logi_extended=1; -int logi_extra=0; /* NO! */ -int logi_extended_s48zilog=1; -int genius=0; -int testid=0; -int a4tech=0; -int intellimouse_explorer=0; -int intellimouse=0; -int alpsglidepoint=0; -int versapad=0; -int kensington=0; -int synaptics=0; -int cirque=0; - -int streamnostream=1; - -int consumefa(FILE *f) -{ int c=0xfa; - - while(c==0xfa) { - c=fgetc(f); - if(c==0xfa) printf(" 0xfa"); - } - printf("\n"); - return c; -} - -int sendbuf(int fd,FILE *f,char *buf,int num) -{ - int i,c,rep; - - for(i=0;i> 4) & 0x07) | ((a << 3) & 0x78); - printf("logi e9 is %02x %02x %02x vojtech-devicetype=%d =0x%2x\n",a,b,c,devicetype,devicetype); -} - - printf("\n"); - - gete9(fd,f); - - -if(logi_extended) { int g; - write(fd,&logi_extended_id,9); - buf[0]=0xeb; - write(fd,&buf,1); - a=consumefa(f); -if(a==0xfe) { printf("FE\n"); write(fd,&buf,1); a=consumefa(f); } - b=fgetc(f); - c=fgetc(f); - printf("logi extended poll 1 eb is %02x %02x %02x\n",a,b,c); - - write(fd,&logi_extended_idb,9); - buf[0]=0xeb; - write(fd,&buf,1); - a=consumefa(f); -if(a==0xfe) { printf("FE\n"); write(fd,&buf,1); a=consumefa(f); } - b=fgetc(f); - c=fgetc(f); - printf("logi extended poll 2 eb is %02x %02x %02x\n",a,b,c); - -if(logi_extra) { // marble mouse sends 2 extra triples - a=fgetc(f); - b=fgetc(f); - c=fgetc(f); - d=fgetc(f); - e=fgetc(f); - ee=fgetc(f); - printf("further is %02x %02x %02x %02x %02x %02x\n",a,b,c,d,e,ee); -} - -if(logi_extended_s48zilog) { int g; - write(fd,&logi_extended_s48zilog_id,11); - buf[0]=0xeb; - write(fd,&buf,1); - a=consumefa(f); - b=fgetc(f); - c=fgetc(f); - printf("logi extended_s48 zilo poll is %02x %02x %02x\n",a,b,c); -} - - - - -} - -printf("\n"); - -buf[0]=0xe9; - write(fd,&buf,1); - a=fgetc(f); -if(a==0xfe) { printf("FE\n"); write(fd,&buf,1); a=consumefa(f);} - b=fgetc(f); - c=fgetc(f); - d=fgetc(f); - printf(" e9 is %02x %02x %02x %02x\n",a,b,c,d); - -printf("\n"); - -if(logicord) { - write(fd,&logi_cordless_status,6); - a=fgetc(f); - b=fgetc(f); - c=fgetc(f); - d=fgetc(f); - e=fgetc(f); - ee=fgetc(f); - printf("logicord e9 is %02x %02x %02x %02x %02x %02x\n",a,b,c,d,e,ee); - - gete9(fd,f); -} - -buf[0]=0xe9; - write(fd,&buf,1); - a=fgetc(f); - b=fgetc(f); - c=fgetc(f); - d=fgetc(f); - printf(" e9 is %02x %02x %02x %02x\n",a,b,c,d); - -if(testid) { - printf("\n"); - write(fd,&test_id,4); - a=consumefa(f); - b=fgetc(f); - c=fgetc(f); - printf("test id e9 is %02x %02x %02x\n",a,b,c); - gete9(fd,f); - printf("\n"); -} - - -if(genius) { -write(fd,&genius_id,6); - a=consumefa(f); - b=fgetc(f); - c=fgetc(f); - printf("genius id e9 is %02x %02x %02x\n",a,b,c); - if(c!=0xc8) { - - if((b==0x33) && (c==0x44)) { - printf("autodetect GEN3D\n"); - typ=GEN3D; // Netscroll groller 6bytes - } - else if((b==0x33) && (c==0x55)) { - printf("autodetect GEN3U\n"); - typ=GEN3U; // Netmouse 4 bytes - } - gete9(fd,f); - } - - ratetest(fd,f); - -} - -if(alpsglidepoint) { -write(fd,&alps_glidepoint_id,8); - a=consumefa(f); - b=fgetc(f); - c=fgetc(f); - - if((b!=0) && (c!=100)) printf("Alps Glidepoint detected\n"); - /* My Genius Newscroll locks rate=$3c (!50) !? */ - - printf("alps glidepoint id e9 is %02x %02x %02x\n",a,b,c); - gete9(fd,f); -} - -if(versapad) { -write(fd,&versapad_id,9); - a=consumefa(f); - b=fgetc(f); - c=fgetc(f); - - if((b==0) && (c==10)) printf("versapad detected\n"); - - printf("versapad id e9 is %02x %02x %02x\n",a,b,c); - gete9(fd,f); -} - -if(kensington) { -write(fd,&kensington_id,3); - a=consumefa(f); - printf("kensington f3 id is %d\n",a); - if(a==2) printf("AUTODETECT Kensington\n"); - - write(fd,&kensington_enable,21); - a=consumefa(f); - b=fgetc(f); - c=fgetc(f); - - printf("kensingon enable = %02x %02x %02x\n",a,b,c); - - // beware of GENIUS: 3U locks rate at 100; 3D at 20-60 - if((b!=0) && (c!=20)) printf("AUTODETECT Kensington enable\n"); - - - printf("\n"); -} - - - -if(intellimouse){ -write(fd,&intellimouse_id,6); - buf[0]=0xf2; - write(fd,&buf,1); - b=consumefa(f); - printf("Intellimouse ID(f2) is %x\n",b); - if(b==3) { - printf("autodetect is:typ=IM;\n"); - typ=IM; - } -} -if(intellimouse_explorer) { -write(fd,&intellimouse_explorer_id,6); - buf[0]=0xf2; - write(fd,&buf,1); - b=consumefa(f); - printf("Intellimouse Explorer ID(f2) is %x\n",b); - if(b==4) { - printf("autodetect is:typ=IM;\n"); - typ=IM; - } -} - -if(synaptics) { -write(fd,&synaptics_id,10); - a=consumefa(f); - b=fgetc(f); - c=fgetc(f); - - printf("synaptics_id is %02x %02x %02x\n",a,b,c); - if(b==0x47) printf("AUTODETECT Synaptics\n"); - gete9(fd,f); -} - -if(cirque) { - printf("Before cirque\n"); - gete9(fd,f); -sendbuf(fd,f,cirque_id,6); - a=consumefa(f); - b=fgetc(f); - c=fgetc(f); - - printf("cirque_id is %02x %02x %02x\n",a,b,c); - - if(a==0x88) printf("AUTODETECT Cirque\n"); // my smartcat has: 88 03 02 - - gete9(fd,f); - gete9(fd,f); -} - - -if(a4tech) { -sendbuf(fd,f,a4tech_id,12); - buf[0]=0xf2; - write(fd,&buf,1); - b=consumefa(f); - printf("a4tech ID(f2) is %x\n",b); - - if(b==6 || b==8) printf("AUTODETECT: a4tech\n"); - // b=6: spiffy gyro-mouse "8D Profi-Mouse Point Stick" - // b=8: boeder Smartmouse Pro (4Button, 2Scrollwheel, 520dpi) PSM_4DPLUS_ID MOUSE_MODEL_4DPLUS -} - - buf[0]=0xf2; - write(fd,&buf,1); - b=consumefa(f); - printf( " ID(f2) is %x\n",b); - -streamnostream=1; -if(streamnostream) { - buf[0]=0xea; - write(fd,&buf,1); - a=fgetc(f); - printf("Activating stream mode %x\n",a); -} - - buf[0]=0xf4; - write(fd,&buf,1); - a=fgetc(f); - printf("Enable mouse%x\n",a); - - //scale - buf[0]=0xe6; - write(fd,&buf,1); - a=fgetc(f); - - - // resolution - buf[0]=0xe8; - write(fd,&buf,1); - a=fgetc(f); - buf[0]=2; - write(fd,&buf,1); - a=fgetc(f); - - ratetest(fd,f); - - // rate - buf[0]=0xf3; - write(fd,&buf,1); - a=fgetc(f); - buf[0]=100; - write(fd,&buf,1); - a=fgetc(f); - - -buf[0]=0xe9; - write(fd,&buf,1); - a=fgetc(f); - b=fgetc(f); - c=fgetc(f); - d=fgetc(f); - printf(" e9 is %02x %02x %02x %02x\n",a,b,c,d); - - - - - //printf("Simulating 2 lost bytes\n"); - //a=fgetc(f); a=fgetc(f); - -// printf("Simulating 1 lost byte\n"); - //a=fgetc(f); - -printf("autodetect has typ=%d\n",typ); - - while (1) { - a=fgetc(f); - x=fgetc(f); - y=fgetc(f); -if(typ==GEN3U || typ==IM) z=fgetc(f); - i++; - printf("%5d -- %02x %02x %02x",i,a,x,y); -if(typ==GEN3U || typ==IM) printf(" %02x",z); - - yo=a&0x80; - xo=a&0x40; - ys=a&0x20; - xs=a&0x10; - t=a&0x08; - m=a&0x04; - r=a&0x02; - l=a&0x01; - - dx=x; - dy=y; - - if(xs) dx= (~255) | dx; /* 9bit 2complement sign extension to signed integer */ - if(ys) dy= (~255) | dy; - - if (dxxmax) xmax=dx; - if (dy>ymax) ymax=dy; - - xtot=xtot+dx; /* total count */ - ytot=ytot+dy; - - - // recognize mouseman+ packets aka PS2PP or PS2++ protocol - if( ((a&0x48) == 0x48) && // bit3 and bit6 set - ((x&3) == 0x02) && // bit0 unset, bit1 set - (((x>>1)&0x40) == (x&0x40)) && // bit 7 = bit 6 - ( ((x>>7)&0x01) != ((a>>4)&0x01)) && // neg of p2 - ( ((x>>2)&0x03) == (y&0x03))) {// these 2 bits equal - int packettype; - packettype= ((x>>4) &0x03) | ((a>>2)&0x0c); - printf(" ps2++ packet type=0x%0x ",packettype); - - switch (packettype) { - case 0: - printf("ID Data packet, model=0x%02x (decimal=%d)",y,y); - break; - case 1: // wheel data + BTN4+5 +Horizontal/vertical - dz = (y&0x07) - (y&0x08); //2s complement - printf("wheel: %d ",dz); - if(y&0x10) printf("Btn4 "); - if(y&0x20) printf("Btn3"); - break; - case 2: /* Logitech reserves this packet type */ - /* Xfree86 4.0.2 - * IBM ScrollPoint uses this packet to encode its - * stick movement. - * - buttons |= (pMse->lastButtons & ~0x07); - dx = dy = 0; - dz = (pBuf[2] & 0x80) ? ((pBuf[2] >> 4) & 0x0f) - 16 : - ((pBuf[2] >> 4) & 0x0f); - dw = (pBuf[2] & 0x08) ? (pBuf[2] & 0x0f) - 16 : - (pBuf[2] & 0x0f); - */ - break; - - case 3: - printf("touchpad packet"); - break; - case 4: - case 5: - case 6: - case 8: - case 9: - printf("cordless connect packet"); - break; - case 0x0b: - printf("marble mouse or trackball packet"); - } - printf("\n"); - } -else { - - - printf(" --- %4d : %4d Buttons=%s%s%s Overflow/errors:%s%s%s ", - dx,dy,m?"M":" ", r?"R":" ", l?"L":" ", - xo?"X":" ", yo?"Y":" ", t?" ":"T"); - - printf(" Min/Max x=(%d , %d) y=(%d , %d) total=%d,%d\n",xmin,xmax,ymin,ymax,xtot,ytot); - } - - - - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/compress-patches b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/compress-patches deleted file mode 100644 index 86b52d30..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/compress-patches +++ /dev/null @@ -1,9 +0,0 @@ -CVS_ADD=""; -CVS_REMOVE=""; -for a in *.gz; - do CVS_ADD="$CVS_ADD $a"; - CVS_REMOVE="$CVS_REMOVE ${a%.gz}"; -done; -cvs add $CVS_ADD -rm $CVS_REMOVE -cvs remove $CVS_REMOVE diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/gpm_release deleted file mode 100644 index 758a386e..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nico-gpm@schottelius.org), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/make_diff deleted file mode 100644 index 17ea4cf4..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nico-gpm@schottelius.org), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/test_gpm deleted file mode 100644 index c1c59803..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nico-gpm@schottelius.org), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/Announce b/software/gpm/browse_source/gpm-1.20.2-broken/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/FAQ b/software/gpm/browse_source/gpm-1.20.2-broken/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.2-broken/doc/HACK_GPM deleted file mode 100644 index ea72fc45..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/HACK_GPM +++ /dev/null @@ -1,22 +0,0 @@ -Dear GPM-Hacker, - -thank you for reading this document. - -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest monotone sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - - * Still there? - * Then send the patch (either itself or the link to it) to the mailing list. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.2-broken/doc/Makefile.in deleted file mode 100644 index b3b94482..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/Makefile.in +++ /dev/null @@ -1,178 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "@MAKEINFO@" != "no" ]; then $(MAKEINFO) $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.2-broken/doc/doc.gpm.in deleted file mode 100644 index 7afb1d5c..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001-2005 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). Text-mode mouse library and server daemon. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001-2005 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/gpm.info b/software/gpm/browse_source/gpm-1.20.2-broken/doc/gpm.info deleted file mode 100644 index b73db4d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/gpm.info +++ /dev/null @@ -1,1929 +0,0 @@ -This is -/home/user/nico/computer/sources/linux/gpm/cvstree/doc/gpm.info, -produced by makeinfo version 4.0 from -/home/user/nico/computer/sources/linux/gpm/cvstree/doc/gpm.texinfo. - -INFO-DIR-SECTION Miscellaneous -START-INFO-DIR-ENTRY -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -END-INFO-DIR-ENTRY - - This file is a user's and programmer's manual for gpm 1.20.1. - - Copyright (C) 1994,1995,1998 Alessandro Rubini Copyright (C) -2001,2002 Nico Schottelius - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - This file documents the 1.20.1 release of the "General Purpose -Mouse" (gpm) server for the Linux text console (Decembre 2002). - - -File: gpm.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - -gpm -*** - -* Menu: - -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: - - -File: gpm.info, Node: Overview, Next: Server Invocation, Prev: Top, Up: Top - -Overview -******** - - The "gpm" package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -`gpm' come from the `selection-1.5' package, by Andrew Haylett. - - The first application to support the mouse has been The Midnight -Commander, by Miguel de Icaza. `mc-0.11' and later releases offer -mouse support if you have the mouse server running on your system. The -file `t-mouse.el' provides support for using the mouse from within -Emacs. *Note Emacs Support::. - - As of release 0.96, a default-handler is released with gpm, and can -be used to handle Control-Mouse events to draw menus on the screen. -The `gpm-root' program, however, needs kernel 1.1.73 or newer. *Note -gpm-root::. - - Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as `kmouse-?.??.tar.gz' from the mirrors of -`ftp://tsx-11.mit.edu'. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - - As of release 1.20.0 the default device is removed. Now -m is a must. - - Release 1.20.1 introduces the must for -t and a specific way to use --m,-t,-o: Now you've got to use -m first, then -t and at last -o. This -seems to be more complex, but makes using of multiply mice possible with -clean code. - -* Menu: - -* Building the Release:: - - -File: gpm.info, Node: Building the Release, Prev: Overview, Up: Overview - -Compiling and Installing -======================== - - Just say `./configure && make && make install' to your shell. You'll -need gpm installed to compile the latest release of The Midnight -Commander with mouse support enabled. - - Binaries are not released with the package because it's safer for -you to compile the package by yourself. - - -File: gpm.info, Node: Server Invocation, Next: Gpm Internals, Prev: Overview, Up: Top - -Server Invocation -***************** - - The `gpm' executable is meant to act like a daemon (thus, `gpmd' -would be a better name for it). This section is meant to describe the -command-line options for `gpm', while its internals are outlined in the -next section. *Note Gpm Internals::. - - Due to restrictions in the `ioctl(TIOCLINUX)' system call, `gpm' must -be run by the superuser. The restrictions have been added in the last -1.1 kernels to fix a security hole related to selection and screen -dumping. - - The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's attitude. From -release 1.02 up to 1.19.2 is was possible for any user logged on the -system console to change the mouse _feeling_ using the -q option. This -is no longer possible for security reasons. - - As of 0.97 the server program puts itself in the background. To kill -`gpm' you can just reinvoke it with the `-k' cmdline switch, although -`killall gpm' can be a better choice. - -* Menu: - -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: - - -File: gpm.info, Node: Special Commands, Next: Command Line, Prev: Server Invocation, Up: Server Invocation - -Special Commands -================ - - Version 1.10 adds the capability to execute _special_ commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - - Special commands are toggled by triple-clicking the left and right -button - an unlikely event during normal mouse usage. The easiest way -to triple-click is pressing one of the buttons and triple-click the -other one. When special processing is toggled, a message appears on the -console (and the speaker beeps twice, if you have a speaker); if the -user releases all the buttons and presses one of them again within -three seconds, then the special command corresponding to the button is -executed. - - The default special commands are: - -LEFT BUTTON - Reboot the system by signalling the init process - -MIDDLE BUTTON (IF ANY) - Execute `/sbin/shutdown -h now' - -RIGHT BUTTON - Execute `/sbin/shutdown -r now' - - The `-S' command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use `-S ""' (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - - As an example, `-S ":telinit 1:/sbin/halt"', associates killing init -to the left button, going single user to the middle one, and halting -the system to the right button. - - System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - - -File: gpm.info, Node: Command Line, Next: Bugs and Problems, Prev: Special Commands, Up: Server Invocation - -Command Line Options -==================== - - Available command line options are the following: - -`-a ACCEL' - Set the acceleration value used when a single motion event is - longer than DELTA (see `-d'). - -`-A[LIMIT]' - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer (`rm -rf /') - including the terminating line break, then all the victim has to - do is click the middle mouse button .. As of version 1.17.2, this - has developed into a more general aging mechanism; the gpm daemon - can disable (_age_) selection pasting automatically after a period - of inactivity. To enable this mode just give the optional LIMIT - parameter (no space in between !) which is interpreted as the - time in seconds for which a selection is considered valid and - pastable. As of version 1.15.7, a trivial program called - `disable-paste' is provided. The following makes a good addition - to `/etc/profile' if you allow multiple users to work on your - console. - - `case $( /usr/bin/tty ) in - /dev/tty[0-9]*) /usr/bin/disable-paste ;; - esac' - -`-b BAUD' - Set the baud rate. - -`-B SEQUENCE' - Set the button sequence. `123' is the normal sequence, `321' can - be used by left-handed people, and `132' can be useful with - two-button mice (especially within Emacs). All the button - permutations are allowable. - -`-d DELTA' - Set the delta value. When a single motion event is longer than - DELTA, ACCEL is used as a multiplying factor. (Must be 2 or above) - -`-D' - Do not automatically enter background operation when started, and - log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases it - was done with a compile-time option. - -`-g NUMBER' - With glidepoint devices, emulate the specified button with tapping. - NUMBER must be `1', `2', or `3', and refers to the button number - _before_ the `-B' button remapping is performed. This option - applies to the mman and ps2 decoding. No button is emulated by - default because the ps2 tapping is incompatible with some normal - ps2 mice - -`-h' - Print a summary of command line options. - -`-i INTERVAL' - Set INTERVAL to be used as an upper time limit for multiple - clicks. If the interval between button-up and button-down events - is less than LIMIT, the press is considered a double or triple - click. Time is in milliseconds. - -`-k' - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use `-R' or the single-open - limitation is removed from the kernel). - -`-l CHARSET' - Choose the `inword()' look up table. The CHARSET argument is a - list of characters. `-' is used to specify a range and `\ ' is - used to escape the next character or to provide octal codes. Only - visible character can appear in CHARSET because control characters - can't appear in text-mode video memory, whence selection is cut. - -`-m FILENAME' - Choose the mouse file to open. Must be before -t and -o. - -`-M' - Enable multiple mode. The daemon will read two different mouse - devices. Any subsequent option will refer to the second device, - while any preceding option will be used for the first device. This - option automatically forces the _repeater_ (`-R') option on. - -`-o LIST-OF-EXTRA-OPTIONS' - The option works similary to the "-o" option of mount; it is used - to specify a list of "extra options" that are specific to each - mouse type. The list is comma-separated. The options `dtr', `rts' - or `both' are used by the serial initialization to toggle the - modem lines like, compatibly with earlier gpm versions; note - however that using -o dtr associated with non-plain-serial mouse - types may now generate an error. *Note Mouse Types::. And by the - way, use -o after -m and after -t. - -`-p' - Forces the pointer to be visible while selecting. This is the - behaviour of `selection-1.7', but it is sometimes confusing. The - default is not to show the pointer, which can be confusing as well. - -`-r NUMBER' - Set the responsiveness. A higher responsiveness is used for a - faster cursor motion. - -`-R[NAME]' - Causes `gpm' to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo `/dev/gpmdata' in - protocol NAME, given as an optional argument (no space in between - !). In principle, you can use the same names as for the `-t' - option, although repeating into some protocols may not be - implemented for a while. *Note Mouse Types::. In addition, you - can specify `raw' as the NAME, to repeat the mouse data byte by - byte, without any protocol translation. If NAME is omitted, it - defaults to `msc'. Using gpm in repeater mode, you can configure - the X server to use its fifo as a mouse device. This option is - useful for bus-mouse owners to override the single-open - limitation. It is also an easy way to manage those stupid - dual-mode mice which force you to keep the middle button down - while changing video mode. The option is forced on by the `-M' - option. - -`-s NUMBER' - Set the sample rate for the mouse device. - -`-S COMMANDS' - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -`-t NAME' - Set the mouse type. Use `-t help' to get a list of allowable - types. Since version 1.18.1, the list also shows which protocols - are available as repeaters (see -R above), by marking them with an - asterisk ("*"). *Note Mouse Types::. Use -t after you selected - the mouse device with -m. - -`-v' - Print version information and exit. - -`-V[VERBOSITY INCREMENT]' - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to getopt(3) rules, any optional argument - needs to be passed without a space in between! When omitting the - argument, the increment defaults to 1. Default verbosity level is - 5 (`LOG_NOTICE'). *Note Program Arguments: (libc)Program - Arguments. - -`-2' - Force two buttons. This means that the middle button, if any, will - be taken as it was the right one. - -`-3' - Force three buttons. By default the mouse is considered to be a - 2-buttons one, until the middle button is pressed. If three - buttons are there, the right one is used to extend the selection, - and the middle one is used to paste it. Beware: if you use the - `-3' option with a 2-buttons mouse, you won't be able to paste the - selection. - -* Menu: - -* Bugs and Problems:: - - -File: gpm.info, Node: Bugs and Problems, Next: Mouse Types, Prev: Command Line, Up: Server Invocation - -Bugs and Problems -================= - - The `gpm' server may have problems interacting with X: if your mouse -is a single-open device (i.e. a bus mouse), you should kill `gpm' -before starting X, or use the `-R' option (see above). To kill `gpm' -just invoke `gpm -k'. This problem doesn't apply to serial mice. - - Two instances of gpm can't run on the same system. If you have two -mice use the `-M' option (see above). - - While the current console is in graphic mode, `gpm' sleeps until -text mode is back (unless `-R' is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur out -in hidden consoles. - - The clients shipped out with gpm are not updated, thus there are -potential security risks when using them. - - -File: gpm.info, Node: Mouse Types, Prev: Bugs and Problems, Up: Server Invocation - -Mouse Types -=========== - - This section of the gpm documentation manual describes the various -pointer types currently available in gpm. If you look at the source -code, you'll find that pointer-specific code is confined to `mice.c' -(while it used to only include mouse decoders, gpm now supports tablets -and touchscreens as well). - - The mouse type is specified on command line with the `-t' option. -The option takes an argument, which represents the name of a mouse -type. Each type can be associated to different names. For old mouse -types, one name is the old selection-compatible name, and another is -the XFree name. After version 1.18.1 of gpm, the number of synonyms was -made arbitrary and the actual name being used is made available to the -function responsible for mouse initialization. Therefore it is possible -for a mouse decoder to behave slightly differently according to the -name being used for the device (if this feature was already present, we -wouldn't have for example ms+ and ms+lr as different mouse types). - - The initialization procedure of each mouse type can also receive -extra option, by means of the -o command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option string -is unused for that mouse type and specifying one generates an error. -When the document refer to "standard serial options" it means that one -of -o dtr, -o rts, -o both can be specified to toggle the control lines -of the serial port. - - The following mouse type are corrently recognized: - -`bare Microsoft' - The Microsoft protocol, without any extension. It only reports two - buttons. If your device has three, you should either try running - the mman decoder or msc. In the latter case, you need to tell the - mouse to talk msc protocol by toggling the DTR and RTS lines (with - one of -o drt, -o rts or -o both) or invoking `gpm -t msc' while - keeping the middle button pressed. Very annoying, indeed. This - mouse decoder accepts standard serial options, although they - should not be needed. - -`ms' - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious packets - which can be misunderstood as middle-button events. If this is - your case, use the `bare' mouse type. Some new two-button devices - are "plug and play", and they don't play fair at all; in this case - try -t pnp. Many (most) three-button devices that use the - microsoft protocol fail to report some middle-button events during - mouse motion. Since the protocol does not distinguish between the - middle button going up and the middle button going down it would - be liable to get out of step, so this decoder declares the middle - button to be up whenever the mouse moves. This prevents dragging - with the middle button, so you should probably use `-t ms+lr' - instead of this decoder, especially if you want to use X. This - mouse decoder accepts standard serial options, although they - should not be needed. - -`ms+' - This is the same as `-t ms' except that the middle button is not - reset during mouse motion. So you can drag with the middle button. - However, if your mouse exhibits the usual buggy behaviour the - decoder is likely to get out of step with reality, thinking the - middle button is up when it's down and vice versa. You should - probably use `-t ms+lr' instead of this decoder. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`ms+lr' - This is the same as `-t ms+' except that there is an additional - facility to reset the state of the middle button by pressing the - other two buttons together. Do this when the decoder gets into a - confused state where it thinks the middle button is up when it's - down and vice versa. (If you get sick of having to do this, please - don't blame gpm; blame your buggy mouse! Note that most - three-button mice that do the microsoft protocol can be made to do - the MouseSystems protocol instead. The "3 Button Serial Mouse - mini-HOWTO" has information about this.) This mouse decoder - accepts standard serial options, although they should not be - needed. - -`msc MouseSystems' - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try -t msc associated - with -o rts, -o dtr or -o both. - -`mman Mouseman' - The protocol used by the new Logitech devices with three buttons. - It is backward compatible with the Microsoft protocol, so if your - mouse has three buttons and works with -t ms or similar decoders - you may try -t mman instead to use the middle button. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`sun' - The protocol used on Sparc computers and a few others. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`mm MMSeries' - Title says it all. This mouse decoder accepts standard serial - options, although they should not be needed. - -`logi Logitech' - This is the protocol used by old serial Logitech mice. - -`bm BusMouse' - Some bus devices use this protocol, including those produced by - Logitech. - -`ps2 PS/2' - The protocol used by most busmice. - -`ncr' - This `type' is able to decode the pointing pen found on some - laptops (the NCR 3125 pen) - -`wacom' - The protocol used by the Wacom tablet. Since version 1.18.1 we - have a new Wacom decoder, as the old one was not working with new - tablets. This decoder was tested with Ultrapad, PenPartner, and - Graphire tablets. Options: -o relative (default) for relative - mode, -o absolute for absolute mode. - -`genitizer' - The \"Genitizer\" tablet, in relative mode. This mouse decoder - accepts standard serial options, although they should not be - needed. - -`logim' - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -`pnp' - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is hardwired - at 1200 baud and is upset by normal initialization, so this is a - -t bare decoder with no initialization at all. This mouse decoder - accepts standard serial options, although they should not be - needed. - -`ms3' - A decoder for the new serial IntelliMouse devices, the ones with - three buttons and a protocol incompatible with older ones. The - wheel is currently unused. - -`imps2' - "IntelliMouse" on the ps/2 port. This type can also be used for a - generic 2-button ps/2 mouse too, since it will auto-detect the - type. - -`netmouse' - Decodes the "Genius NetMouse" type of devices on the ps/2 port. - For serial "Netmouse" devices, use the "ms3" decoder. - -`cal' - A decoder of the "Calcomp UltraSlate device. - -`calr' - Same as above, but in relative mode. - -`twid' - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't yet - support X keycodes. If used with `-R', `gpm' will anyway repeat - mouse events to the X server. More information about twiddler - support can be found in `README.twiddler', in the gpm distribution. - -`syn synaptics' - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although they - should not be needed. - -`synps2 synaptics_ps2' - Same as above, but for the devices attached to the ps2 port. - -`brw' - A decoder for the Fellowes Browser, a device with 4 buttons and a - wheel. This mouse decoder accepts standard serial options, - although they should not be needed. - -`js Joystick' - This mouse type uses the joystick device to generate mouse events. - It is only available if the header `linux/joystick.h' is found at - compile time. The header (and the device as well) has been - introduced only during 2.1 development, and is not present in - version 2.0 of the kernel. - -`summa' - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it can - -R summa can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified xf86Summa.o module. - -`mtouch' - A decoder for the MicroTouch touch screen. Please refer to the - file `README.microtouch' in the source tree of gpm for further - information. In the near future, anyways, I plan to fold back to - this documentation the content of that file. - -`gunze' - A decoder for the gunze touch screen. Please refer to the file - `README.gunze' in the source tree of gpm for further information. - In the near future, anyways, I plan to fold back to this - documentation the content of that file. The decoder accepts the - following options: smooth=, debounce=. An higher smoothness - results in slower motion as well; a smaller smoothness gives - faster motion but, obviously, less smooth. The default smoothness - is 9. The debounce time is express in milliseconds and is the - minimum duration of an up-down event to be taken as a tap. Smaller - bounces are ignored. - -`acecad' - The Acecad tablet in absolute mode. - -`wp wizardpad' - Genius WizardPad tablet - - -File: gpm.info, Node: Gpm Internals, Next: The ClientLib, Prev: Server Invocation, Up: Top - -Gpm Internals -************* - - The server is organized as a main loop built around a `select()' -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - - When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most interesting). - -* Menu: - -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: - - -File: gpm.info, Node: Events, Next: Margins, Prev: Gpm Internals, Up: Gpm Internals - -Events -====== - - Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual consoles. *Note -Default Handlers::. - - When a client is involved, it is handled a `Gpm_Event' structure, -built by the server. The fields for `Gpm_Event' are the following: - -`unsigned char buttons;' - An or-mask of the values `GPM_B_LEFT', `GPM_B_MIDDLE' and - `GPM_B_RIGHT'. It corresponds to the state of the mouse buttons - when the event is reported. The current implementation of gpm - allows at most three buttons. - -`unsigned char modifiers;' - The value of the kernel variable `shift_state', as of - `keyboard.c', when the event is reported. It is a bitmask value, - and corresponds to the least significant byte of the value used by - the `loadkeys' program. Use of symbolic names in source code is - available after inclusion of `linux/keyboard.h', as exemplified in - `mev.c'. - -`unsigned short vc;' - The number of the active virtual console when the event is - reported. The client is not expected to use this value, which - corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. *Note Default - Handlers::. - -`short x, y;' - The position of the mouse pointer where the event is reported. It - is 1-based by default, to be compatible with `selection' and - `libcurses'. This behavior can be overriden, though, by setting - the library variable `gpm_zerobased'. *Note Variables::. - -`short dx, dy;' - The change in position since the last reported event. - -`enum Gpm_Etype type;' - A bit-mask, representing the type of reported event, as described - later. *Note Event Types::. - -`int clicks;' - A counter, which is valid at button-down, drag or button-up. It - can be 0, 1 or 2 to mean single, double or triple click. - -`enum Gpm_Margin margin;' - A bit-mask, telling if the pointer has gone out of the visible - screen. The indivudual bits are named `GPM_TOP', `GPM_BOT', - `GPM_LFT', `GPM_RGT'. Only one of them is active at a time, to - allow using `switch' on the value. Vertical outrun takes - precedence on horizontal outrun. *Note Margins::. - - -File: gpm.info, Node: Margins, Next: Event Types, Prev: Events, Up: Gpm Internals - -How margins are managed -======================= - - Motion and button-press events are constrained to remain within the -visible screen. This means that the `x' will be within 1 and 80 and `y' -will be within 1 and 25 when the console is 80x25 cells. However, a -client can keep track of movements outside the screen, by using the -`dx' and `dy' fields, which aren't subject to clipping. - - The server helps applications in detecting margin conditions by -filling the `margin' field. Whenever the pointer tries to cross screen -boundaries, it is forced to remain on the border, but a flag is set in -`margin'. - - A different policy is in force for drag and button-release events. -In this case the pointer is allowed to go outside the physical screen -by exactly one position. This allows, for example, selecting to end of -line by dragging down-left. The peculiar situation is nonetheless -signaled through the `margin' flags. The client should be careful to -fit the values within the screen if needed. *Note Utility Functions::. - - -File: gpm.info, Node: Event Types, Next: Connection Details, Prev: Margins, Up: Gpm Internals - -Event Types -=========== - - The `type' field in `Gpm_Event' is made up of bit-wide flags. The -existing bit masks belong to two groups: bare events and cooked events. -The bit-mask `GPM_BARE_EVENTS' is provided to extract bare events, by -and-ing (`&') it with the `type' field. For any event, exactly one bit -will be set in the resulting bitmask. - - Bare events are the following: - -`GPM_MOVE' - A motion event, with all buttons up. - -`GPM_DRAG' - A motion event, but one or more buttons are kept pressed. - -`GPM_DOWN' - A button press event. The `buttons' field will report which - buttons are pressed after the event. - -`GPM_UP' - A button release event. The `buttons' field will report which - buttons are being released. Note that this is different from the - previous case. - -`GPM_ENTER' - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. When the - type is `GPM_ENTER', all the other fields are undefined. *Note - High Level Lib::. - -`GPM_LEAVE' - This is only delivered by the high level library, too. Events of - type `GPM_LEAVE' have all other fields undefined. - - Cooked events are the following: - -`GPM_SINGLE' - This bit may be set at button-press, drag and button release - events, and can be used to identify a single press. The time - interval used to choose a double click from two single clicks is - set by a parameter in the daemon (configurable at daemon - invocation). - -`GPM_DOUBLE' - Used to identify a double click (press, drag, release) - -`GPM_TRIPLE' - Used to identify a triple click (press, drag, release) - -`GPM_MFLAG' - The "motion flag" is true if some dragging happened between - button-press and button-release. It can be used by those - applications which respond to events at button release. It is - available at drag and release. - - -File: gpm.info, Node: Connection Details, Next: Default Handlers, Prev: Event Types, Up: Gpm Internals - -Connection Details -================== - - Each virtual console has a stack of clients attached to it. They -talk to gpm by writing to a control socket and get mouse events by -reading it. All the clients in the stack can receive events. Gpm-1.10 -and earlier only sent events to the top client, but sometimes users -play with multiple programs using suspend-resume (thanks Ian). - - In addition to the per-console stacks, another stack is there to -store default-handling clients. *Note Default Handlers::. - - Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - - Clients are required to fill a `Gpm_Connect' structure and pass it -to the server. The structure is made up by four `unsigned int' fields. -*Note Open and Close::. - -`eventMask' - A bitmask of the events the client wants to receive. Both bare and - cooked events are allowed to appear in the mask. - -`defaultMask' - A mask to tell which events allow a default treatment (the - selection one). These are mouse events, independent of the - modifier keys. - -`minMod' - The minimum amount of modifiers required by the client. This field - is used for default-handlers which manage control-mouse events - without interfering with mouse-only ones. *Note Default - Handlers::. - -`maxMod' - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in `maxMod' won't be - passed to the client. - -Two more fields are there to tell about the connection itself, and -you're not asked to fill them, because `Gpm_Open' will do it for you. - -`int pid' - The process id of the connecting application. - -`int vc' - Which virtual console to gain control of. - - Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in *Note Default Handlers::, but you only -need to choose the right values for your application. - - Examples: -`minMod=0; maxMod=0;' - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -`minMod=0; maxMod=~0;' - is a client which gets any mouse event. - -`minMod=1< /tmp/du" - } - - button 3 { - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - - The syntax for the file won't be described here, being it quite -apparent from the example above. Blanks and newlines are unused in -parsing the file, and the layout of the file is free. Comments are -allowed in the file: any hash mark (`#') found at the beginning of the -line or after white space makes the parser discard anything up to the -next line. To insert quotes (`"') in strings precede them with a -backslash. - - Note that recursive menus are allowed, to any level of recursion. - - Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -`button NUMBER MENU' - The `button' keyword is used to introduce a menu. It is followed - by the number of the relevant button (1=left, 2=middle, 3=right), - an open brace, a menu and a closed brace. A menu is made up of - cfg statements, followed by action statements. Cfg statements can - come in any order, while the order of action statements tells the - actual order in which actions will appear on the screen, top to - bottom. - - The following statements belong to the cfg set. - -`name STRING' - If the `name' keyword is present, the specified STRING will be - used as the name for the current menu. - -`background COLOR' - This statements is used to specify the background color to be used - in the current menu. The COLOR can be specified with one of the - eight canonical strings `black', `red', `cyan' etc. The background - defaults to black. - -`foreground COLOR' - This statements is used to specify the foreground color for menu - items. Its value defaults to `white'. An optional `bright' - keyword can appear before the actual color. - -`border COLOR' - `border' is used to specify the border color for the menu. Its - value defaults to `white'. An optional `bright' keyword can - appear before the actual color. - -`head COLOR' - `head' is used to specify the foreground color for the title of - the menu. Its value defaults to `white'. An optional `bright' - keyword can appear before the actual color. - - The following statements belong to the action set. - -`STRING f.fgcmd CMDSTRING' - When the mouse button is released above the corresponding menu - item, the CMDSTRING is pasted in the keyboard queue of the current - console. This is not yet implemented. - -`STRING f.bgcmd CMDSTRING' - When the mouse button is released above the corresponding menu - item, a shell (`/bin/sh') is forked to execute the specified - command, with `stdin' connected to `/dev/null', and `stdout', - `stderr' connected to the active console. - -`STRING f.jptty TTYNUMBER' - When the mouse button is released above the corresponding menu - item, the console is switched to the one specified. The TTYNUMBER - must be specified as a string. Any tty can be reached this way, - even those which are not accessible via the keyboard. - -`STRING f.mktty TTYNUMBER' - When the mouse button is released above the corresponding menu - item, an unused console is selected, and `/sbin/mingetty' is - executed in it. The current console is switched to the newly - opened console. I use this command to save kernel memory by - opening a single console through `/etc/inittab' and requesting the - others only when i need to login. - -`STRING WHOLE-MENU' - A menu can directly follow the label string. When the mouse - pointer leaves the menu frame at the level of STRING, a second - menu is posted on screen. - -`STRING f.lock' - When the mouse button is released above the corresponding menu - item, the keyboard and the screen are locked, and only the locking - user or the superuser can unlock them. This is not yet implemented. - -`STRING f.load' - The current loadavg when the menu is posted is concatenated to - STRING to build the actual message displayed on screen. Nothing - happens at button release. - -`STRING f.free' - The free memory and swap when the menu is posted is concatenated - to STRING to build the actual message displayed on screen. Nothing - happens at button release. - -`STRING f.time' - The current time is formatted with strftime(3), according to - STRING. The resulting string is the actual message displayed on - screen. Nothing happens at button release. - -`STRING f.pipe CMDLINE' - When the mouse pointer leaves the menu frame at the level of - STRING, a message box is posted on screen showing the last ten - lines of the output of CMDLINE. CMDLINE is executed by `/bin/sh'. - This is not yet implemented. - -`STRING f.nop' - This does nothing, it only displays STRING on the menu. - - The `HOME', `LOGNAME' and `USER' environment variables are setup to -the values for the invoking user before spawning an external process -(`f.bgcmd', `f.pipe'). The current directory is always `/'. - - Known bugs have been fixed. In particular, if you invoke `gpm-root' -right after `gpm', it will delay a few seconds before trying to connect -to the daemon. - - -File: gpm.info, Node: hltest, Next: mouse-test, Prev: gpm-root, Up: Demo Clients - -`hltest' -======== - - High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - - The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help in -understanding the internal workings. - - -File: gpm.info, Node: mouse-test, Prev: hltest, Up: Demo Clients - -`mouse-test' -============ - - This experimental and incomplete application tries to help in -detecting which protocol does your mouse speak. It is able to detect -MouseMan devices, and to choose between `-t ms' (three-buttons aware) -and `-t bare' old two-buttons-only serial mice. - - I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -File: gpm.info, Node: Type Index, Next: Function Index, Prev: Demo Clients, Up: Top - -Type Index -********** - -* Menu: - -* Gpm_Connect: Connection Details. -* Gpm_Event: Events. -* Gpm_Handler: Handling Functions. -* Gpm_roi: Concepts. - - -File: gpm.info, Node: Function Index, Next: Variable Index, Prev: Type Index, Up: Top - -API Index -********* - -* Menu: - -* Gpm_CharsQueued: Getting Events. -* Gpm_Close: Open and Close. -* GPM_DRAWPOINTER: Utility Functions. -* Gpm_DrawPointer: Utility Functions. -* Gpm_FitEvent: Utility Functions. -* Gpm_FitValues: Utility Functions. -* Gpm_FitValuesM: Utility Functions. -* Gpm_Getc: Getting Events. -* Gpm_Getch: Getting Events. -* Gpm_Getchar: Getting Events. -* Gpm_GetEvent: Getting Events. -* Gpm_GetLibVersion: Extra Functions. -* Gpm_GetServerVersion: Extra Functions. -* Gpm_GetSnapshot: Extra Functions. -* Gpm_HandleRoi: hl-Functions. -* Gpm_LowerRoi: hl-Functions. -* Gpm_Open: Open and Close. -* Gpm_PopRoi: hl-Functions. -* Gpm_PushRoi: hl-Functions. -* Gpm_RaiseRoi: hl-Functions. -* Gpm_Repeat: Utility Functions. -* Gpm_UseRoi: hl-Functions. -* Gpm_Wgetch: Getting Events. - - -File: gpm.info, Node: Variable Index, Prev: Function Index, Up: Top - -Variable Index -************** - -* Menu: - -* gpm_current_roi: hl-Variables. -* gpm_data: Variables. -* gpm_fd: Variables. -* gpm_flag: Variables. -* gpm_handler: Variables. -* gpm_hflag: Variables. -* gpm_morekeys: Variables. -* gpm_mx: Variables. -* gpm_my: Variables. -* gpm_roi: hl-Variables. -* gpm_roi_data: hl-Variables. -* gpm_roi_handler: hl-Variables. -* gpm_tried: Variables. -* gpm_visiblepointer: Variables. -* gpm_zerobased: Variables. - - - -Tag Table: -Node: Top1283 -Node: Overview1516 -Node: Building the Release3290 -Node: Server Invocation3706 -Node: Special Commands4893 -Node: Command Line7301 -Node: Bugs and Problems14422 -Node: Mouse Types15288 -Node: Gpm Internals25124 -Node: Events26001 -Node: Margins28475 -Node: Event Types29588 -Node: Connection Details31594 -Node: Default Handlers35585 -Node: The ClientLib37153 -Node: Handling Functions37833 -Node: Low Level Library40692 -Node: Variables41180 -Node: Open and Close43253 -Node: Getting Events45212 -Node: Utility Functions47432 -Node: Extra Functions48997 -Node: High Level Lib51404 -Node: Concepts52347 -Node: hl-Variables53732 -Node: hl-Functions54383 -Node: Xterm56894 -Node: Demo Clients58007 -Node: mev58233 -Node: sample/rmev61440 -Node: Emacs Support61938 -Node: gpm-root64035 -Node: hltest72409 -Node: mouse-test72871 -Node: Type Index73379 -Node: Function Index73725 -Node: Variable Index75169 - -End Tag Table diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/infofilter b/software/gpm/browse_source/gpm-1.20.2-broken/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/manpager b/software/gpm/browse_source/gpm-1.20.2-broken/doc/manpager deleted file mode 100644 index 17c79661..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub(/@b\{/,"\\fB"); - gsub(/\}/,"\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub(/@var\{/,"\\fB"); - gsub(/\}/,"\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub(/@(samp|code|file)\{/,""); - gsub(/\}/,""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub(/@ref\{/,""); - gsub(/\}/,""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub(/[^\\]%.*$/,""); - gsub(/\%/,"%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub(/^[ \t]/,"");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub(/\\ /, "\\\\ ");} - - {gsub(/~/, "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/mktxt b/software/gpm/browse_source/gpm-1.20.2-broken/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/README b/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/install-sh b/software/gpm/browse_source/gpm-1.20.2-broken/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_CHECK_TYPE.m4 b/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_CHECK_TYPE.m4 deleted file mode 100644 index cfbe7350..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_CHECK_TYPE.m4 +++ /dev/null @@ -1,9 +0,0 @@ -AC_DEFUN([ITZ_CHECK_TYPE], -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_PATH_SITE_LISP.m4 b/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_PATH_SITE_LISP.m4 deleted file mode 100644 index 3737c437..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_PATH_SITE_LISP.m4 +++ /dev/null @@ -1,9 +0,0 @@ -AC_DEFUN([ITZ_PATH_SITE_LISP], -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_SYS_ELF.m4 b/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_SYS_ELF.m4 deleted file mode 100644 index 860c4f88..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/m4/ITZ_SYS_ELF.m4 +++ /dev/null @@ -1,17 +0,0 @@ -AC_DEFUN([ITZ_SYS_ELF], -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz deleted file mode 100644 index bf630ad0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/MS3-PATCH-ANDREW.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/MS3-PATCH-ANDREW.gz deleted file mode 100644 index bf1a6d33..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/MS3-PATCH-ANDREW.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/OPEN_MAX.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/OPEN_MAX.gz deleted file mode 100644 index 98d577a9..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/OPEN_MAX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/VSXXX-AA-patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/VSXXX-AA-patch.gz deleted file mode 100644 index de76a90f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/VSXXX-AA-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_1.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_1.gz deleted file mode 100644 index 969a4294..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_2.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_2.gz deleted file mode 100644 index 03d782e1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_2.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_3.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_3.gz deleted file mode 100644 index 61655fbc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/andreas_mohr_3.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_12.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_12.gz deleted file mode 100644 index d27fb356..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_12.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_3rd-final?.tar.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_3rd-final?.tar.gz deleted file mode 100644 index 2317ced5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_3rd-final?.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_c_7.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_c_7.gz deleted file mode 100644 index 0c0e799b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/diff_synaptics_c_7.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/evdev.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/evdev.patch.gz deleted file mode 100644 index 11cfee16..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/evdev.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz deleted file mode 100644 index e09018f2..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz deleted file mode 100644 index 9c37a865..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz deleted file mode 100644 index ab2a7433..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz deleted file mode 100644 index 118b8572..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.0-wheel.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.0-wheel.patch.gz deleted file mode 100644 index ef7450ba..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.0-wheel.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-ceil.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-ceil.patch deleted file mode 100644 index a8c3d391..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-ceil.patch +++ /dev/null @@ -1,116 +0,0 @@ -Hello, - - Gpm 1.20.1 fails to build for me for the mipsel-linux host. This happens -because the platform only defines ceil() in libm (as expected), while a -few others only work by an accident because they have an inline equivalent -in . The failure also happens for these platforms if optimization -is disabled in CFLAGS. Following is a fix that adds an autoconf test for - and whether linking against libm is needed to make use of ceil(). - - I've only tested the fix with autoconf 2.57 (I only use 2.5x for a long -time), hence that's the required version. It may work with older -versions; if not, fixing shouldn't be that difficult. Alternatively you -may consider upgrading autoconf -- the current version is much cleaner and -the transition should be painless as gpm's scripts seem to have no -incompatible hacks. - - Please apply, - - Maciej - --- -+ Maciej W. Rozycki, Technical University of Gdansk, Poland + -+--------------------------------------------------------------+ -+ e-mail: macro@ds2.pg.gda.pl, PGP key available + - -gpm-1.20.1-ceil.patch -diff -up --recursive --new-file gpm-1.20.1.macro/configure.in gpm-1.20.1/configure.in ---- gpm-1.20.1.macro/configure.in 2002-12-24 22:57:16.000000000 +0000 -+++ gpm-1.20.1/configure.in 2003-01-19 03:27:16.000000000 +0000 -@@ -4,7 +4,7 @@ dnl Process this file with autoconf to p - dnl written jan/1997 - T.E.Dickey - - AC_INIT(src/gpm.c) --AC_PREREQ(2.12) -+AC_PREREQ(2.57) - AC_CONFIG_HEADER(src/headers/config.h) - - release=1.20.1 -@@ -112,6 +112,41 @@ No|no|N|n) SHARED_LIBS=-lc ;; - LIBS=$SAVELIBS ;; - esac - -+dnl ceil() may be an inline, so check with no libm first -+AC_CHECK_HEADERS([math.h], , [AC_MSG_ERROR([a mandatory header is missing])]) -+AC_CACHE_CHECK([whether libm is needed for ceil], [gpm_cv_ceil_libm], -+[ceil_found=no -+for i in "" "-lm"; do -+ SAVELIBS=$LIBS -+ LIBS=$i -+ AC_LINK_IFELSE([AC_LANG_PROGRAM( -+[#ifdef HAVE_MATH_H -+#include -+#endif], [ceil(0.0);])], [ceil_found=yes]) -+ LIBS=$SAVELIBS -+ if test x$ceil_found = xyes; then -+ break -+ fi -+done -+if test x$ceil_found = xno; then -+ gpm_cv_ceil_libm=missing -+elif test x$i = x-lm; then -+ gpm_cv_ceil_libm=yes -+else -+ gpm_cv_ceil_libm=no -+fi]) -+case $gpm_cv_ceil_libm in -+no) -+ LIBM= -+ ;; -+yes) -+ LIBM=-lm -+ ;; -+*) -+ AC_MSG_ERROR([a mandatory function is missing]) -+ ;; -+esac -+ - GPMXTERM= - AC_SUBST(GPMXTERM) - AC_SUBST(release) -@@ -125,6 +160,7 @@ AC_SUBST(PICFLAGS) - AC_SUBST(SOLDFLAGS) - AC_SUBST(CURSES_OBJS) - AC_SUBST(SHARED_LIBS) -+AC_SUBST(LIBM) - AC_SUBST(lispdir) - - CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -diff -up --recursive --new-file gpm-1.20.1.macro/src/Makefile.in gpm-1.20.1/src/Makefile.in ---- gpm-1.20.1.macro/src/Makefile.in 2002-12-24 22:57:16.000000000 +0000 -+++ gpm-1.20.1/src/Makefile.in 2003-01-19 03:30:44.000000000 +0000 -@@ -70,6 +70,10 @@ prog/%: prog/%.o - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ @LIBM@ $(LIBS) -+ -+prog/mouse-test: prog/mouse-test.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ @LIBM@ $(LIBS) - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -diff -up --recursive --new-file gpm-1.20.1.macro/src/synaptics.c gpm-1.20.1/src/synaptics.c ---- gpm-1.20.1.macro/src/synaptics.c 2002-12-24 22:57:16.000000000 +0000 -+++ gpm-1.20.1/src/synaptics.c 2003-01-19 03:32:31.000000000 +0000 -@@ -209,7 +209,9 @@ - */ - - -+#ifdef HAVE_MATH_H - #include /* ceil */ -+#endif - #include - #include - #include - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-consolename.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-consolename.patch deleted file mode 100644 index 6be5c52a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-consolename.patch +++ /dev/null @@ -1,62 +0,0 @@ -Hello, - - Currently option.consolename is reinitialized to NULL whenever Gpm_Open() -is called. This leads to a crash due to a NULL pointer dereference for a -second invocation of the function, beacuse consolename is only set up for -the first one. I've discovered the bug with mc when switching back from -the underlying shell (i.e. toggling the program's panels on) -- with -1.20.1 it would always crash. - - Following is a trivial fix. Additionally it prevents a crash that might -happen if Gpm_get_console() returned NULL and returns an error from -Gpm_Open() instead. Finally, gpm_stack is now also checked for being -non-NULL. - - Please apply, - - Maciej - --- -+ Maciej W. Rozycki, Technical University of Gdansk, Poland + -+--------------------------------------------------------------+ -+ e-mail: macro@ds2.pg.gda.pl, PGP key available + - -gpm-1.20.1-consolename.patch -diff -up --recursive --new-file gpm-1.20.1.macro/src/lib/liblow.c gpm-1.20.1/src/lib/liblow.c ---- gpm-1.20.1.macro/src/lib/liblow.c 2002-12-24 22:57:16.000000000 +0000 -+++ gpm-1.20.1/src/lib/liblow.c 2003-01-19 01:15:51.000000000 +0000 -@@ -199,8 +199,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - Gpm_Stst *new = NULL; - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ -@@ -242,6 +240,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { -+ if (!option.consolename) { -+ gpm_report(GPM_PR_ERR,"option.consolename null"); -+ goto err; -+ } - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; -@@ -370,11 +372,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ }; - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-contrib.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-contrib.patch deleted file mode 100644 index 3a75f122..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-contrib.patch +++ /dev/null @@ -1,36 +0,0 @@ -Hello, - - Since $(ELISP) includes two files and in subdirectories, they need to be -properly handled for the "all" dependency and uninstallation. Here is an -obvious fix. Please apply. - - Maciej - --- -+ Maciej W. Rozycki, Technical University of Gdansk, Poland + -+--------------------------------------------------------------+ -+ e-mail: macro@ds2.pg.gda.pl, PGP key available + - -gpm-1.20.1-contrib.patch -diff -up --recursive --new-file gpm-1.20.1.macro/contrib/Makefile.in gpm-1.20.1/contrib/Makefile.in ---- gpm-1.20.1.macro/contrib/Makefile.in 2002-12-24 22:57:16.000000000 +0000 -+++ gpm-1.20.1/contrib/Makefile.in 2003-01-18 23:12:12.000000000 +0000 -@@ -9,7 +9,7 @@ top_builddir = .. - - include $(top_builddir)/Makefile.include - --all: $(srcdir)/$(ELISP) -+all: $(addprefix $(srcdir)/,$(ELISP)) - - install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ -@@ -21,7 +21,7 @@ install: all - - uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ -- rm -f $(lispdir)/$$i ;\ -+ rm -f $(lispdir)/`basename $$i` ;\ - done; fi - - dist: - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-shlib.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-shlib.patch deleted file mode 100644 index 1b0d2da9..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1-shlib.patch +++ /dev/null @@ -1,48 +0,0 @@ -Hello, - - There are bogus dependencies when one decides not to build a shared -library. In this case "all" depends on "lib/" and programs depend on -"lib/libgpm.so". Following is an obvious fix. Please apply. - - Maciej - --- -+ Maciej W. Rozycki, Technical University of Gdansk, Poland + -+--------------------------------------------------------------+ -+ e-mail: macro@ds2.pg.gda.pl, PGP key available + - -gpm-1.20.1-shlib.patch -diff -up --recursive --new-file gpm-1.20.1.macro/configure.in gpm-1.20.1/configure.in ---- gpm-1.20.1.macro/configure.in 2002-12-24 22:57:16.000000000 +0000 -+++ gpm-1.20.1/configure.in 2003-01-18 23:04:19.000000000 +0000 -@@ -83,7 +83,7 @@ fi - - ITZ_SYS_ELF - if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then -- SHLIB=libgpm.so -+ SHLIB=lib/libgpm.so - else - SHLIB= - fi -diff -up --recursive --new-file gpm-1.20.1.macro/src/Makefile.in gpm-1.20.1/src/Makefile.in ---- gpm-1.20.1.macro/src/Makefile.in 2002-12-24 22:57:16.000000000 +0000 -+++ gpm-1.20.1/src/Makefile.in 2003-01-18 23:05:07.000000000 +0000 -@@ -67,7 +67,7 @@ prog/%: prog/%.o - # | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - - # Do it all! --all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) -+all: gpm @SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) - -@@ -145,7 +145,7 @@ prog/gpm-root: prog/gpm-root.c - - prog/mouse-test: mice.o twiddler.o synaptics.o - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): @SHLIB@ lib/libgpm.a - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1.pts.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1.pts.patch deleted file mode 100644 index 7dd7d5ce..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1.pts.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -ruN gpm-1.20.1/src/headers/gpmInt.h gpm-1.20.1-pts/src/headers/gpmInt.h ---- gpm-1.20.1/src/headers/gpmInt.h 2002-12-25 00:56:54.000000000 +0200 -+++ gpm-1.20.1-pts/src/headers/gpmInt.h 2003-09-17 09:11:13.000000000 +0300 -@@ -82,6 +82,7 @@ - #define GPM_NULL_DEV "/dev/null" - #define GPM_SYS_CONSOLE "/dev/console" - #define GPM_DEVFS_CONSOLE "/dev/vc/0" -+#define GPM_PTS_CONSOLE "/dev/pts/0" - #define GPM_OLD_CONSOLE "/dev/tty0" - - /* for adding a mouse; add_mouse */ -diff -ruN gpm-1.20.1/src/tools.c gpm-1.20.1-pts/src/tools.c ---- gpm-1.20.1/src/tools.c 2002-12-25 00:56:54.000000000 +0200 -+++ gpm-1.20.1-pts/src/tools.c 2003-09-17 09:08:07.000000000 +0300 -@@ -46,6 +46,10 @@ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - -+ /* May it be that we are on the network console? */ -+ else if(stat(GPM_PTS_CONSOLE,&buf) == 0) -+ tmp = GPM_PTS_CONSOLE; -+ - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz deleted file mode 100644 index e2c494a0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-awksub.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-awksub.patch deleted file mode 100644 index 5721e7c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-awksub.patch +++ /dev/null @@ -1,77 +0,0 @@ -2004-03-25 Stepan Kasal - - * doc/manpager: the first argument to gsub is constant regex, - there is no need to give it as string; this also silences - some gawk warnings. - -diff -u -r1.1 manpager ---- gpm/doc/manpager 27 May 2002 15:35:47 -0000 1.1 -+++ gpm/doc/manpager 25 Mar 2004 13:23:46 -0000 -@@ -32,20 +32,20 @@ - # (ARub, Oct 10 2000) - /@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -- gsub("@b\{","\\fB"); -- gsub("\}","\\fP"); -+ gsub(/@b\{/,"\\fB"); -+ gsub(/\}/,"\\fP"); - } - - /@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -- gsub("@var\{","\\fB"); -- gsub("\}","\\fP"); -+ gsub(/@var\{/,"\\fB"); -+ gsub(/\}/,"\\fP"); - } - - /@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -- gsub("@(samp|code|file)\{",""); -- gsub("\}",""); -+ gsub(/@(samp|code|file)\{/,""); -+ gsub(/\}/,""); - } - - -@@ -54,8 +54,8 @@ - } - - /@ref\{.*\}/ { -- gsub("@ref\{",""); -- gsub("\}",""); -+ gsub(/@ref\{/,""); -+ gsub(/\}/,""); - } - - /@\*/ { -@@ -89,14 +89,14 @@ - - - { -- gsub("[^\\\\]%.*$",""); -- gsub("\\%","%"); -+ gsub(/[^\\]%.*$/,""); -+ gsub(/\%/,"%"); - } - - - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]","");} -+/^[ \t]/ {gsub(/^[ \t]/,"");} - - # put a .LP at blank lines - -@@ -112,9 +112,9 @@ - - # Escape single slashes (e.g. in documentation for `-l' command line option) - -- {gsub("\\\\ ", "\\\\ ");} -+ {gsub(/\\ /, "\\\\ ");} - -- {gsub("~", "~~");} -+ {gsub(/~/, "~~");} - - {print > NAME} - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-no-makeinfo.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-no-makeinfo.patch deleted file mode 100644 index d524aaa8..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm-no-makeinfo.patch +++ /dev/null @@ -1,17 +0,0 @@ -2004-03-25 Stepan Kasal - - * doc/Makefile.in: use @MAKEINFO@, not $(MAKEINFO), as the later - one can never be equal to "no". - -diff -u -r1.2 Makefile.in ---- gpm/doc/Makefile.in 30 Nov 2002 13:20:07 -0000 1.2 -+++ gpm/doc/Makefile.in 25 Mar 2004 13:23:46 -0000 -@@ -48,7 +48,7 @@ - - # INFO (makeinfo) - %.info: %.texinfo -- if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) $< -o $@; fi -+ if [ "@MAKEINFO@" != "no" ]; then $(MAKEINFO) $< -o $@; fi - - # TXT (-) - %.txt: %.info diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm06122002-cvs-tty.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm06122002-cvs-tty.patch.gz deleted file mode 100644 index fa16c22b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm06122002-cvs-tty.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm_synaptic_diff.gtar.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm_synaptic_diff.gtar.gz deleted file mode 100644 index 6872e2b8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm_synaptic_diff.gtar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm_unsigned_patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm_unsigned_patch.gz deleted file mode 100644 index 1f5b8862..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/gpm_unsigned_patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/repeater-patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/repeater-patch.gz deleted file mode 100644 index 4a590a94..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/repeater-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/repeater-patch.mail.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/repeater-patch.mail.gz deleted file mode 100644 index 8232d220..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/repeater-patch.mail.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/shlib-patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/shlib-patch.gz deleted file mode 100644 index 54a5cc01..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/applied/shlib-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-1.19.3-serialconsole.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-1.19.3-serialconsole.patch deleted file mode 100644 index 65a54431..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-1.19.3-serialconsole.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- gpm-1.19.3/gpm.c.serialconsole Fri Jan 5 14:10:46 2001 -+++ gpm-1.19.3/gpm.c Fri Jan 5 14:39:28 2001 -@@ -38,6 +38,7 @@ - #include /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.2-broken/scripts/gpm.release deleted file mode 100644 index da19cc56..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/scripts/gpm.release +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -OUT_NAME="$DDIR/gpm-${VERSION}.tar.bz2" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$DIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$DIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$DIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/.depend b/software/gpm/browse_source/gpm-1.20.2-broken/src/.depend deleted file mode 100644 index 888146e1..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/.depend +++ /dev/null @@ -1,804 +0,0 @@ - -client.o: client.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ - /usr/include/asm-i486/sigcontext.h /usr/include/linux/compiler.h \ - /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \ - /usr/include/sys/fcntl.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ - /usr/include/sys/stat.h /usr/include/bits/stat.h \ - /usr/include/sys/time.h /usr/include/sys/socket.h \ - /usr/include/sys/uio.h /usr/include/bits/uio.h \ - /usr/include/bits/socket.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h \ - /usr/include/limits.h /usr/include/bits/posix1_lim.h \ - /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-i486/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-i486/sockios.h \ - /usr/include/sys/un.h headers/gpmInt.h headers/gpm.h \ - /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - headers/message.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h headers/console.h headers/selection.h \ - headers/client.h /usr/include/linux/tty.h headers/gpm.h -console.o: console.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/sys/fcntl.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/sys/stat.h \ - /usr/include/bits/stat.h /usr/include/asm/types.h \ - /usr/include/asm-i486/types.h /usr/include/linux/vt.h \ - /usr/include/sys/kd.h /usr/include/linux/kd.h \ - /usr/include/linux/types.h /usr/include/linux/compiler.h \ - /usr/include/termios.h /usr/include/bits/termios.h \ - /usr/include/sys/ttydefaults.h headers/gpmInt.h /usr/include/sys/time.h \ - headers/gpm.h /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h headers/console.h headers/message.h \ - /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h -evdev.o: evdev.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/string.h /usr/include/sys/time.h \ - /usr/include/linux/input.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/asm/types.h /usr/include/asm-i486/types.h headers/gpm.h \ - /usr/include/paths.h headers/gpmInt.h headers/gpm.h headers/console.h \ - headers/message.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h headers/optparser.h -gpm.o: gpm.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h \ - /usr/include/limits.h /usr/include/bits/posix1_lim.h \ - /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/bits/posix2_lim.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-i486/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ - /usr/include/asm-i486/sigcontext.h /usr/include/linux/compiler.h \ - /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \ - /usr/include/sys/fcntl.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ - /usr/include/sys/wait.h /usr/include/sys/resource.h \ - /usr/include/bits/resource.h /usr/include/bits/waitflags.h \ - /usr/include/bits/waitstatus.h /usr/include/sys/time.h headers/gpmInt.h \ - headers/gpm.h /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - headers/message.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h headers/console.h headers/selection.h \ - headers/client.h /usr/include/linux/tty.h headers/gpm.h -gpn.o: gpn.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/ctype.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h headers/message.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - headers/gpmInt.h /usr/include/sys/time.h headers/gpm.h \ - /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - headers/gpm.h headers/console.h headers/selection.h -main.o: main.c headers/config.h headers/gpmInt.h /usr/include/sys/time.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h /usr/include/bits/types.h \ - /usr/include/bits/wordsize.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/typesizes.h /usr/include/time.h \ - /usr/include/bits/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h headers/gpm.h \ - /usr/include/paths.h /usr/include/stdio.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-i486/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/asm-i486/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h -mice.o: mice.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/string.h /usr/include/stdlib.h /usr/include/sys/types.h \ - /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/termios.h \ - /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/ctype.h /usr/include/sys/stat.h \ - /usr/include/bits/stat.h /usr/include/linux/kdev_t.h \ - /usr/include/linux/keyboard.h /usr/include/linux/wait.h \ - /usr/include/linux/joystick.h /usr/include/asm/types.h \ - /usr/include/asm-i486/types.h /usr/include/linux/input.h \ - /usr/include/sys/time.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h headers/gpmInt.h headers/gpm.h \ - /usr/include/paths.h headers/console.h headers/twiddler.h \ - headers/synaptics.h headers/message.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - headers/optparser.h -optparser.o: optparser.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/string.h /usr/include/stdlib.h /usr/include/sys/types.h \ - /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/ctype.h \ - headers/gpmInt.h /usr/include/sys/time.h headers/gpm.h \ - /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - headers/message.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h headers/optparser.h -report.o: report.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h headers/gpmInt.h /usr/include/sys/time.h \ - headers/gpm.h /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - headers/message.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h headers/console.h -selection.o: selection.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/sys/fcntl.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/sys/stat.h \ - /usr/include/bits/stat.h /usr/include/asm/types.h \ - /usr/include/asm-i486/types.h /usr/include/linux/vt.h \ - /usr/include/sys/kd.h /usr/include/linux/kd.h \ - /usr/include/linux/types.h /usr/include/linux/compiler.h \ - /usr/include/termios.h /usr/include/bits/termios.h \ - /usr/include/sys/ttydefaults.h headers/gpmInt.h /usr/include/sys/time.h \ - headers/gpm.h /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h headers/message.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - headers/console.h headers/selection.h -server_tools.o: server_tools.c headers/config.h /usr/include/string.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/stdlib.h /usr/include/sys/types.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \ - /usr/include/bits/endian.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \ - /usr/include/alloca.h /usr/include/sys/fcntl.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h headers/gpmInt.h /usr/include/sys/time.h \ - headers/gpm.h /usr/include/paths.h /usr/include/stdio.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/include/bits/wchar.h /usr/include/gconv.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-i486/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/asm-i486/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h headers/message.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h -special.o: special.c headers/config.h /usr/include/linux/limits.h \ - /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/signal.h \ - /usr/include/bits/signum.h /usr/include/bits/siginfo.h \ - /usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \ - /usr/include/asm/sigcontext.h /usr/include/asm-i486/sigcontext.h \ - /usr/include/linux/compiler.h /usr/include/bits/sigstack.h \ - /usr/include/bits/sigthread.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-i486/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h \ - /usr/include/limits.h /usr/include/bits/posix1_lim.h \ - /usr/include/bits/local_lim.h /usr/include/bits/posix2_lim.h \ - /usr/include/linux/param.h /usr/include/asm/param.h \ - /usr/include/asm-i486/param.h headers/gpmInt.h /usr/include/sys/time.h \ - headers/gpm.h /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - headers/console.h -startup.o: startup.c headers/config.h /usr/include/stdlib.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/sys/types.h /usr/include/bits/types.h \ - /usr/include/bits/wordsize.h /usr/include/bits/typesizes.h \ - /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ - /usr/include/asm-i486/sigcontext.h /usr/include/linux/compiler.h \ - /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \ - /usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h headers/gpmInt.h /usr/include/sys/time.h \ - headers/gpm.h /usr/include/paths.h /usr/include/stdio.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/include/bits/wchar.h /usr/include/gconv.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-i486/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/asm-i486/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h headers/message.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - headers/console.h headers/selection.h -synaptics.o: synaptics.c headers/config.h /usr/include/math.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \ - /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \ - /usr/include/stdio.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/string.h /usr/include/sys/time.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-i486/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/asm-i486/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h headers/gpm.h /usr/include/paths.h \ - headers/gpmInt.h headers/gpm.h headers/synaptics.h headers/message.h \ - /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h -twiddler.o: twiddler.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-i486/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/string.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/ctype.h \ - /usr/include/sys/stat.h /usr/include/bits/stat.h \ - /usr/include/sys/time.h /usr/include/linux/vt.h headers/gpm.h \ - /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - headers/gpmInt.h headers/gpm.h headers/message.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - headers/console.h headers/twiddler.h -libcurses.o: lib/libcurses.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/sys/time.h headers/gpmInt.h \ - headers/gpm.h /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - /usr/include/ncurses.h /usr/include/ncurses_dll.h /usr/include/unctrl.h \ - /usr/include/curses.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdbool.h -libhigh.o: lib/libhigh.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h headers/gpmInt.h \ - /usr/include/sys/time.h headers/gpm.h /usr/include/paths.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-i486/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/asm-i486/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - /usr/include/sys/ttydefaults.h -liblow.o: lib/liblow.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/ctype.h \ - /usr/include/string.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/sys/time.h \ - /usr/include/sys/socket.h /usr/include/sys/uio.h \ - /usr/include/bits/uio.h /usr/include/bits/socket.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h \ - /usr/include/limits.h /usr/include/bits/posix1_lim.h \ - /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \ - /usr/include/asm/socket.h /usr/include/asm-i486/socket.h \ - /usr/include/asm/sockios.h /usr/include/asm-i486/sockios.h \ - /usr/include/sys/un.h /usr/include/sys/fcntl.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/sys/stat.h \ - /usr/include/bits/stat.h /usr/include/signal.h \ - /usr/include/bits/signum.h /usr/include/bits/siginfo.h \ - /usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \ - /usr/include/asm/sigcontext.h /usr/include/asm-i486/sigcontext.h \ - /usr/include/linux/compiler.h /usr/include/bits/sigstack.h \ - /usr/include/bits/sigthread.h /usr/include/linux/vt.h \ - /usr/include/sys/kd.h /usr/include/linux/kd.h \ - /usr/include/linux/types.h /usr/include/termios.h \ - /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ - headers/gpmInt.h headers/gpm.h /usr/include/paths.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-i486/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/asm-i486/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \ - headers/message.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h -libxtra.o: lib/libxtra.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/sys/time.h \ - /usr/include/unistd.h /usr/include/bits/posix_opt.h \ - /usr/include/bits/confname.h /usr/include/getopt.h \ - /usr/include/string.h headers/gpmInt.h headers/gpm.h \ - /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ - headers/message.h /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h -report-lib.o: lib/report-lib.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h headers/message.h \ - /usr/include/syslog.h /usr/include/sys/syslog.h \ - /usr/include/bits/syslog-path.h -tools.o: lib/tools.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/string.h /usr/include/stdlib.h /usr/include/sys/types.h \ - /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/sys/stat.h \ - /usr/include/bits/stat.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h headers/gpmInt.h /usr/include/sys/time.h \ - headers/gpm.h /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h -disable-paste.o: prog/disable-paste.c headers/config.h \ - /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/ctype.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ - /usr/include/asm-i486/sigcontext.h /usr/include/linux/compiler.h \ - /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \ - /usr/include/sys/time.h /usr/include/termios.h \ - /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h headers/gpm.h \ - /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h headers/gpmInt.h headers/gpm.h -gpm-root.o: prog/gpm-root.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/ctype.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/sys/wait.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ - /usr/include/asm-i486/sigcontext.h /usr/include/linux/compiler.h \ - /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \ - /usr/include/sys/resource.h /usr/include/bits/resource.h \ - /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - /usr/include/pwd.h /usr/include/grp.h /usr/include/sys/kd.h \ - /usr/include/linux/kd.h /usr/include/linux/types.h \ - /usr/include/sys/stat.h /usr/include/bits/stat.h \ - /usr/include/sys/utsname.h /usr/include/bits/utsname.h \ - /usr/include/termios.h /usr/include/bits/termios.h \ - /usr/include/sys/ttydefaults.h /usr/include/linux/limits.h \ - /usr/include/linux/vt.h /usr/include/linux/keyboard.h \ - /usr/include/linux/wait.h /usr/include/utmp.h /usr/include/bits/utmp.h \ - /usr/include/paths.h /usr/include/sys/time.h /usr/include/linux/major.h \ - headers/message.h /usr/include/syslog.h headers/gpm.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-i486/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/asm-i486/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h -hltest.o: prog/hltest.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/string.h /usr/include/sys/stat.h \ - /usr/include/bits/stat.h /usr/include/sys/time.h /usr/include/fcntl.h \ - /usr/include/bits/fcntl.h /usr/include/signal.h \ - /usr/include/bits/signum.h /usr/include/bits/siginfo.h \ - /usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \ - /usr/include/asm/sigcontext.h /usr/include/asm-i486/sigcontext.h \ - /usr/include/linux/compiler.h /usr/include/bits/sigstack.h \ - /usr/include/bits/sigthread.h /usr/include/termios.h \ - /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ - headers/gpm.h /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h -mev.o: prog/mev.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \ - /usr/include/ctype.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ - /usr/include/asm-i486/sigcontext.h /usr/include/linux/compiler.h \ - /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \ - /usr/include/sys/time.h /usr/include/termios.h \ - /usr/include/bits/termios.h /usr/include/sys/ttydefaults.h \ - /usr/include/errno.h /usr/include/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/asm/errno.h \ - /usr/include/asm-i486/errno.h /usr/include/asm-generic/errno.h \ - /usr/include/asm-generic/errno-base.h /usr/include/linux/keyboard.h \ - /usr/include/linux/wait.h headers/message.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h headers/gpm.h \ - /usr/include/paths.h /usr/include/sys/ioctl.h \ - /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ - /usr/include/asm-i486/ioctls.h /usr/include/asm/ioctl.h \ - /usr/include/asm-i486/ioctl.h /usr/include/asm-generic/ioctl.h \ - /usr/include/bits/ioctl-types.h -mouse-test.o: prog/mouse-test.c headers/config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/stubs.h \ - /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h \ - /usr/include/bits/types.h /usr/include/bits/wordsize.h \ - /usr/include/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \ - /usr/include/gconv.h /usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h \ - /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ - /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/sys/select.h /usr/include/bits/select.h \ - /usr/include/bits/sigset.h /usr/include/bits/time.h \ - /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ - /usr/include/bits/sched.h /usr/include/alloca.h /usr/include/unistd.h \ - /usr/include/bits/posix_opt.h /usr/include/bits/confname.h \ - /usr/include/getopt.h /usr/include/string.h /usr/include/errno.h \ - /usr/include/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/asm/errno.h /usr/include/asm-i486/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/sys/stat.h /usr/include/bits/stat.h \ - /usr/include/sys/time.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ - /usr/include/signal.h /usr/include/bits/signum.h \ - /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \ - /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \ - /usr/include/asm-i486/sigcontext.h /usr/include/linux/compiler.h \ - /usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \ - /usr/include/termios.h /usr/include/bits/termios.h \ - /usr/include/sys/ttydefaults.h headers/message.h /usr/include/syslog.h \ - /usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \ - headers/gpmInt.h headers/gpm.h /usr/include/paths.h \ - /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \ - /usr/include/asm/ioctls.h /usr/include/asm-i486/ioctls.h \ - /usr/include/asm/ioctl.h /usr/include/asm-i486/ioctl.h \ - /usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.2-broken/src/Makefile.in deleted file mode 100644 index 096e9f46..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/Makefile.in +++ /dev/null @@ -1,181 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001,2002 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules -MICESRC = mice.c twiddler.c synaptics.c @EVDEV_SRCS@ - -GSRC = main.c gpm.c gpn.c special.c startup.c server_tools.c console.c \ - selection.c client.c optparser.c $(MICESRC) - -GOBJ = $(GSRC:.c=.o) report.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c lib/tools.c - -LOBJ = $(LSRC:.c=.o) @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -ifeq (@SHLIB@,) -LINK_LIB := lib/libgpm.a -else -LINK_LIB := @SHLIB@ -endif - -# Do it all! -all: gpm @SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ @LIBM@ $(LIBS) - -prog/mouse-test: prog/mouse-test.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ @LIBM@ $(LIBS) - -subdirs-exist: - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do if ! test -e "$$cfiles" ; then $(LN_S) $$cfiles; fi; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do if ! test -e "$$cfiles" ; then \ - $(LN_S) $$cfiles; fi; done - - # execute only once - touch $@ - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: subdirs-exist prog/gpm-root.c - # cleanup - echo "" > "$(DEPFILE)" - # create dependencies - for DEPS in `echo *.c lib/*.c prog/*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -# $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -# $(SED) 's/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# cleaning up section - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile subdirs-exist $(DEPFILE) - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) $(LINK_LIB) - -prog/mouse-test: $(MICESRC:.c=.o) console.o optparser.o - -$(PROG): @SHLIB@ lib/libgpm.a - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/client.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/client.c deleted file mode 100644 index 98935f8a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/client.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - * client.c - GPM client handling (server side) - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001,2002 Nico Schottelius - * Copyright (C) 2003 Dmitry Torokhov - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include /* O_RDONLY */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/console.h" -#include "headers/selection.h" -#include "headers/client.h" - -/* who the f*** runs gpm without glibc? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -extern int errno; - -struct client_info *cinfo[MAX_VC + 1]; - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -static int get_data(int fd, Gpm_Connect *data) -{ - static int len; - -#ifdef GPM_USE_MAGIC - while ((len = read(whence, &check, sizeof(int))) == 4 && - check != GPM_MAGIC) - gpm_report(GPM_PR_INFO, GPM_MESS_NO_MAGIC); - - if (len == 0) return 0; - - if (check != GPM_MAGIC) { - gpm_report(GPM_PR_INFO, GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - len = read(fd, data, sizeof(Gpm_Connect)); - - return len ? (len == sizeof(Gpm_Connect) ? 1 : -1) : 0; -} - -/*-------------------------------------------------------------------*/ -int listen_for_clients(void) -{ - struct sockaddr_un ctladdr; - int fd, len; - - unlink(GPM_NODE_CTL); - - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - gpm_report(GPM_PR_OOPS, GPM_MESS_SOCKET_PROB); - - memset(&ctladdr, 0, sizeof(ctladdr)); - ctladdr.sun_family = AF_UNIX; - strcpy(ctladdr.sun_path, GPM_NODE_CTL); - len = sizeof(ctladdr.sun_family) + strlen(GPM_NODE_CTL); - - if (bind(fd, (struct sockaddr *)&ctladdr, len) == -1) - gpm_report(GPM_PR_OOPS, GPM_MESS_BIND_PROB, ctladdr.sun_path); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL, 0777); - listen(fd, 5); /* Queue up calls */ - - return fd; -} - -/*-------------------------------------------------------------------*/ -struct client_info *accept_client_connection(int fd) -{ - struct client_info *info; - Gpm_Connect *request; - int newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - socklen_t len; -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ -#ifndef SO_PEERCRED - struct stat statbuf; - time_t staletime; -#endif - uid_t uid; - - /*....................................... Accept */ - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_UNIX; - - len = sizeof(addr); - if ((newfd = accept(fd, (struct sockaddr *)&addr, &len)) < 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_ACCEPT_FAILED, strerror(errno)); - return NULL; - } - - gpm_report(GPM_PR_INFO, GPM_MESS_CONECT_AT, newfd); - - if (!(info = malloc(sizeof(struct client_info)))) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - - request = &info->data; - if (get_data(newfd, request) == -1) - goto err; - - if (request->vc > MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, request->vc, MAX_VC); - goto err; - } - -#ifndef SO_PEERCRED - if (stat(addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - goto err; - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime || - statbuf.st_ctime < staletime || - statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR, GPM_MESS_SOCKET_OLD); - goto err; - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if (getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - goto err; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - - if (uid != 0 && !is_console_owner(request->vc, uid)) { - gpm_report(GPM_PR_WARN, GPM_MESS_FAILED_CONNECT, uid, request->vc); - goto err; - } - - /* register the connection information in the right place */ - info->next = cinfo[request->vc]; - info->fd = newfd; - cinfo[request->vc] = info; - gpm_report(GPM_PR_DEBUG, GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - return info; - -err: - free(info); - close(newfd); - - return NULL; -} - -/*-------------------------------------------------------------------*/ -void remove_client(struct client_info *ci, int vc) -{ - struct client_info *p, *prev = NULL; - - for (p = cinfo[vc]; p; prev = p, p = p->next) { - if (p == ci) { - if (!prev) /* it is on top of the stack */ - cinfo[vc] = p->next; - else - prev->next = p->next; - break; - } - } - if (p) free(p); -} - -/*-------------------------------------------------------------------*/ -void notify_clients_resize(void) -{ - struct client_info *ci; - int i; - - for (i = 0; i < MAX_VC + 1; i++) - for (ci = cinfo[i]; ci; ci = ci->next) - kill(ci->data.pid, SIGWINCH); -} - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(struct client_info *cinfo, Gpm_Event *event) -{ - Gpm_Connect *info = &cinfo->data; - /* value to return if event is not used */ - int res = !(info->defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info->minMod & event->modifiers) < info->minMod) - goto try_next; - if ((info->maxMod & event->modifiers) < event->modifiers) - goto try_next; - - /* if not managed, use default mask */ - if (!(info->eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto try_next; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(cinfo->fd, &magic, sizeof(int)))); - write(cinfo->fd, event, sizeof(Gpm_Event)); - - return info->defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - try_next: - if (cinfo->next != 0) - return do_client(cinfo->next, event); /* try the next */ - - return 0; /* no next, not used */ -} - -/*-------------------------------------------------------------------*/ -/* returns 0 if client disconnects, -1 - error, 1 -successs */ -int process_client_request(struct client_info *ci, int vc, - int x, int y, int buttons, int clicks, - int three_button_mouse) -{ - int rc; - Gpm_Connect conn; - static Gpm_Event event; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - if (vc > MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc == -1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - rc = get_data(ci->fd, &conn); - - if (rc == 0) { /* no data */ - gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE); - close(ci->fd); - return 0; - } - - if (rc == -1) return -1; /* too few bytes */ - - if (conn.pid != 0) { - ci->data = conn; - return 1; - } - - /* Aha, request for information (so-called snapshot) */ - switch (conn.vc) { - case GPM_REQ_SNAPSHOT: - event.vc = get_console_state(&event.modifiers); - event.x = x; event.y = y; - event.buttons = buttons; - event.clicks = clicks; - event.dx = console.max_x; event.dy = console.max_y; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type = (three_button_mouse == 1 ? 3 : 2); /* buttons */ - write(ci->fd, &event, sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - selection_disable_paste(); - gpm_report(GPM_PR_INFO, GPM_MESS_DISABLE_PASTE, vc); - break; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/console.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/console.c deleted file mode 100644 index ba0ccda3..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/console.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * console.c - GPM console and selection/paste handling - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001,2002 Nico Schottelius - * Copyright (c) 2003 Dmitry Torokhov - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* time() */ -#include /* O_RDONLY */ -#include /* mkdir() */ -#include /* __u32 */ - -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/console.h" -#include "headers/message.h" - -#ifndef HAVE___U32 -# ifndef _I386_TYPES_H /* /usr/include/asm/types.h */ -typedef unsigned int __u32; -# endif -#endif - -struct gpm_console console = { 0, DEF_LUT, 0, 0 }; - -/*-------------------------------------------------------------------*/ -static int count_digits(int num) -{ - int digits = 1; - - while ((num /= 10)) - digits++; - - return digits; -} - -/*-------------------------------------------------------------------*/ -char *compose_vc_name(int vc) -{ - char *tty; - - tty = malloc(strlen(console.device) + count_digits(vc) + sizeof(char)); - if (tty) { - /* console is /dev/vc/0 or /dev/tty0 and we trimming the ending 0 */ - strncpy(tty, console.device, strlen(console.device) - 1); - sprintf(&tty[strlen(console.device) - 1], "%d", vc); - } - - return tty; -} - -/*-------------------------------------------------------------------*/ -int open_console(int mode) -{ - int fd; - - if ((fd = open(console.device, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN_CON); - - return fd; -} - -/*-------------------------------------------------------------------*/ -int is_text_console(void) -{ - int fd; - int kd_mode; - - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_KDGETMODE); - close(fd); - - return kd_mode == KD_TEXT; -} - -/*-------------------------------------------------------------------*/ -void wait_text_console(void) -{ - do { - sleep(2); - } while (!is_text_console()); -} - -/*-------------------------------------------------------------------*/ -void refresh_console_size(void) -{ - struct winsize win; - int fd = open_console(O_RDONLY); - - ioctl(fd, TIOCGWINSZ, &win); - close(fd); - - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_ZERO_SCREEN_DIM); - console.max_x = 80; console.max_y = 25; - } else { - console.max_x = win.ws_col; console.max_y = win.ws_row; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_SCREEN_SIZE, console.max_x, console.max_y); -} - -/*-------------------------------------------------------------------*/ -int get_console_state(unsigned char *shift_state) -{ - struct vt_stat stat; - int fd; - - fd = open_console(O_RDONLY); - - *shift_state = 6; /* code for the ioctl */ - if (ioctl(fd, TIOCLINUX, shift_state) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_GET_SHIFT_STATE); - - if (ioctl(fd, VT_GETSTATE, &stat) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_GET_CONSOLE_STAT); - - close(fd); - - return stat.v_active; -} - -/*-------------------------------------------------------------------*/ -int is_console_owner(int vc, uid_t uid) -{ - struct stat statbuf; - char *tty; - int rc; - - if ((tty = compose_vc_name(vc)) == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - - if ((rc = stat(tty, &statbuf)) == -1) - gpm_report(GPM_PR_ERR, GPM_MESS_STAT_FAILS, tty); - - free(tty); - - return rc != -1 && uid == statbuf.st_uid; -} - -/*-------------------------------------------------------------------*/ -/* octal digit */ -static int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - -/*-------------------------------------------------------------------*/ -/* routine to convert digits from octal notation (Andries Brouwer) */ -static int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - -/*-------------------------------------------------------------------*/ -/* description missing! FIXME */ -void console_load_lut(void) -{ - extern int errno; - int i, c, fd; - unsigned char this, next; - static __u32 long_array[9] = { - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - -#define inwordLut (long_array+1) - - for (i = 0; console.charset[i]; ) { - i += getsym(console.charset + i, &this); - if (console.charset[i] == '-' && console.charset[i + 1] != '\0') - i += getsym(console.charset + i + 1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c >> 5] |= 1 << (c & 0x1F); - } - - fd = open_console(O_WRONLY); - - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno == EPERM && getuid()) - gpm_report(GPM_PR_WARN, GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno == EINVAL) - gpm_report(GPM_PR_OOPS, GPM_MESS_CSELECT); - } - close(fd); -} - -/*-------------------------------------------------------------------*/ -/* Returns the name of the console (/dev/tty0 or /dev/vc/0) */ -/* Also fills console.device */ -char *get_console_name() -{ - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE, &buf) == 0) - console.device = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if (stat(GPM_OLD_CONSOLE, &buf) == 0) - console.device = GPM_OLD_CONSOLE; - else - gpm_report(GPM_PR_OOPS, "Can't determine console device"); - - return console.device; -} - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/evdev.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/evdev.c deleted file mode 100644 index 5b390d29..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/evdev.c +++ /dev/null @@ -1,723 +0,0 @@ -/* - * evdev.c - support for event input devices in linux 2.4 & 2.6 - * - * Copyright (C) 2003 Dmitry Torokhov - * Based on XFree86 driver by Stefan Gmeiner & Peter Osterlund - * - * 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. - ********/ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/console.h" -#include "headers/message.h" -#include "headers/optparser.h" - -#ifndef MSC_GESTURE -#define MSC_GESTURE 2 -#endif - -#ifndef EV_SYNC -#define EV_SYNC 0 -#endif - -#ifndef SYN_REPORT -#define SYN_REPORT 0 -#endif - -#ifndef HAVE_INPUT_ABSINFO -struct input_absinfo { - int value; - int minimum; - int maximum; - int fuzz; - int flat; -}; -#endif - -enum evdev_type { - EVDEV_RELATIVE, - EVDEV_ABSOLUTE, - EVDEV_TOUCHPAD, - EVDEV_SYNAPTICS -}; - -enum touch_type { - TOUCH_NONE, - TOUCH_FINGERS, - TOUCH_PALM -}; - -enum gesture_type { - GESTURE_NONE, - GESTURE_TAP_PENDING, - GESTURE_TAP, - GESTURE_DRAG_PENDING, - GESTURE_DRAG, - GESTURE_DOUBLE_TAP -}; - -enum edge_type { - BOTTOM_EDGE = 1, - TOP_EDGE = 2, - LEFT_EDGE = 4, - RIGHT_EDGE = 8, - LEFT_BOTTOM_EDGE = BOTTOM_EDGE | LEFT_EDGE, - RIGHT_BOTTOM_EDGE = BOTTOM_EDGE | RIGHT_EDGE, - RIGHT_TOP_EDGE = TOP_EDGE | RIGHT_EDGE, - LEFT_TOP_EDGE = TOP_EDGE | LEFT_EDGE -}; - -struct event_data { - int dx, dy; - int wdx, wdy; - int abs_x, abs_y; - int buttons; - int pressure; - int w; - int synced; -}; - -struct touch_data { - enum touch_type type; - enum gesture_type gesture; - int finger_count; - int x, y; - int buttons; - int clicks; - struct timeval start; -}; - -struct event_device { - enum evdev_type type; - int dont_sync; - - struct event_data pkt; - int pkt_count; - - int prev_x[4], prev_y[4]; - int prev_pressure, avg_w; - struct touch_data touch; - - int left_edge, right_edge; - int top_edge, bottom_edge; - int touch_high, touch_low; - int tap_time, tap_move; - int y_inverted; -}; - -struct evdev_capabilities { - unsigned char evbits[EV_MAX/8 + 1]; - unsigned char keybits[KEY_MAX/8 + 1]; - unsigned char absbits[ABS_MAX/8 + 1]; - unsigned char mscbits[MSC_MAX/8 + 1]; -}; - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -#define fx(i) (evdev->prev_x[(evdev->pkt_count - (i)) & 03]) -#define fy(i) (evdev->prev_y[(evdev->pkt_count - (i)) & 03]) - -#define toggle_btn(btn, val) do { if (val) data->buttons |= (btn);\ - else data->buttons &= ~(btn);\ - } while (0) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec - t1.tv_sec) * 1000 + (t2.tv_usec - t1.tv_usec) / 1000) - -#define test_bit(bit, array) (array[bit / 8] & (1 << (bit % 8))) - -/* ------------- evdev protocol handling routines ---------------------*/ - -static void parse_input_event(struct input_event *event, struct event_data *data) -{ - switch (event->type) { - case EV_REL: - switch (event->code) { - case REL_X: - data->dx = (signed char)event->value; - break; - case REL_Y: - data->dy = (signed char)event->value; - break; - case REL_WHEEL: - data->wdy += event->value; - break; - case REL_HWHEEL: - data->wdx += event->value; - break; - } - break; - - case EV_ABS: - switch (event->code) { - case ABS_X: - data->abs_x = event->value; - break; - - case ABS_Y: - data->abs_y = event->value; - break; - - case ABS_PRESSURE: - data->pressure = event->value; - break; - } - break; - - case EV_MSC: - switch (event->code) { - case MSC_GESTURE: - data->w = event->value; - break; - } - break; - - - case EV_KEY: - switch(event->code) { - case BTN_0: - case BTN_TOUCH: - case BTN_LEFT: - toggle_btn(GPM_B_LEFT, event->value); - break; - case BTN_2: - case BTN_STYLUS2: - case BTN_SIDE: - case BTN_MIDDLE: - toggle_btn(GPM_B_MIDDLE, event->value); - break; - case BTN_STYLUS: - case BTN_1: - case BTN_RIGHT: - toggle_btn(GPM_B_RIGHT, event->value); - break; - } - break; - - case EV_SYNC: - switch(event->code) { - case SYN_REPORT: - data->synced = 1; - break; - } - break; - } -} - -static void tp_figure_deltas(struct event_device *evdev, struct Gpm_Event *state) -{ - struct event_data *pkt = &evdev->pkt; - - state->dx = state->dy = 0; - if (evdev->touch.type == TOUCH_FINGERS) { - fx(0) = pkt->abs_x; - fy(0) = pkt->abs_y; - if (evdev->pkt_count >= 2 && - evdev->touch.gesture != GESTURE_DRAG_PENDING) { - state->dx = ((fx(0) - fx(1)) / 2 + (fx(1) - fx(2)) / 2) / 8; //SYN_REL_DECEL_FACTOR; - state->dy = ((fy(0) - fy(1)) / 2 + (fy(1) - fy(2)) / 2) / 8; //SYN_REL_DECEL_FACTOR; - } - evdev->pkt_count++; - } else { - evdev->pkt_count = 0; - } -} - -static enum touch_type tp_detect_touch(struct event_device *evdev) -{ - if (evdev->touch.type == TOUCH_FINGERS) - return evdev->pkt.pressure > evdev->touch_low ? TOUCH_FINGERS : TOUCH_NONE; - else - return evdev->pkt.pressure > evdev->touch_high ? TOUCH_FINGERS : TOUCH_NONE; -} - -static enum touch_type syn_detect_touch(struct event_device *evdev) -{ - struct event_data *pkt = &evdev->pkt; - enum touch_type type = TOUCH_NONE; - - if (pkt->pressure > 200 || pkt->w > 10) - return TOUCH_PALM; /* palm */ - - if (pkt->abs_x == 0) - evdev->avg_w = 0; - else - evdev->avg_w = (pkt->w - evdev->avg_w + 1) / 2; - - if (evdev->touch.type == TOUCH_FINGERS) - type = pkt->pressure > evdev->touch_low ? TOUCH_FINGERS : TOUCH_NONE; - else if (pkt->pressure > evdev->touch_high) { - int safe_w = max(pkt->w, evdev->avg_w); - - if (pkt->w < 2) - type = TOUCH_FINGERS; /* more than one finger -> not a palm */ - else if (safe_w < 6 && evdev->prev_pressure < evdev->touch_high) - type = TOUCH_FINGERS; /* thin finger, distinct touch -> not a palm */ - else if (safe_w < 7 && evdev->prev_pressure < evdev->touch_high / 2) - type = TOUCH_FINGERS; /* thin finger, distinct touch -> not a palm */ - else if (pkt->pressure > evdev->prev_pressure + 1) - type = TOUCH_NONE; /* pressure not stable, may be a palm */ - else if (pkt->pressure < evdev->prev_pressure - 5) - type = TOUCH_NONE; /* pressure not stable, may be a palm */ - else - type = TOUCH_FINGERS; - } - - evdev->prev_pressure = pkt->pressure; - return type; -} - -static enum edge_type tp_detect_edges(struct event_device *evdev, int x, int y) -{ - enum edge_type edge = 0; - - if (x > evdev->right_edge) - edge |= RIGHT_EDGE; - else if (x < evdev->left_edge) - edge |= LEFT_EDGE; - - if (y > evdev->top_edge) - edge |= TOP_EDGE; - else if (y < evdev->bottom_edge) - edge |= BOTTOM_EDGE; - - return edge; -} - -static int tp_touch_expired(struct event_device *evdev) -{ - struct timeval now; - - GET_TIME(now); - return DIF_TIME(evdev->touch.start, now) > evdev->tap_time; -} - -static int tp_detect_tap(struct event_device *evdev) -{ - return evdev->touch.finger_count > 0 || - (!tp_touch_expired(evdev) && - abs(evdev->pkt.abs_x - evdev->touch.x) < evdev->tap_move && - abs(evdev->pkt.abs_y - evdev->touch.y) < evdev->tap_move); -} - -static int tp_tap_to_buttons(struct event_device *evdev) -{ - enum edge_type edge; - - if (!evdev->touch.finger_count) { - edge = tp_detect_edges(evdev, evdev->pkt.abs_x, evdev->pkt.abs_y); - switch (edge) { - case RIGHT_TOP_EDGE: - return GPM_B_MIDDLE; - break; - case RIGHT_BOTTOM_EDGE: - return GPM_B_RIGHT; - break; - default: - return GPM_B_LEFT; - break; - } - } else { - switch (evdev->touch.finger_count) { - case 2: - return GPM_B_MIDDLE; - case 3: - return GPM_B_RIGHT; - default: - return GPM_B_LEFT; - } - } -} - -static void tp_detect_gesture(struct event_device *evdev, int timed_out, struct Gpm_Event *state) -{ - struct touch_data *touch = &evdev->touch; - int was_touching = touch->type == TOUCH_FINGERS; - - touch->type = timed_out ? - TOUCH_NONE : (evdev->type == EVDEV_SYNAPTICS ? - syn_detect_touch(evdev) : tp_detect_touch(evdev)); - - if (touch->type == TOUCH_FINGERS) { - if (!was_touching) { - GET_TIME(touch->start); - if (touch->gesture == GESTURE_TAP_PENDING) { - touch->gesture = GESTURE_DRAG_PENDING; - } else { - touch->x = evdev->pkt.abs_x; - touch->y = evdev->pkt.abs_y; - touch->buttons = 0; - } - } else if (touch->gesture == GESTURE_DRAG_PENDING && tp_touch_expired(evdev)) { - touch->gesture = GESTURE_DRAG; - } - } else if (touch->type == TOUCH_NONE) { - if (was_touching) { - if (tp_detect_tap(evdev)) { - if (touch->gesture == GESTURE_DRAG_PENDING) { - touch->gesture = GESTURE_DOUBLE_TAP; - touch->clicks = 4; - } else { - if ((touch->buttons = tp_tap_to_buttons(evdev)) == GPM_B_LEFT) { - touch->gesture = GESTURE_TAP_PENDING; - } else { - touch->gesture = GESTURE_TAP; - touch->clicks = 2; - } - } - } else { - touch->gesture = GESTURE_NONE; - } - } else { - if (touch->gesture == GESTURE_TAP_PENDING && tp_touch_expired(evdev)) { - touch->gesture = GESTURE_TAP; - touch->clicks = 2; - } - } - } -} - -static int compose_gpm_event(struct event_device *evdev, int timed_out, Gpm_Event *state) -{ - struct event_data *pkt = &evdev->pkt; - int next_timeout = -1; - - state->buttons = pkt->buttons; - state->wdx = pkt->wdx; state->wdy = pkt->wdy; - - switch (evdev->type) { - case EVDEV_RELATIVE: - if (!timed_out) - state->dx = pkt->dx; state->dy = pkt->dy; - break; - - case EVDEV_ABSOLUTE: - if (!timed_out) { - if (pkt->abs_x < evdev->left_edge) - pkt->abs_x = evdev->left_edge; - else if (pkt->abs_x > evdev->right_edge) - pkt->abs_x = evdev->right_edge; - - if (pkt->abs_y < evdev->bottom_edge) - pkt->abs_y = evdev->bottom_edge; - else if (pkt->abs_y > evdev->top_edge) - pkt->abs_y = evdev->top_edge; - - state->x = (pkt->abs_x - evdev->left_edge) * - console.max_x / (evdev->right_edge - evdev->left_edge); - state->y = (pkt->abs_y - evdev->bottom_edge) * - console.max_y / (evdev->top_edge - evdev->bottom_edge); - - if (evdev->y_inverted) state->y = console.max_y - state->y; - } - break; - - case EVDEV_TOUCHPAD: - case EVDEV_SYNAPTICS: - tp_detect_gesture(evdev, timed_out, state); - tp_figure_deltas(evdev, state); - - if (evdev->type == EVDEV_SYNAPTICS && - evdev->touch.type == TOUCH_FINGERS && - !tp_touch_expired(evdev)) { - if (evdev->pkt.w == 0 && evdev->touch.finger_count == 0) - evdev->touch.finger_count = 2; - if (evdev->pkt.w == 1) - evdev->touch.finger_count = 3; - } else - evdev->touch.finger_count = 0; - - switch(evdev->touch.gesture) { - case GESTURE_DOUBLE_TAP: - case GESTURE_TAP: - if (evdev->touch.clicks <= 0) { - evdev->touch.gesture = GESTURE_NONE; - } else { - if (--evdev->touch.clicks % 2) - state->buttons |= evdev->touch.buttons; - else - state->buttons &= ~evdev->touch.buttons; - next_timeout = 0; - } - break; - case GESTURE_DRAG: - state->buttons |= evdev->touch.buttons; - break; - case GESTURE_DRAG_PENDING: - next_timeout = evdev->tap_time; - break; - case GESTURE_TAP_PENDING: - next_timeout = evdev->tap_time; - break; - default: - break; - } - - break; - } - - if (evdev->y_inverted) state->dy = -state->dy; - - return next_timeout; -} - -int M_evdev(struct micedev *dev, struct miceopt *opts, - unsigned char *data, struct Gpm_Event *state) -{ - struct event_device *evdev = dev->private; - struct input_event *event = (struct input_event *)data; - int timed_out = data == NULL; - - if (!timed_out) - parse_input_event(event, &evdev->pkt); - - if (timed_out || evdev->pkt.synced || evdev->dont_sync) { - dev->timeout = compose_gpm_event(evdev, timed_out, state); - evdev->pkt.synced = 0; - return 0; - } - - dev->timeout = -1; - return -1; -} - -/* ------------- evdev initialization routines ---------------------*/ - -static void evdev_get_capabilities(int fd, struct evdev_capabilities *caps) -{ - memset(caps, 0, sizeof(*caps)); - if (ioctl(fd, EVIOCGBIT(0, EV_MAX), caps->evbits) < 0) { - gpm_report(GPM_PR_OOPS, "evdev: cannot query device capabilities"); - } - - if (test_bit(EV_ABS, caps->evbits) && - ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(caps->absbits)), caps->absbits) < 0) { - gpm_report(GPM_PR_OOPS, "evdev: cannot query ABS device capabilities"); - } - - if (test_bit(EV_KEY, caps->evbits) && - ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(caps->keybits)), caps->keybits) < 0) { - gpm_report(GPM_PR_OOPS, "evdev: cannot query KEY device capabilities"); - } - - if (test_bit(EV_MSC, caps->evbits) && - ioctl(fd, EVIOCGBIT(EV_MSC, sizeof(caps->mscbits)), caps->mscbits) < 0) { - /* dont complain as 2.4 kernels didnt have it - gpm_report(GPM_PR_OOPS, "evdev: cannot query MSC device capabilities"); - */ - } -} - -static void evdev_query_axis(int fd, int axis, int *axis_min, int *axis_max) -{ - struct input_absinfo axis_info; - - if (ioctl(fd, EVIOCGABS(axis), &axis_info) == 0) { - *axis_min = axis_info.minimum; - *axis_max = axis_info.maximum; - } else - gpm_report(GPM_PR_ERR, "evdev: could not query axis data"); -} - -static enum evdev_type evdev_guess_type(struct evdev_capabilities *caps) -{ - if (test_bit(EV_ABS, caps->evbits)) { - if (caps->keybits[BTN_DIGI / 8] || !test_bit(ABS_PRESSURE, caps->absbits)) - return EVDEV_ABSOLUTE; - - return test_bit(EV_MSC, caps->evbits) && test_bit(MSC_GESTURE, caps->mscbits) ? - EVDEV_SYNAPTICS : EVDEV_TOUCHPAD; - } - - if (!test_bit(EV_REL, caps->evbits)) - gpm_report(GPM_PR_OOPS, - "evdev: device does not report neither absolute nor relative coordinates"); - - return EVDEV_RELATIVE; -} - -static enum evdev_type evdev_str_to_type(const char *type) -{ - if (!strcmp(type, "relative")) { - return EVDEV_RELATIVE; - } else if (!strcmp(type, "absolute")) { - return EVDEV_ABSOLUTE; - } else if (!strcmp(type, "touchpad")) { - return EVDEV_TOUCHPAD; - } else if (!strcmp(type, "synaptics")) { - return EVDEV_SYNAPTICS; - } else { - gpm_report(GPM_PR_OOPS, "evdev: unknown type '%s'", type); - return 0; /* won't happen as gpm_report(OOPS) does not return */ - } -} - -static void warn_if_present(struct option_helper *optinfo, const char *name, const char *type) -{ - if (is_option_present(optinfo, name)) - gpm_report(GPM_PR_WARN, - "evdev: option '%s' is not valud for type '%s', ignored", - name, type); -} - -// -o type=(auto|synaptics|touchpad|relative|absolute),y_inverted, -// left=1234,right=1234,top=1234,bottom=1234, -// touch_high=30,touch_low=25,tap_time=30,tap_move=100 -static void evdev_apply_options(struct event_device *evdev, char *optstring) -{ - char *type = "auto"; - struct option_helper optinfo[] = { - { "type", OPT_STRING, u: { sptr: &type } }, - { "y_inverted", OPT_BOOL, u: { iptr: &evdev->y_inverted }, value: 1 }, - { "left", OPT_INT, u: { iptr: &evdev->left_edge } }, - { "right", OPT_INT, u: { iptr: &evdev->right_edge } }, - { "top", OPT_INT, u: { iptr: &evdev->top_edge } }, - { "bottom", OPT_INT, u: { iptr: &evdev->bottom_edge } }, - { "touch_high", OPT_INT, u: { iptr: &evdev->touch_high } }, - { "touch_low", OPT_INT, u: { iptr: &evdev->touch_low } }, - { "tap_time", OPT_INT, u: { iptr: &evdev->tap_time } }, - { "tap_move", OPT_INT, u: { iptr: &evdev->tap_move } }, - { "", OPT_END } - }; - - if (parse_options("evdev", optstring, ',', optinfo) < 0) - gpm_report(GPM_PR_OOPS, "evdev: failed to parse option string"); - - if (strcmp(type, "auto")) - evdev->type = evdev_str_to_type(type); - - switch (evdev->type) { - case EVDEV_RELATIVE: - warn_if_present(optinfo, "left", type); - warn_if_present(optinfo, "right", type); - warn_if_present(optinfo, "top", type); - warn_if_present(optinfo, "bottom", type); - warn_if_present(optinfo, "tap_move", type); - warn_if_present(optinfo, "tap_time", type); - warn_if_present(optinfo, "touch_high", type); - warn_if_present(optinfo, "touch_low", type); - break; - - case EVDEV_ABSOLUTE: - warn_if_present(optinfo, "tap_move", type); - warn_if_present(optinfo, "tap_time", type); - warn_if_present(optinfo, "touch_high", type); - warn_if_present(optinfo, "touch_low", type); - break; - - case EVDEV_TOUCHPAD: - break; - - case EVDEV_SYNAPTICS: - warn_if_present(optinfo, "y_inverted", type); - break; - } -} - -int I_evdev(struct micedev *dev, struct miceopt *opts, Gpm_Type *type) -{ - struct evdev_capabilities caps; - struct event_device *evdev; - - if (!dev->private) { /* called first time, not re-init */ - if (!(dev->private = evdev = malloc(sizeof(*evdev)))) - gpm_report(GPM_PR_OOPS, "Can't allocate memory for event device"); - - memset(evdev, 0, sizeof(*evdev)); - - evdev_get_capabilities(dev->fd, &caps); - evdev->type = evdev_guess_type(&caps); - - /* load default values - suitable for my synaptics ;P */ - evdev->left_edge = 1900; - evdev->right_edge = 5400; - evdev->top_edge = 3900; - evdev->bottom_edge = 1800; - evdev->tap_time = 180; - evdev->tap_move = 220; - evdev->touch_high = 30; - evdev->touch_low = 25; - - if (evdev->type == EVDEV_ABSOLUTE) { - if (test_bit(ABS_X, caps.absbits)) - evdev_query_axis(dev->fd, ABS_X, &evdev->left_edge, &evdev->right_edge); - if (test_bit(ABS_Y, caps.absbits)) - evdev_query_axis(dev->fd, ABS_Y, &evdev->bottom_edge, &evdev->top_edge); - } - - evdev_apply_options(evdev, opts->text); - - if (!test_bit(EV_SYNC, caps.evbits)) { - evdev->dont_sync = 1; - if (evdev->type == EVDEV_TOUCHPAD || evdev->type == EVDEV_SYNAPTICS) - gpm_report(GPM_PR_OOPS, - "evdev: The running kernel lacks EV_SYNC support which is required for touchpad/synaptics mode"); - } - - switch (evdev->type) { - case EVDEV_RELATIVE: - gpm_report(GPM_PR_INFO, "evdev: selected Relative mode"); - if (!test_bit(EV_REL, caps.evbits)) - gpm_report(GPM_PR_WARN, "evdev: selected relative mode but device does not report any relative events"); - break; - - case EVDEV_ABSOLUTE: - gpm_report(GPM_PR_INFO, "evdev: selected Absolute mode"); - if (evdev->right_edge <= evdev->left_edge) - gpm_report(GPM_PR_OOPS, "evdev: right edge value should be gerater then left"); - if (evdev->top_edge <= evdev->bottom_edge) - gpm_report(GPM_PR_OOPS, "evdev: top edge value should be gerater then bottom"); - if (!test_bit(EV_ABS, caps.evbits)) - gpm_report(GPM_PR_WARN, "evdev: selected absolute mode but device does not report any absolute events"); - opts->absolute = 1; - break; - - case EVDEV_TOUCHPAD: - gpm_report(GPM_PR_INFO, "evdev: selected Touchpad mode"); - if (!test_bit(EV_ABS, caps.evbits)) - gpm_report(GPM_PR_WARN, "evdev: selected touchpad mode but device does not report any absolute events"); - if (!test_bit(ABS_PRESSURE, caps.absbits)) - gpm_report(GPM_PR_WARN, "evdev: selected touchpad mode but device does not report pressure"); - break; - - case EVDEV_SYNAPTICS: - gpm_report(GPM_PR_INFO, "evdev: selected Synaptics mode"); - if (!test_bit(EV_ABS, caps.evbits)) - gpm_report(GPM_PR_WARN, "evdev: selected synaptics mode but device does not report any absolute events"); - if (!test_bit(ABS_PRESSURE, caps.absbits)) - gpm_report(GPM_PR_WARN, "evdev: selected synaptics mode but device does not report pressure"); - if (!test_bit(EV_MSC, caps.evbits) || !test_bit(MSC_GESTURE, caps.mscbits)) - gpm_report(GPM_PR_WARN, "evdev: selected synaptics mode but device does not report gesture events"); - evdev->y_inverted = 1; /* Synaptics always has Y inverted */ - break; - } - } - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm.c deleted file mode 100644 index 340bd2ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm.c +++ /dev/null @@ -1,629 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001,2002 Nico Schottelius - * Copyright (c) 2003 Dmitry Torokhov - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include /* O_RDONLY */ -#include /* wait() */ -#include /* timeval */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/console.h" -#include "headers/selection.h" -#include "headers/client.h" - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#endif - -#define NULL_SET ((fd_set *)NULL) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec - t1.tv_sec)*1000 + (t2.tv_usec - t1.tv_usec)/1000) - - -enum mouse_rslt { MOUSE_NO_DATA, MOUSE_DATA_OK, MOUSE_MORE_DATA }; - -extern int errno; - -char *opt_special=NULL; /* special commands, like reboot or such */ -struct repeater repeater; - -static int console_resized; /* not really an option */ - -/*-------------------------------------------------------------------*/ -static void gpm_killed(int signo) -{ - if (signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - console_resized = 1; - } else { - if (signo == SIGUSR1) - gpm_report(GPM_PR_WARN, GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - exit(0); - } -} - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -static char *getMouseData(int fd, Gpm_Type *type, int text_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - unsigned char *pdata; - int len, togo; - - /*....................................... read and identify one byte */ - if (read(fd, data, type->howmany) != type->howmany) { - gpm_report(GPM_PR_ERR, GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (!text_mode && repeater.fd != -1 && repeater.raw) - write(repeater.fd, data, type->howmany); - - if ((data[0] & type->proto[0]) != type->proto[1]) { - if (type->getextra == 1) { - data[1] = GPM_EXTRA_MAGIC_1; data[2] = GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG, GPM_EXTRA_DATA, data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_PROT_ERR); - return NULL; - } - - /*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - if ((togo = type->packetlen - type->howmany)) { /* still to get */ - pdata = &data[type->howmany]; - do { - if ((len = read(fd, pdata, togo)) == 0) - break; - if (!text_mode && repeater.fd != -1 && repeater.raw && len > 0) - write(repeater.fd, pdata, len); - pdata += len; - togo -= len; - } while (togo); - } - - if (togo) { - gpm_report(GPM_PR_ERR, GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1] & type->proto[2]) != type->proto[3]) { - gpm_report(GPM_PR_INFO, GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_DATA_4, data[0], data[1], data[2], data[3]); - return data; -} - -/*-------------------------------------------------------------------*/ -void handle_console_resize(Gpm_Event *event) -{ - int old_x, old_y; - struct micetab *mouse; - - old_x = console.max_x; old_y = console.max_y; - refresh_console_size(); - if (!old_x) { /* first invocation, place the pointer in the middle */ - event->x = console.max_x / 2; - event->y = console.max_y / 2; - } else { /* keep the pointer in the same position where it was */ - event->x = event->x * console.max_x / old_x; - event->y = event->y * console.max_y / old_y; - } - - for (mouse = micelist; mouse; mouse = mouse->next) { - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - mouse->options.scaley = mouse->options.scalex * 50 * console.max_x / 80 / console.max_y; - gpm_report(GPM_PR_DEBUG, GPM_MESS_X_Y_VAL, - mouse->options.scalex, mouse->options.scaley); - } -} - -static void handle_repeater(int absolute_dev, Gpm_Event *new_event, Gpm_Event *event) -{ - static struct timeval last; - struct timeval now; - - if (absolute_dev) { - /* prepare the values from a absolute device for repeater mode */ - GET_TIME(now); - if (DIF_TIME(last, now) > 250) { - event->dx = 0; - event->dy = 0; - } - last = now; - - event->dy = event->dy * ((console.max_x / console.max_y) + 1); - event->x = new_event->x; - event->y = new_event->y; - } - repeater.type->repeat_fun(event, repeater.fd); -} - -static void calculate_clicks(Gpm_Event *event, int click_tmo) -{ - static struct timeval release; - struct timeval now; - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(now); - if (release.tv_sec && (DIF_TIME(release, now) < click_tmo)) /* check first click */ - event->clicks++, event->clicks %= 3; /* 0, 1 or 2 */ - else - event->clicks = 0; - event->type |= GPM_SINGLE << event->clicks; - break; - - case GPM_UP: - GET_TIME(release); - event->type |= GPM_SINGLE << event->clicks; - break; - - case GPM_DRAG: - event->type |= GPM_SINGLE << event->clicks; - break; - - case GPM_MOVE: - event->clicks = 0; - break; - - default: - break; - } -} - -static void snap_to_screen_limits(Gpm_Event *event) -{ - int extent; - - /* The current policy is to force the following behaviour: - * - At buttons down cursor position must be inside the screen, - * though flags are set. - * - At button up allow going outside by one single step - * - * We are using 1-baeed coordinates, like the original "selection". - * Only one margin will be reported, Y takes priority over X. - */ - - extent = (event->type & (GPM_DRAG|GPM_UP)) ? 1 : 0; - - event->margin = 0; - - if (event->y > console.max_y) { - event->y = console.max_y + extent; - extent = 0; - event->margin = GPM_BOT; - } else if (event->y <= 0) { - event->y = 1 - extent; - extent = 0; - event->margin = GPM_TOP; - } - - if (event->x > console.max_x) { - event->x = console.max_x + extent; - if (!event->margin) event->margin = GPM_RGT; - } else if (event->x <= 0) { - event->x = 1 - extent; - if (!event->margin) event->margin = GPM_LFT; - } -} - -static int more_data_waiting(int fd) -{ - static struct timeval timeout = {0, 0}; - fd_set fdSet; - - FD_ZERO(&fdSet); - FD_SET(fd, &fdSet); - select(fd + 1, &fdSet, NULL_SET, NULL_SET, &timeout/* zero */); - - return FD_ISSET(fd, &fdSet); -} - -static int multiplex_buttons(struct micetab *mouse, int new_buttons) -{ - static int left_btn_clicks, mid_btn_clicks, right_btn_clicks; - int mask; - int muxed_buttons = 0; - - new_buttons = - (mouse->options.sequence[new_buttons & 7] & 7) | (new_buttons & ~7); - mask = new_buttons ^ mouse->buttons; - mouse->buttons = new_buttons; - - if (mask & GPM_B_LEFT) { - if (new_buttons & GPM_B_LEFT) left_btn_clicks++; - else left_btn_clicks--; - } - if (left_btn_clicks) muxed_buttons |= GPM_B_LEFT; - - if (mask & GPM_B_MIDDLE) { - if (new_buttons & GPM_B_MIDDLE) mid_btn_clicks++; - else mid_btn_clicks--; - } - if (mid_btn_clicks) muxed_buttons |= GPM_B_MIDDLE; - - if (mask & GPM_B_RIGHT) { - if (new_buttons & GPM_B_RIGHT) right_btn_clicks++; - else right_btn_clicks--; - } - if (right_btn_clicks) muxed_buttons |= GPM_B_RIGHT; - - return muxed_buttons; -} - -/*------------------------------------------------------------------- - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - *-------------------------------------------------------------------*/ -static enum mouse_rslt processMouse(struct micetab *mouse, int timeout, int attempt, - Gpm_Event *event, int text_mode) -{ - static int last_active; - static int fine_dx, fine_dy; - static int oldB; - - static Gpm_Event nEvent; - struct Gpm_Type *type = mouse->type; - struct miceopt *opt = &mouse->options; - enum mouse_rslt rslt = MOUSE_DATA_OK; - unsigned char shift_state; - char *data = NULL; - int i; - - if (attempt > 1) { /* continue interrupted cluster loop */ - if (opt->absolute) { - event->x = nEvent.x; - event->y = nEvent.y; - } - event->dx = nEvent.dx; - event->dy = nEvent.dy; - event->buttons = nEvent.buttons; - } else { - event->dx = event->dy = 0; - event->wdx = event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - do { /* cluster loop */ - if (!timeout && (data = getMouseData(mouse->dev.fd, type, text_mode)) != NULL) { - GET_TIME(mouse->timestamp); - } - - /* in case of timeout data passed to typr->fun() is NULL */ - if ((!timeout && data == NULL) || - type->fun(&mouse->dev, &mouse->options, data, &nEvent) == -1) { - if (!i) return MOUSE_NO_DATA; - else break; - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = multiplex_buttons(mouse, nEvent.buttons); - - if (!i) event->buttons = nEvent.buttons; - - if (oldB != nEvent.buttons) { - rslt = MOUSE_MORE_DATA; - break; - } - - /* propagate movement */ - if (!opt->absolute) { /* mouse */ - if (abs(nEvent.dx) + abs(nEvent.dy) > opt->delta) - nEvent.dx *= opt->accel, nEvent.dy *= opt->accel; - - /* increment the reported dx,dy */ - event->dx += nEvent.dx; - event->dy += nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = nEvent.x - event->x; - event->dy = nEvent.y - event->y; - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - } while (i++ < opt->cluster && more_data_waiting(mouse->dev.fd)); - } /* if(eventFlag) */ - - /*....................................... update the button number */ - - if ((event->buttons & GPM_B_MIDDLE) && opt->three_button) opt->three_button++; - - /*....................................... we're a repeater, aren't we? */ - - if (!text_mode) { - if (repeater.fd != -1 && !repeater.raw) - handle_repeater(opt->absolute, &nEvent, event); - oldB = nEvent.buttons; - return MOUSE_NO_DATA; /* no events nor information for clients */ - } - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!opt->absolute) { - fine_dx += event->dx; - fine_dy += event->dy; - event->dx = fine_dx / opt->scalex; - event->dy = fine_dy / opt->scaley; - fine_dx %= opt->scalex; - fine_dy %= opt->scaley; - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - if (!event->dx && !event->dy && event->buttons == oldB) { - static time_t awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL) <= awaketime) return MOUSE_NO_DATA; - awaketime = time(NULL) + 1; - } - - /*....................................... fill missing fields */ - event->x += event->dx; event->y += event->dy; - - event->vc = get_console_state(&shift_state); - if (event->vc != last_active) { - handle_console_resize(event); - last_active = event->vc; - } - event->modifiers |= shift_state; - - if (oldB == event->buttons) - event->type = (event->buttons ? (GPM_DRAG | GPM_MFLAG) : GPM_MOVE); - else { - if (event->buttons > oldB) - event->type = GPM_DOWN; - else { - event->type &= GPM_MFLAG; - event->type |= GPM_UP; - event->buttons ^= oldB; /* for button-up, tell which one */ - } - } - calculate_clicks(event, opt->time); - snap_to_screen_limits(event); - - gpm_report(GPM_PR_DEBUG,"M: %3i %3i (%3i %3i) - butt=%i vc=%i cl=%i", - event->dx, event->dy, event->x, event->y, - event->buttons, event->vc, event->clicks); - - oldB = nEvent.buttons; - - if (opt_special && (event->type & GPM_DOWN) && !processSpecial(event)) - rslt = MOUSE_NO_DATA; - - return rslt; -} - -static int wait_for_data(fd_set *connSet, int maxfd, fd_set *selSet) -{ - struct micetab *mouse; - struct timeval now, timeout = { 0, 0 }; - int mouse_tmo, tmo = INT_MAX; - - GET_TIME(now); - - *selSet = *connSet; - for (mouse = micelist; mouse; mouse = mouse->next) { - FD_SET(mouse->dev.fd, selSet); - maxfd = max(maxfd, mouse->dev.fd); - if (mouse->dev.timeout >= 0) { - mouse_tmo = mouse->dev.timeout - DIF_TIME(mouse->timestamp, now); - tmo = min(tmo, mouse_tmo); - } - } - - if (tmo == INT_MAX) - timeout.tv_sec = SELECT_TIME; - else if (tmo > 0) { - timeout.tv_sec = tmo / 1000; - timeout.tv_usec = (tmo % 1000) * 1000; - } - - return select(maxfd + 1, selSet, NULL_SET, NULL_SET, &timeout); -} - - - -/*-------------------------------------------------------------------*/ -int old_main() -{ - int ctlfd; - int i, text_mode; - struct timeval now; - int maxfd = -1; - int pending, attempt; - int timed_out; - Gpm_Event event; - struct micetab *mouse; - struct client_info *ci; - fd_set selSet, connSet; - enum mouse_rslt rslt; - - /*....................................... catch interesting signals */ - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - signal(SIGPIPE, SIG_IGN); /* WARN */ - - init_mice(); - handle_console_resize(&event); /* get screen dimensions */ - ctlfd = listen_for_clients(); - - /*....................................... wait for mouse and connections */ - FD_ZERO(&connSet); - FD_SET(ctlfd, &connSet); - maxfd = max(maxfd, ctlfd); - - /*--------------------------------------- main loop begins here */ - - while (1) { - - pending = wait_for_data(&connSet, maxfd, &selSet); - - if (console_resized) { /* did the console resize? */ - handle_console_resize(&event); - console_resized = 0; - signal(SIGWINCH, gpm_killed); /* reinstall handler */ - notify_clients_resize(); - } - - if (pending < 0) { - if (errno == EBADF) gpm_report(GPM_PR_OOPS, GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR, GPM_MESS_SELECT_STRING, strerror(errno)); - continue; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_SELECT_TIMES, pending); - - /*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - text_mode = is_text_console(); - if (!text_mode && !repeater.type && !repeater.raw) { - /* if we don't have repeater then there is only one mouse so - * we can safely use micelist - */ - close(micelist->dev.fd); - wait_text_console(); - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((micelist->dev.fd = open(micelist->device, O_RDWR)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, micelist->device); - if (micelist->type->init) - micelist->type->init(&micelist->dev, &micelist->options, micelist->type); - continue; /* reselect */ - } - - /*....................................... got mouse, process event */ - /* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - GET_TIME(now); - for (mouse = micelist; mouse; mouse = mouse->next) { - timed_out = mouse->dev.timeout >= 0 && - DIF_TIME(mouse->timestamp, now) >= mouse->dev.timeout; - if (timed_out || FD_ISSET(mouse->dev.fd, &selSet)) { - if (FD_ISSET(mouse->dev.fd, &selSet)) { - FD_CLR(mouse->dev.fd, &selSet); - pending--; - } - attempt = 0; - do { - rslt = processMouse(mouse, timed_out, ++attempt, &event, text_mode); - if (rslt != MOUSE_NO_DATA) { - /* pass it to the client or to the default handler, - * or to the selection handler - */ - if (event.vc > MAX_VC) event.vc = 0; - if (event.vc == 0 || !cinfo[event.vc] || !do_client(cinfo[event.vc], &event)) - if (!cinfo[0] || !do_client(cinfo[0], &event)) - do_selection(&event, mouse->options.three_button); - } - } while (rslt == MOUSE_MORE_DATA); - } - } - - /*..................... got connection, process it */ - if (pending && FD_ISSET(ctlfd, &selSet)) { - FD_CLR(ctlfd, &selSet); - pending--; - if ((ci = accept_client_connection(ctlfd))) { - if (ci->data.eventMask & GPM_MOVE) { - Gpm_Event e = { 0, 0, ci->data.vc, 0, 0, - event.x, event.y, GPM_MOVE, 0, 0 }; - do_client(ci, &e); - } - FD_SET(ci->fd, &connSet); - maxfd = max(maxfd, ci->fd); - } - } - - /*........................ got request */ - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i = 0; pending && i <= MAX_VC; i++) { - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd, &selSet)) { - FD_CLR(ci->fd, &selSet); - pending--; - if (!process_client_request(ci, i, event.x, event.y, event.clicks, - event.buttons, micelist->options.three_button)) { - FD_CLR(ci->fd, &connSet); - remove_client(ci, i); - } - } - } - } - - /*.................. look for a spare fd */ - /* itz 10-22-96 this shouldn't happen now! */ - for (i = 0; pending && i <= maxfd; i++) { - if (FD_ISSET(i, &selSet)) { - FD_CLR(i, &selSet); - pending--; - gpm_report(GPM_PR_WARN, GPM_MESS_STRANGE_DATA, i); - } - } - - /*................... all done. */ - if (pending) gpm_report(GPM_PR_OOPS, GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/programs/cc.params deleted file mode 100644 index c2a7d79d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ - - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/core/main.c deleted file mode 100644 index 6913d9cd..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/core/main.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "include/gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config()) return 1; - - if(!mice_handler()) return 1; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/generic/commandline.c deleted file mode 100644 index 03080aa8..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "include/gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - gpm2_usage(); - break; - } - - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 34ac463d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -void set_defaults(); -int commandline(int argc, char **argv); -int read_config(); -int mice_handler(); - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/mice/README deleted file mode 100644 index a655a1d4..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/mice/README +++ /dev/null @@ -1,11 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index fde645f9..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" - -# paths directly in the srcdir -tmp="tmp" - -# -# generate built programs -# - -for tmp in "${confdir}"/*; do - - # ignore *.params, those are parameters, not programs - if [ "$tmp%.params" != "$tmp" ]; then - continue - fi -done diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/tmp/README b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/tmp/README deleted file mode 100644 index 30214bfd..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpm2/tmp/README +++ /dev/null @@ -1 +0,0 @@ -Directory for temporarily created files. diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpn.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/gpn.c deleted file mode 100644 index ae2e81cd..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/gpn.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * gpn.c - support functions for gpm-Linux - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2005 Nico Schottelius - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? memcpy() */ -#include /* isdigit */ -#include /* getopt(),symlink() */ - -#include "headers/message.h" -#include "headers/gpmInt.h" -#include "headers/gpm.h" -#include "headers/console.h" -#include "headers/selection.h" - -/* usage: display for usage informations */ -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR, GPM_MESS_SPEC_ERR, whofailed, option.progname); - return 1; - } - printf(GPM_MESS_USAGE, option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT, DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -static struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type = mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if (!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if (s) break; /* found a synonym */ - } - return type->fun ? type : NULL; -} - -static void init_button_sequence(struct miceopt *opt, char *arg) -{ - int i; - static struct { - char *in; - char *out; - } seq[] = { - {"123", "01234567"}, - {"132", "02134657"}, - {"213", "01452367"}, /* warning: these must be readable as integers... */ - {"231", "02461357"}, - {"312", "04152637"}, - {"321", "04261537"}, - {"111","04444444"}, /* jwz: this allows one to map all three buttons */ - {"222","02222222"}, /* to button1. */ - {"333","01111111"}, - {NULL, NULL} - }; - - if (strlen(arg) != 3 || atoi(arg) < 100) - exit(usage("sequence")); - - for (i = 0; seq[i].in && strcmp(seq[i].in, arg); i++) ; - - if (!seq[i].in) - exit(usage("button sequence")); - - opt->sequence = strdup(seq[i].out); /* I can rewrite on it */ -} - -static void validate_mouse(struct micetab *mouse, int mouse_no) -{ - if (!mouse->device) { - if (!mouse->type && mouse_no > 1) - gpm_report(GPM_PR_OOPS, - "No device/protocol specified for mouse #%d, probably extra -M option?", mouse_no); - else - gpm_report(GPM_PR_OOPS, "No device specified for mouse #%d", mouse_no); - } - - if (!mouse->type) - mouse->type = find_mouse_by_name(DEF_TYPE); - - mouse->options.absolute = mouse->type->absolute; - - if (!mouse->options.sequence) - init_button_sequence(&mouse->options, DEF_SEQUENCE); -} - -static void validate_repeater(char *type) -{ - if (strcmp(type, "raw") == 0) - repeater.raw = 1; - else { - repeater.raw = 0; - - if (!(repeater.type = find_mouse_by_name(type))) - exit(M_listTypes()); /* not found */ - - if (!repeater.type->repeat_fun) /* unsupported translation */ - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_REPEAT, type); - } -} - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - struct micetab *mouse; - struct miceopt *opt; - char options[]="a:A::b:B:d:Dfg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt_char, tmp; - int mouse_no = 1; - - mouse = add_mouse(); - opt = &mouse->options; - - while ((opt_char = getopt(argc, argv, options)) != -1) { - switch (opt_char) { - case 'a': if ((opt->accel = atoi(optarg)) < 1) - exit(usage("acceleration")); - break; - case 'A': sel_opts.aged = 1; - if (optarg) - sel_opts.age_limit = atoi(optarg); - break; - case 'b': opt->baud = atoi(optarg); - break; - case 'B': init_button_sequence(opt, optarg); - break; - case 'd': if ((opt->delta = atoi(optarg)) < 2) - exit(usage("delta")); - break; - case 'D': option.run_status = GPM_RUN_DEBUG; - break; - case 'f': option.run_status = GPM_RUN_FORK; - break; - case 'g': if (atoi(optarg) > 3) - exit(usage("glidepoint tap button")); - opt->glidepoint_tap = GPM_B_LEFT >> (atoi(optarg) - 1); - break; - case 'h': exit(usage(NULL)); - case 'i': opt->time = atoi(optarg); - break; - case 'k': kill_gpm(); - break; - case 'l': console.charset = optarg; - break; - case 'm': mouse->device = optarg; - break; - case 'M': validate_mouse(mouse, mouse_no); - mouse = add_mouse(); - opt = &mouse->options; - mouse_no++; - if (!repeater.type && !repeater.raw) - repeater.type = find_mouse_by_name(DEF_REP_TYPE); - break; - case 'o': gpm_report(GPM_PR_DEBUG,"options: %s", optarg); - opt->text = optarg; - break; - case 'p': sel_opts.ptrdrag = 0; - break; - case 'r': /* being called responsiveness, I must take the inverse */ - tmp = atoi(optarg); - if (!tmp || tmp > 100) tmp = 1; - opt->scalex = 100 / tmp; - break; - case 'R': validate_repeater((optarg) ? optarg : DEF_REP_TYPE); - break; - case 's': opt->sample = atoi(optarg); - break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; - break; - case 't': mouse->type = find_mouse_by_name(optarg); - if (!mouse->type) - exit(M_listTypes()); - break; - case 'u': option.autodetect = 1; - break; - case 'v': printf(GPM_MESS_VERSION "\n"); - exit(0); - case '2': opt->three_button = -1; - break; - case '3': opt->three_button = 1; - break; - default: exit(usage("commandline")); - } - } - - validate_mouse(micelist, mouse_no); -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/client.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/client.h deleted file mode 100644 index 74d09f82..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/client.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * client.h - GPM client handling (server side) - * - * Copyright (C) 2003 Dmitry Torokhov - * - * 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. - ********/ - -#ifndef __GPM_CLIENT_H -#define __GPM_CLIENT_H_ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -#include "headers/gpm.h" - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -struct client_info { - Gpm_Connect data; - int fd; - struct client_info *next; -}; - -struct Gpm_Event; - -extern struct client_info *cinfo[MAX_VC + 1]; - -int listen_for_clients(void); -struct client_info *accept_client_connection(int fd); -void remove_client(struct client_info *ci, int vc); -void notify_clients_resize(void); -int do_client(struct client_info *cinfo, struct Gpm_Event *event); -int process_client_request(struct client_info *ci, int vc, - int x, int y, int buttons, int clicks, - int three_button_mouse); - -#endif /* __GPM_CLIENT_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/console.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/console.h deleted file mode 100644 index 88e2aa03..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/console.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * console.h - GPM console and selection/paste handling - * - * Copyright (C) 2003 Dmitry Torokhov - * - * 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. - ********/ - -#ifndef __GPM_CONSOLE_H_ -#define __GPM_CONSOLE_H_ - -struct gpm_console { - char *device; - char *charset; - int max_x, max_y; -}; - -extern struct gpm_console console; - -int open_console(int mode); -char *get_console_name(); -char *compose_vc_name(int vc); -int is_text_console(void); -void wait_text_console(void); -void refresh_console_size(void); -int is_console_owner(int vc, uid_t uid); -int get_console_state(unsigned char *shift_state); -void console_load_lut(void); - -#endif /* __GPM_CONSOLE_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpm.h deleted file mode 100644 index 263bf3bd..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpm.h +++ /dev/null @@ -1,269 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -/* $Id: gpm.h,v 1.5 2002/11/30 13:20:10 nico Exp $ */ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpmInt.h deleted file mode 100644 index deaba90d..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/gpmInt.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2004 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* timeval */ -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_REP_TYPE "msc" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -/*....................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -struct micedev { - int fd; - int timeout; /* the protocol driver wants to be called - after X msec even if there is no new data - arrived (-1 to disable/default) */ - void *private; /* private data maintained by protocol driver */ -}; - -struct miceopt { - char *sequence; - int baud; - int sample; - int delta; - int accel; - int scalex, scaley; - int time; - int cluster; - int three_button; - int glidepoint_tap; - int absolute; /* device reports absolute coordinates - initially copied - from Gpm_Type; allows same protocol (type) control devices - in absolute and relative mode */ - char *text; /* extra textual options supplied via '-o text' */ -}; - -/* - * and this is the entry in the mouse-type table - */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - int (*fun)(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state); - int (*init)(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type); - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -} Gpm_Type; - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -extern char *opt_special; -extern Gpm_Type mice[]; /* where the hell are the descriptions...*/ - -/* new variables */ - -/* structure prototypes */ -struct repeater { - int fd; - int raw; - Gpm_Type *type; -}; - -/* contains all mice */ -struct micetab { - struct micetab *next; - struct micedev dev; - struct miceopt options; - Gpm_Type *type; - char *device; - int buttons; /* mouse's button state from last read */ - struct timeval timestamp; /* last time mouse data arrived */ -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ -}; - -/* global variables */ -struct options option; /* one should be enough for us */ -extern struct repeater repeater; /* again, only one */ -extern struct micetab *micelist; - -/* new variables */ - -/*....................................... Prototypes */ - /* server_tools.c */ -struct micetab *add_mouse(void); -void init_mice(void); -void cleanup_mice(void); - - /* startup.c */ -void startup(int argc, char **argv); - - /* gpm.c */ -int old_main(); - - /* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int usage(char *whofailed); -void check_uniqueness(void); -void kill_gpm(void); - - /* mice.c */ -extern int M_listTypes(void); - - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/message.h deleted file mode 100644 index e3c6e3a0..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/message.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -enum { GPM_RUN_STARTUP=0, GPM_RUN_DAEMON, GPM_RUN_DEBUG, GPM_RUN_FORK }; - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE " (X-Mas), " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D print debug\n" \ - " -f fork to background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid argument \"%s\" for option \"%s\"" -#define GPM_MESS_MISSING_ARG "%s: Option \"%s\" requires an argument" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %d" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/message.h.orig b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/message.h.orig deleted file mode 100644 index d8e7b0b0..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/message.h.orig +++ /dev/null @@ -1,243 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -enum { GPM_RUN_STARTUP=0, GPM_RUN_DAEMON, GPM_RUN_DEBUG, GPM_RUN_FORK }; - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE " (X-Mas), " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D print debug\n" \ - " -f fork to background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid argument \"%s\" for option \"%s\"" -#define GPM_MESS_MISSING_ARG "%s: Option \"%s\" requires an argument" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" - - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %d" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/optparser.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/optparser.h deleted file mode 100644 index 574b6129..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/optparser.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * optparser.h - GPM mouse options parser - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001,2002 Nico Schottelius - * Copyright (C) 2003 Dmitry Torokhov - * - * 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. - ********/ -#ifndef __GPM_OPTPARSER_H_ -#define __GPM_OPTPARSER_H_ - -enum option_type { - OPT_BOOL = 1, - OPT_INT, /* "%i" */ - OPT_DEC, /* "%d" */ - OPT_STRING, - /* other types must be added */ - OPT_END = 0 -}; - -struct option_helper { - char *name; - enum option_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ - int present; -}; - -int parse_options(const char *who, const char *opt, char sep, struct option_helper *info); -int check_no_options(const char *proto, const char *opts, char sep); -int is_option_present(struct option_helper *info, const char *name); -#endif diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/selection.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/selection.h deleted file mode 100644 index 650b3a45..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/selection.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * selection.h - GPM selection/copy/paste handling - * - * Copyright (C) 2003 Dmitry Torokhov - * - * 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. - ********/ - -#ifndef __GPM_SELECTION_H_ -#define __GPM_SELECTION_H_ - -struct sel_options { - int aged; - int age_limit; - int ptrdrag; -}; - -struct Gpm_Event; - -extern struct sel_options sel_opts; /* only one exists */ - -void do_selection(struct Gpm_Event *event, int three_button_mode); -void selection_disable_paste(void); - -#endif /* __GPM_SELECTION_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/synaptics.h deleted file mode 100644 index 34ebc449..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (int fd, Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (int fd, Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libcurses.c deleted file mode 100644 index f27e5c38..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico-gpm@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/liblow.c deleted file mode 100644 index 76e97cfa..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/liblow.c +++ /dev/null @@ -1,711 +0,0 @@ -/* - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001 Nico Schottelius (nico-gpm@schottelius.org) - * Copyright 2004 Dmitry Torokhov - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag; /* Open connections count */ -int gpm_tried; -int gpm_fd = -1; -int gpm_hflag; -Gpm_Stst *gpm_stack; -struct timeval gpm_timeout = {10, 0}; -Gpm_Handler *gpm_handler; -void *gpm_data; -int gpm_zerobased; -int gpm_visiblepointer; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6 * sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf + 1; - -int gpm_consolefd = -1; /* used to invoke ioctl() */ -int gpm_morekeys; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic = GPM_MAGIC; - - if (write(where, &magic, sizeof(int)) != sizeof(int)) { - gpm_report(GPM_PR_ERR, GPM_MESS_WRITE_ERR, strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) { - gpm_report(GPM_PR_ERR, GPM_MESS_WRITE_ERR, strerror(errno)); - return -1; - } - return 0; -} - -static void get_screen_dimensions(void) -{ - struct winsize win; - - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == 0) { - if (!win.ws_col || !win.ws_row) { - win.ws_col = 80; - win.ws_row = 25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - } -} - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -#if defined(SIGWINCH) - -static struct sigaction gpm_saved_winch_hook; /* Old SIGWINCH handler. */ -static void gpm_winch_hook (int signum) -{ - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } - - get_screen_dimensions(); -} - -static void install_winch_hook(void) -{ - struct sigaction sa; - - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -} - -static void remove_winch_hook(void) -{ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -} - -#else -#define install_winch_hook() /* nothing */ -#define remove_winch_hook() /* nothing */ -#endif /* SIGWINCH */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -#if defined(SIGTSTP) - -static struct sigaction gpm_saved_suspend_hook; - -static void gpm_suspend_hook(int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset(&new_sigset); - sigaddset(&new_sigset, SIGTSTP); - sigprocmask(SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open(&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask(SIG_SETMASK, &old_sigset, 0); - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); - kill(getpid(), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction(SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) - Gpm_Close(); -} - -static void install_suspend_hook(void) -{ - struct sigaction sa; - - sigemptyset(&sa.sa_mask); - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } -} - -static void remove_suspend_hook(void) -{ - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -} - -#else -#define install_suspend_hook() /* nothing */ -#define remove_suspend_hook() /* nothing */ -#endif /* SIGTSTP */ - -static int open_server_socket(void) -{ - struct sockaddr_un addr; - char *sock_name = NULL; - int fd; - - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_SOCKET, strerror(errno)); - return -1; - } - -#ifndef SO_PEERCRED - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_UNIX; - if (!(sock_name = tempnam(0, "gpm"))) { - gpm_report(GPM_PR_ERR, GPM_MESS_TEMPNAM, strerror(errno)); - goto err; - } - strncpy(addr.sun_path, sock_name, sizeof(addr.sun_path)); - if (bind(fd, (struct sockaddr *)&addr, - sizeof(addr.sun_family) + strlen(addr.sun_path)) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - - if (connect(fd, (struct sockaddr *)&addr, - sizeof(addr.sun_family) + strlen(GPM_NODE_CTL)) < 0) { - gpm_report(GPM_PR_INFO, GPM_MESS_DOUBLE_S, GPM_NODE_CTL, strerror(errno)); - goto err; - } - - return fd; - - err: - close(fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - } - - return -1; -} - -static int open_server_device(void) -{ - struct stat stbuf; - int fd; - - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - if ((fd = open(GPM_NODE_DEV, O_RDWR)) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_DOUBLE_S, GPM_NODE_DEV, strerror(errno)); - return -1; - } - - if (fstat(fd, &stbuf) == -1 || (stbuf.st_mode & S_IFMT) != S_IFCHR) { - close(fd); - return -1; - } - - return fd; -} - - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - static char *console_name; - static int console_queried; - - char *tty = NULL, *tty_str = NULL; - char *term; - Gpm_Stst *new; - - /*....................................... First of all, check xterm */ - - if ((term = getenv("TERM")) && !strncmp(term, "xterm", 5)) { - gpm_fd = -2; - GPM_XTERM_ON; - gpm_flag = 1; - return gpm_fd; - } - - /*....................................... Not a xterm, go on */ - - /* check whether console is accesible */ - if (!console_queried) { - console_name = Gpm_get_console(); - console_queried = 1; - } - - /* - * If console is not set just bail out - GPM is not available unless - * client is running on local console - */ - if (!console_name) - return -1; - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) - return -1; - - gpm_tried = 1; /* do or die */ - - if ((new = malloc(sizeof(Gpm_Stst))) == NULL) { - gpm_report(GPM_PR_ERR, "Not enough memory for a new connection"); - return -1; - } - - conn->pid = getpid(); /* fill obvious values */ - - if (gpm_stack) { - conn->vc = new->next->info.vc; /* inherit */ - } else { - conn->vc = 0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc = flag; - tty = tty_str = malloc(strlen(console_name) + Gpm_cnt_digits(flag)); - if (!tty) { - gpm_report(GPM_PR_ERR, "Not enough memory for tty name"); - goto err; - } - memcpy(tty, console_name, strlen(console_name) - 1); - sprintf(&tty[strlen(console_name) - 1], "%i", flag); - } else { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (!tty) { - gpm_report(GPM_PR_ERR, "Checking tty name failed"); - goto err; - } - - /* Make sure that we actually running aon console */ - if (strncmp(tty, console_name, strlen(console_name) - 1) || - !isdigit(tty[strlen(console_name) - 1])) { - gpm_report(GPM_PR_DEBUG, "Not running on local console"); - goto err; - } - - conn->vc = atoi(&tty[strlen(console_name) - 1]); - } - - if (gpm_consolefd == -1) { - if ((gpm_consolefd = open(tty, O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_DOUBLE_S, tty, strerror(errno)); - goto err; - } - } - } - - new->info = *conn; - - get_screen_dimensions(); - - /*....................................... Connect to the control socket */ - - if (!gpm_flag) { - if ((gpm_fd = open_server_socket()) < 0) - if ((gpm_fd = open_server_device()) < 0) - goto err; - } - - new->next = gpm_stack; - gpm_stack = new; - gpm_flag++; - - /*....................................... Put your data */ - if (putdata(gpm_fd, conn) != -1) { - install_winch_hook(); - if (gpm_flag == 1) /* first open only */ - install_suspend_hook(); - } - - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - free(new); - if (tty_str) free(tty_str); - - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried = 0; /* reset the error flag for next time */ - - if (gpm_fd == -2) /* xterm */ - GPM_XTERM_OFF; - else { /* linux */ - if (!gpm_flag) - return 0; - next = gpm_stack->next; - free(gpm_stack); - gpm_stack = next; - if (next) - putdata(gpm_fd, &next->info); - - if (--gpm_flag) - return -1; - } - - if (gpm_fd >= 0) - close(gpm_fd); - gpm_fd = -1; - - remove_suspend_hook(); - remove_winch_hook(); - - if (gpm_consolefd >= 0) - close(gpm_consolefd); - gpm_consolefd = -1; - - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) - return 0; - -#ifdef GPM_USE_MAGIC - if ((count = read(gpm_fd, &magic, sizeof(int))) != sizeof(int)) { - if (count == 0) { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO, "Read too few bytes (%i) at %s:%d", - count, __FILE__, __LINE__); - return -1; - } -#endif - - if ((count = read(gpm_fd, event, sizeof(Gpm_Event))) != sizeof(Gpm_Event)) { -#ifndef GPM_USE_MAGIC - if (count == 0) { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO, "Read too few bytes (%i) at %s:%d", - count, __FILE__, __LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int n_prevchar, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return n_prevchar; -} - -/*-------------------------------------------------------------------*/ -int Gpm_WaitForData(int fd) -{ - struct timeval tmo = { SELECT_TIME, 0 }; - static fd_set selSet; - int max_fd = (gpm_fd > fd) ? gpm_fd : fd; - - do { - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - if (gpm_fd >= 0) - FD_SET(gpm_fd, &selSet); - - } while (select(max_fd + 1, &selSet, NULL, NULL, &tmo) <= 0); - - return FD_ISSET(fd, &selSet) ? fd : gpm_fd; -} - -/*-------------------------------------------------------------------*/ -int Gpm_WaitMoreData(int fd) -{ - struct timeval tmo = { 0, 100 * 1000 }; /* 100 msecs */ - static fd_set selSet; - int rc; - - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - - while ((rc = select(fd + 1, &selSet, NULL, NULL, &tmo)) == EINTR) - /* empty */; - - return rc > 0; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - static Gpm_Event ev; - static int nbuf_set; - - int fd = fileno(f); - char mdata[4]; - int c, result; - - /* Hmm... I must be sure it is unbuffered */ - if (!nbuf_set) { - setvbuf(f, NULL, _IONBF, 0); - nbuf_set = 1; - } - - if (!gpm_flag) - return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) - return (*gpm_handler)(&ev, gpm_data); - - gpm_hflag = 0; - - if (n_prevchar) /* if there are some consumed char ... */ - return prevchar[--n_prevchar]; - - while (1) { - if (gpm_fd >= 0 && gpm_visiblepointer) - GPM_DRAWPOINTER(&ev); - - if (Gpm_WaitForData(fd) != fd) { - /* GPM is available (running on console), iget event from it */ - - if (!Gpm_GetEvent(&ev)) - continue; - - } else if (gpm_fd == -2) { - /* Running in Xterm, is it a mouse event or regular data? */ - - if ((c = fgetc(f)) != 0x1b) - return c; - - /* escape: go on */ - if (!Gpm_WaitMoreData(fd)) - return c; - - if ((c = fgetc(f)) != '[') { - prevchar[n_prevchar++] = c; - return 0x1B; - } - - /* '[': go on */ - if (!Gpm_WaitMoreData(fd)) { - prevchar[n_prevchar++] = c; - return 0x1B; - } - - if ((c = fgetc(f)) != 'M') { /* NOTICE: prevchar is a lifo !*/ - prevchar[n_prevchar++] = c; - prevchar[n_prevchar++] = '['; - return 0x1B; - } - - /* now, it surely is a mouse event */ - for (c = 0; c < 3; c++) - mdata[c] = fgetc(f); - gpm_convert_event(mdata, &ev); - - } else { - /* Not running in Xterm and not GPM event, just read the data */ - return fgetc(f); - } - - /* Ok, we have a new event, handle it */ - if (gpm_handler && (result = gpm_handler(&ev, gpm_data))) { - gpm_hflag = 1; - return result; - } - } -} - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to = {0, 1000 * msec}; - fd_set selSet; - int fd = gpm_fd >= 0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - return select(fd + 1, &selSet, NULL, NULL, &to) == 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - switch (margin) { - case -1: - *x = min(max(*x, !gpm_zerobased), gpm_mx); - *y = min(max(*y, !gpm_zerobased), gpm_my); - break; - - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1, tv2; - static int clicks; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0] - 32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c == 3) { - ePtr->type = GPM_UP | (GPM_SINGLE << clicks); - /* ePtr->buttons = 0; */ /* no, keep info from press event */ - GET_TIME(tv1); - clicks = 0; - } else { - ePtr->type = GPM_DOWN; - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1, tv2) < 250)) { - /* 250ms for double click */ - clicks++; clicks %= 3; - } else - clicks = 0; - - switch (c) { - case 0: ePtr->buttons = GPM_B_LEFT; break; - case 1: ePtr->buttons = GPM_B_MIDDLE; break; - case 2: ePtr->buttons = GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1] - 32 - gpm_zerobased; - ePtr->y = mdata[2] - 32 - gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/report-lib.c deleted file mode 100644 index 30e54568..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/report-lib.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; - } - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/tools.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/tools.c deleted file mode 100644 index 6f3cf155..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/lib/tools.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console(void) -{ - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE, &buf) == 0) - return strdup(GPM_DEVFS_CONSOLE); - - /* Failed, try OLD console */ - else if (stat(GPM_OLD_CONSOLE, &buf) == 0) - return strdup(GPM_OLD_CONSOLE); - - return NULL; -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if (pot_y == 0) val = 1; - else if (pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int digits = 1; - - while ((number /= 10)) - digits++; - - return digits; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/main.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/main.c deleted file mode 100644 index 0096cccc..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/mice.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/mice.c deleted file mode 100644 index 44598441..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/mice.c +++ /dev/null @@ -1,2363 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2004 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include /* stat() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/console.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" -#include "headers/optparser.h" - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, char *proto, char *opts) -{ - static unsigned int lines, reallines; - static struct option_helper optioninfo[] = { - {"dtr", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", OPT_END} - }; - - int rslt = parse_options(proto, opts, ',', optioninfo); - - if (rslt < 0) { - errno = EINVAL; - return -1; - } else if (rslt > 1) { - gpm_report(GPM_PR_ERR, GPM_MESS_TOO_MANY_OPTS, option.progname, proto); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } else if (rslt == 1) { - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - } - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -/* defined in evdev.c */ -extern int M_evdev(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state); -extern int I_evdev(struct micedev *dev, struct miceopt *opt, Gpm_Type *type); -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * console.max_x / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (console.max_y-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int M_msc(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - - /* the damn wheels */ - if(state->wdx > 0) buffer[3] = 0xfe; - else if(state->wdx < 0) buffer[3] = 0x02; - else if(state->wdy > 0) buffer[3] = 0xff; - else if(state->wdy < 0) buffer[3] = 0x01; - - return write(fd,buffer,4); -} - -static int M_logimsc(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && opt->glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt->glidepoint_tap; - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - - return 0; -} - -static int M_imps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && opt->glidepoint_tap) // by default this is false - state->buttons = tap_active = opt->glidepoint_tap; - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - /* old code: - - did it signed: - state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; - - and unsigned: - state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; - */ - - return 0; - -} - -static int M_netmouse(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -int I_ps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write(dev->fd, s, sizeof (s)); - usleep (30000); - tcflush (dev->fd, TCIFLUSH); - return 0; -} - -static int I_netmouse(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (!check_no_options(type->name, opt->text, ',')) return -1; - for (i=0; i<6; i++) { - unsigned char c = 0; - write(dev->fd, magic+i, 1 ); - read(dev->fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return -1; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( dev->fd, rep, 1 ); - read( dev->fd, rep+1, 1 ); - read( dev->fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return -1; - } - } - return 0; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= opt->glidepoint_tap; - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * console.max_x / wmaxx); - state->y = (y * console.max_y / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / console.max_x / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / console.max_y / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? console.max_x+1 - : (long)(x-CAL_X_MIN) * (long)(console.max_x-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? console.max_y + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)console.max_y / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? console.max_x+1 - : (long)(x-NCR_LEFT_X) * (long)(console.max_x-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? console.max_y + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)console.max_y / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - syn_process_serial_data(dev->fd, state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - syn_process_ps2_data(dev->fd, state, data); - return 0; -} - -static int M_mtouch(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * console.max_x / 0x3FFF) - #define REAL_TO_YCELL(y) (y * console.max_y / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < opt->time) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * console.max_x / 0x3FFF) - #define REAL_TO_YCELL(y) (y * console.max_y / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < opt->time) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < opt_time) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * console.max_x / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = console.max_y - y * console.max_y / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static int I_empty(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - return check_no_options(type->name, opt->text, ',') ? 0 : -1; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static int I_serial(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(dev->fd, type->name, opt->text)) return -1; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(dev->fd,&set); - switch(select(dev->fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(dev->fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(dev->fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(dev->fd, i, opt->baud, (type->fun != M_mman) /* write */, type->flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(dev->fd, 1200, 1200, 0, type->flags); /* no write */ - write(dev->fd, "*X", 2); - setspeed(dev->fd, 1200, opt->baud, 0, type->flags); /* no write */ - return 0; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(dev->fd, 1200, 9600, 1, type->flags); /* write */ - write(dev->fd, ":" ,1); - write(dev->fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(dev->fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (dev->fd, 1200, 1200, 1, type->flags); - packet_length = syn_serial_init (dev->fd); - setspeed (dev->fd, 1200, 9600, 1, type->flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (dev->fd, 4800, 4800, 0, type->flags); /* no write */ - write(dev->fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return 0; -} - -static int I_logi(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - int i; - struct stat buf; - int busmouse; - - if (!check_no_options(type->name, opt->text, ',')) return -1; - - /* is this a serial- or a bus- mouse? */ - if(fstat(dev->fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(dev->fd, i, opt->baud, 1 /* write */, type->flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(dev->fd, "S", 1); - setspeed(dev->fd, opt->baud, opt->baud, 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;opt->sample<=sampletab[i].sample;i++) ; - write(dev->fd,sampletab[i].code,1); - return 0; -} - -static int I_wacom(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (dev->fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(dev->fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(dev->fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (dev->fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(dev->fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(dev->fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(dev->fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(dev->fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(dev->fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static struct option_helper optioninfo[] = { - {"absolute", OPT_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", OPT_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", OPT_END} - }; - - parse_options(type->name, opt->text, ',', optioninfo); - opt->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, opt->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(dev->fd,UD_SENDCOORDS,4); - - return 0; -} - -static int I_pnp(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(dev->fd, type->name, opt->text)) return -1; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(dev->fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = type->flags | B1200; - tcsetattr(dev->fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return 0; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static int I_imps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(dev->fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(dev->fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return -1; - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(dev->fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return -1; - } - - /* Read the mouse id */ - id = read_mouse_id(dev->fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(dev->fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return 0; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return 0; - - /* ps2 was not found!!! */ - return -1; -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static int I_exps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (!check_no_options(type->name, opt->text, ',')) return -1; - - write (dev->fd, s1, sizeof (s1)); - usleep (30000); - tcflush (dev->fd, TCIFLUSH); - return 0; -} - -static int I_twid(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - - if (!check_no_options(type->name, opt->text, ',')) return -1; - - if (twiddler_key_init() != 0) return -1; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if (opt->baud == DEF_BAUD) opt->baud = 2400; - opt->text = "dtr"; - return I_serial(dev, opt, type); -} - -static int I_calus(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - if (!check_no_options(type->name, opt->text, ',')) return -1; - - if (opt->baud == 1200) opt->baud = 9600; /* default to 9600 */ - return I_serial(dev, opt, type); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static int I_synps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - syn_ps2_init (dev->fd); - return 0; -} - - -static int I_summa(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - void resetsumma() - { - write(dev->fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(dev->fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (dev->fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(dev->fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(dev->fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(dev->fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(dev->fd,GEN_MMSERIES,1); - write(dev->fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(dev->fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(dev->fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(dev->fd,buffer,sizeof(buffer)); - write(dev->fd,SS_READCONFIG,1); - read(dev->fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(dev->fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(dev->fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return 0; -} - -static int I_mtouch(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(dev->fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(dev->fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(dev->fd,"\001MS\r\n\001FT\r\n",10); - - return 0; -} - -/* simple initialization for the gunze touchscreen */ -static int I_gunze(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static struct option_helper optioninfo[] = { - {"smooth", OPT_INT, u: {iptr: &gunze_avg}}, - {"debounce", OPT_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", OPT_END} - }; - parse_options(type->name, opt->text, ',', optioninfo); - - /* check that the baud rate is valid */ - if (opt->baud == DEF_BAUD) opt->baud = 19200; /* force 19200 as default */ - if (opt->baud != 9600 && opt->baud != 19200) { - gpm_report(GPM_PR_ERR, GPM_MESS_GUNZE_WRONG_BAUD, option.progname, type->name); - opt->baud = 19200; - } - tcgetattr(dev->fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = (opt->baud == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(dev->fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return 0; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int I_wp(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(dev->fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(dev->fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(dev->fd, ":S", 2); - tcsetattr(dev->fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(dev->fd, "T", 1); - sleep(1); - count = read(dev->fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return -1; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return -1; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(dev->fd, "O", 1); - - return 0; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_evdev, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/mice.c.orig b/software/gpm/browse_source/gpm-1.20.2-broken/src/mice.c.orig deleted file mode 100644 index b29dfabf..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/mice.c.orig +++ /dev/null @@ -1,2223 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2004 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include /* stat() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/console.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" -#include "headers/optparser.h" - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, char *proto, char *opts) -{ - static unsigned int lines, reallines; - static struct option_helper optioninfo[] = { - {"dtr", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", OPT_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", OPT_END} - }; - - int rslt = parse_options(proto, opts, ',', optioninfo); - - if (rslt < 0) { - errno = EINVAL; - return -1; - } else if (rslt > 1) { - gpm_report(GPM_PR_ERR, GPM_MESS_TOO_MANY_OPTS, option.progname, proto); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } else if (rslt == 1) { - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - } - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -/* defined in evdev.c */ -extern int M_evdev(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state); -extern int I_evdev(struct micedev *dev, struct miceopt *opt, Gpm_Type *type); -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * console.max_x / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (console.max_y-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int M_msc(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - - /* the damn wheels */ - if(state->wdx > 0) buffer[3] = 0xfe; - else if(state->wdx < 0) buffer[3] = 0x02; - else if(state->wdy > 0) buffer[3] = 0xff; - else if(state->wdy < 0) buffer[3] = 0x01; - - return write(fd,buffer,4); -} - -static int M_logimsc(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && opt->glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt->glidepoint_tap; - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - - return 0; -} - -static int M_imps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && opt->glidepoint_tap) // by default this is false - state->buttons = tap_active = opt->glidepoint_tap; - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - /* old code: - - did it signed: - state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; - - and unsigned: - state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; - */ - - return 0; - -} - -static int M_netmouse(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -int I_ps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write(dev->fd, s, sizeof (s)); - usleep (30000); - tcflush (dev->fd, TCIFLUSH); - return 0; -} - -static int I_netmouse(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (!check_no_options(type->name, opt->text, ',')) return -1; - for (i=0; i<6; i++) { - unsigned char c = 0; - write(dev->fd, magic+i, 1 ); - read(dev->fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return -1; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( dev->fd, rep, 1 ); - read( dev->fd, rep+1, 1 ); - read( dev->fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return -1; - } - } - return 0; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= opt->glidepoint_tap; - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * console.max_x / wmaxx); - state->y = (y * console.max_y / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / console.max_x / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / console.max_y / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? console.max_x+1 - : (long)(x-CAL_X_MIN) * (long)(console.max_x-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? console.max_y + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)console.max_y / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? console.max_x+1 - : (long)(x-NCR_LEFT_X) * (long)(console.max_x-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? console.max_y + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)console.max_y / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - syn_process_serial_data(dev->fd, state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - syn_process_ps2_data(dev->fd, state, data); - return 0; -} - -static int M_mtouch(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * console.max_x / 0x3FFF) - #define REAL_TO_YCELL(y) (y * console.max_y / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < opt->time) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * console.max_x / 0x3FFF) - #define REAL_TO_YCELL(y) (y * console.max_y / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < opt->time) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(struct micedev *dev, struct miceopt *opt, unsigned char *data, Gpm_Event *state) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * console.max_x / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = console.max_y - y * console.max_y / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static int I_empty(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - return check_no_options(type->name, opt->text, ',') ? 0 : -1; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static int I_serial(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(dev->fd, type->name, opt->text)) return -1; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(dev->fd,&set); - switch(select(dev->fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(dev->fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(dev->fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(dev->fd, i, opt->baud, (type->fun != M_mman) /* write */, type->flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(dev->fd, 1200, 1200, 0, type->flags); /* no write */ - write(dev->fd, "*X", 2); - setspeed(dev->fd, 1200, opt->baud, 0, type->flags); /* no write */ - return 0; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(dev->fd, 1200, 9600, 1, type->flags); /* write */ - write(dev->fd, ":" ,1); - write(dev->fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(dev->fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (dev->fd, 1200, 1200, 1, type->flags); - packet_length = syn_serial_init (dev->fd); - setspeed (dev->fd, 1200, 9600, 1, type->flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (dev->fd, 4800, 4800, 0, type->flags); /* no write */ - write(dev->fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return 0; -} - -static int I_logi(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - int i; - struct stat buf; - int busmouse; - - if (!check_no_options(type->name, opt->text, ',')) return -1; - - /* is this a serial- or a bus- mouse? */ - if(fstat(dev->fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(dev->fd, i, opt->baud, 1 /* write */, type->flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(dev->fd, "S", 1); - setspeed(dev->fd, opt->baud, opt->baud, 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;opt->sample<=sampletab[i].sample;i++) ; - write(dev->fd,sampletab[i].code,1); - return 0; -} - -static int I_wacom(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (dev->fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(dev->fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(dev->fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (dev->fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(dev->fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(dev->fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(dev->fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(dev->fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(dev->fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static struct option_helper optioninfo[] = { - {"absolute", OPT_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", OPT_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", OPT_END} - }; - - parse_options(type->name, opt->text, ',', optioninfo); - opt->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, opt->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(dev->fd,UD_SENDCOORDS,4); - - return 0; -} - -static int I_pnp(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(dev->fd, type->name, opt->text)) return -1; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(dev->fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = type->flags | B1200; - tcsetattr(dev->fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return 0; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static int I_imps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(dev->fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(dev->fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return -1; - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(dev->fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return -1; - } - - /* Read the mouse id */ - id = read_mouse_id(dev->fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(dev->fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return 0; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return 0; - - /* ps2 was not found!!! */ - return -1; -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static int I_exps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (!check_no_options(type->name, opt->text, ',')) return -1; - - write (dev->fd, s1, sizeof (s1)); - usleep (30000); - tcflush (dev->fd, TCIFLUSH); - return 0; -} - -static int I_twid(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - - if (!check_no_options(type->name, opt->text, ',')) return -1; - - if (twiddler_key_init() != 0) return -1; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if (opt->baud == DEF_BAUD) opt->baud = 2400; - opt->text = "dtr"; - return I_serial(dev, opt, type); -} - -static int I_calus(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - if (!check_no_options(type->name, opt->text, ',')) return -1; - - if (opt->baud == 1200) opt->baud = 9600; /* default to 9600 */ - return I_serial(dev, opt, type); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static int I_synps2(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - syn_ps2_init (dev->fd); - return 0; -} - - -static int I_summa(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - void resetsumma() - { - write(dev->fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(dev->fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (dev->fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(dev->fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(dev->fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(dev->fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(dev->fd,GEN_MMSERIES,1); - write(dev->fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(dev->fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(dev->fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(dev->fd,buffer,sizeof(buffer)); - write(dev->fd,SS_READCONFIG,1); - read(dev->fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(dev->fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(dev->fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return 0; -} - -static int I_mtouch(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(dev->fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(dev->fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(dev->fd,"\001MS\r\n\001FT\r\n",10); - - return 0; -} - -/* simple initialization for the gunze touchscreen */ -static int I_gunze(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static struct option_helper optioninfo[] = { - {"smooth", OPT_INT, u: {iptr: &gunze_avg}}, - {"debounce", OPT_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", OPT_END} - }; - parse_options(type->name, opt->text, ',', optioninfo); - - /* check that the baud rate is valid */ - if (opt->baud == DEF_BAUD) opt->baud = 19200; /* force 19200 as default */ - if (opt->baud != 9600 && opt->baud != 19200) { - gpm_report(GPM_PR_ERR, GPM_MESS_GUNZE_WRONG_BAUD, option.progname, type->name); - opt->baud = 19200; - } - tcgetattr(dev->fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = (opt->baud == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(dev->fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int I_wp(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(dev->fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(dev->fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(dev->fd, ":S", 2); - tcsetattr(dev->fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(dev->fd, "T", 1); - sleep(1); - count = read(dev->fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return -1; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return -1; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(dev->fd, "O", 1); - - return 0; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_evdev, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/optparser.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/optparser.c deleted file mode 100644 index 84b5e38a..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/optparser.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * optparser.c - GPM mouse options parser - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001,2002 Nico Schottelius - * Copyright (C) 2003 Dmitry Torokhov - * - * 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. - ********/ - -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/optparser.h" - -int parse_options(const char *proto, const char *opts, char sep, struct option_helper *info) -{ - int len, n, n_opts = 0, errors = 0; - long l; - struct option_helper *p; - char *s, *t, *str; - int base; /* for strtol */ - - for (p = info; p->type != OPT_END; p++) - p->present = 0; - - if (!opts) - return 0; - - if (!(str = strdup(opts))) - gpm_report(GPM_PR_OOPS, GPM_MESS_ALLOC_FAILED); - - /* split input string */ - for (s = str, n = 1; sep && (s = strchr(s, sep)); s++, n++) - *s = '\0'; - - for (s = str; n; s += strlen(s) + 1, n--) { - if (strlen(s) == 0) - continue; - - for (p = info; p->type != OPT_END; p++) { - len = strlen(p->name); - if (!strncmp(p->name, s, len) && !isalnum(s[len])) - break; - } - if (p->type == OPT_END) { /* not found */ - gpm_report(GPM_PR_ERR, "%s: Uknown option \"%s\" for protocol \"%s\"\n", - option.progname, s, proto); - errors++; - continue; - } - if (p->present) { - gpm_report(GPM_PR_ERR, "%s: option \"%s\" has already been seen, ignored (\"%s\")\n", - option.progname, s, proto); - continue; - } - p->present = 1; - n_opts++; - /* Found. Look for trailing stuff, if any */ - s += strlen(p->name); - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - base = 0; - switch(p->type) { - case OPT_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR, GPM_MESS_OPTION_NO_ARG, option.progname, p->name, s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case OPT_DEC: - base = 10; /* and fall through */ - - case OPT_INT: - if (*s == '\0') { - gpm_report(GPM_PR_ERR, GPM_MESS_MISSING_ARG, option.progname, p->name); - } else { - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR, GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - } - break; - - case OPT_STRING: - if (*s == '\0') - gpm_report(GPM_PR_ERR, GPM_MESS_MISSING_ARG, option.progname, p->name); - else - *(p->u.sptr) = strdup(s); - break; - - case OPT_END: /* let's please "-Wall" */ - break; - } - } - - free(str); - - if (errors) { - gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return -errors; - } - return n_opts; -} - -int check_no_options(const char *proto, const char *opts, char sep) -{ - static struct option_helper info[] = { - { "", OPT_END } - }; - - return parse_options(proto, opts, sep, info) == 0; -} - -int is_option_present(struct option_helper *info, const char *name) -{ - struct option_helper *p; - int len; - - for (p = info; p->type != OPT_END; p++) { - len = strlen(p->name); - if (!strncmp(p->name, name, len) && !isalnum(name[len])) - return p->present; - } - - gpm_report(GPM_PR_ERR, "%s: Uknown option \"%s\"\n", option.progname, name); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/a.out b/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/a.out deleted file mode 100644 index 86fba6fc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/a.out and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/display-coords.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/display-coords.c deleted file mode 100644 index 4c649d8f..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/display-coords.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-coords -lgpm display-coords.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * x/y coords on the screen - * dx, dy: deltas - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -/* #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -*/ - - - - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_MOVE; /* read only moves */ - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/gpm-root.y deleted file mode 100644 index 3a97602e..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/gpm-root.y +++ /dev/null @@ -1,1395 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/mouse-test.c deleted file mode 100644 index b7ef50ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/prog/mouse-test.c +++ /dev/null @@ -1,725 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* and this is a workaroud */ -struct winsize win; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - struct micedev mdev; - struct device *next; -} *devlist; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void gpm_makedev(char *name) -{ - struct device *dev; - int fd; - int modes; - - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - } else { - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - } else { - dev = malloc(sizeof(struct device)); - if (!dev) gpm_report(GPM_PR_OOPS,"malloc()"); - dev->name=strdup(name); - if (!dev->name) gpm_report(GPM_PR_OOPS,"malloc()"); - dev->mdev.fd=fd; - dev->mdev.private = NULL; - dev->next=devlist; - devlist = dev; - devcount++; - } - } -} - -int (*I_serial)(struct micedev *dev, struct miceopt *opt, struct Gpm_Type *type); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(struct micedev *dev, char *name, Gpm_Type *type, struct miceopt *opts) -{ - if (!type) type=mice+1; /* ms */ - close(dev->fd); - usleep(100000); - dev->fd=open(name,O_RDWR); - if (dev->fd < 0) gpm_report(GPM_PR_OOPS,name); - I_serial(dev, opts, type); /* ms initialization */ - return dev->fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *nextdev; - Gpm_Type *cursor; - int i; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - struct miceopt opt = {0}; - struct micedev mdev = {0}; - - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - opt.baud=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",opt.baud); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=devlist; nextdev; nextdev=nextdev->next) { - printf("\t%s\r\n", nextdev->name); - FD_SET(nextdev->mdev.fd, &devSet); - maxfd=max(nextdev->mdev.fd,maxfd); - I_serial(&nextdev->mdev, &opt, mice+1); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=devlist; nextdev; nextdev=nextdev->next) - if (FD_ISSET(nextdev->mdev.fd,&devSet)) { - gotthem++; - FD_CLR(nextdev->mdev.fd,&savSet); - FD_SET(nextdev->mdev.fd,&gotSet); - } - } - if (gotthem) for (nextdev=devlist; nextdev; /* nothing */ ) { - cur=nextdev; - if (!FD_ISSET(cur->mdev.fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - nextdev=cur->next; - close(cur->mdev.fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->mdev.fd,buf,80); /* flush */ - nextdev=cur->next; /* follow list */ - } - } - - } /* devcount>1 */ - - mdev=devlist->mdev; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - opt.baud=BAUD(0); - mousereopen(&mdev, mousename, NULL,&opt); - - FD_ZERO(&checkSet); - FD_SET(mdev.fd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mdev.fd, fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mdev.fd, buf, 1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mdev.fd, buf, BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - opt.baud=BAUD(trial); - printf("\tBaud rate is %i\r\n",opt.baud); - mousereopen(&mdev, mousename,NULL, &opt); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mdev.fd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&mdev, &opt, buf+i, &event)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mdev.fd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&mdev, &opt, buf+i, &event)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousereopen(&mdev, mousename, mice /* mman */, &opt); - got=eventlist(mdev.fd, buf, BUFLEN, GPM_B_MIDDLE, readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&mdev,&opt,buf+i,&event)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mdev.fd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(&mdev, mousename, NULL, &opt); - lines = alllines & ~toggle[index]; - ioctl(mdev.fd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mdev.fd, buf, BUFLEN, GPM_B_MIDDLE, readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mdev.fd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/report.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/report.c deleted file mode 100644 index 975c9a31..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/report.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2005 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/console.h" - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *f = NULL; - va_list ap; - - va_start(ap,text); - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - case GPM_RUN_FORK: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap); -#endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -#endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -#endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -#endif - if ((f = fopen(GPM_SYS_CONSOLE, "a")) != NULL) { - fprintf(f, GPM_STRING_WARN); - vfprintf(f, text, ap); - fprintf(f, "\n"); - fclose(f); - } - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -#endif - if ((f = fopen(GPM_SYS_CONSOLE, "a")) != NULL) { - fprintf(f, GPM_STRING_ERR); - vfprintf(f, text, ap); - fprintf(f, "\n"); - fclose(f); - } - - if ((f = fopen(console.device, "a")) != NULL) { - fprintf(f, GPM_STRING_ERR); - vfprintf(f, text, ap); - fprintf(f, "\n"); - fclose(f); - } - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - f = stdout; - fprintf(f, GPM_STRING_INFO); break; - case GPM_STAT_WARN: - f = stderr; - fprintf(f, GPM_STRING_WARN); break; - case GPM_STAT_ERR: - f = stderr; - fprintf(f, GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - f = stderr; - fprintf(f, GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - f = stderr; - fprintf(f, GPM_STRING_OOPS); break; - } - - vfprintf(f, text, ap); - fprintf(f, "\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/selection.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/selection.c deleted file mode 100644 index 8c220eda..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/selection.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * selection.c - GPM selection/copy/paste handling - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001,2002 Nico Schottelius - * Copyright (c) 2003 Dmitry Torokhov - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* time() */ -#include /* O_RDONLY */ -#include /* mkdir() */ -#include /* __u32 */ - -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/console.h" -#include "headers/selection.h" - -struct sel_options sel_opts = { 0, 0, DEF_PTRDRAG }; -static time_t last_selection_time; - -/*-------------------------------------------------------------------*/ -static void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ - /* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6 * sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short) - 1] = 2; /* set selection */ - - arg[0] = (unsigned short)x1; - arg[1] = (unsigned short)y1; - arg[2] = (unsigned short)x2; - arg[3] = (unsigned short)y2; - arg[4] = (unsigned short)mode; - - if ((fd = open_console(O_WRONLY)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN_CON); - - gpm_report(GPM_PR_DEBUG, "ctl %i, mode %i", (int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf + sizeof(short) - 1) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - sel_opts.aged = 0; - last_selection_time = time(0); - } -} - -/*-------------------------------------------------------------------*/ -static void selection_paste(void) -{ - char c = 3; - int fd; - - if (!sel_opts.aged && - sel_opts.age_limit != 0 && - last_selection_time + sel_opts.age_limit < time(0)) { - sel_opts.aged = 1; - } - - if (sel_opts.aged) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_SKIP_PASTE); - } else { - fd = open_console(O_WRONLY); - if (ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - } -} - -/*-------------------------------------------------------------------*/ -void do_selection(Gpm_Event *event, int three_button_mode) -{ - static int x1 = 1, y1 = 1; - int x2, y2; - - x2 = event->x; y2 = event->y; - switch (GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2 < 1) x2++; else if (x2 > console.max_x) x2--; - if (y2 < 1) y2++; else if (y2 > console.max_y) y2--; - selection_copy(x2, y2, x2, y2, 3); /* just highlight the pointer */ - break; - - case GPM_DRAG: - if (event->buttons == GPM_B_LEFT) { - switch (event->margin) { /* fix margins */ - case GPM_TOP: x2 = 1; y2++; break; - case GPM_BOT: x2 = console.max_x; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2 <= y1 ? x2++ : (x2 = console.max_x, y2--); break; - default: break; - } - selection_copy(x1, y1, x2, y2, event->clicks); - if (event->clicks >= sel_opts.ptrdrag && !event->margin) /* pointer */ - selection_copy(x2, y2, x2, y2, 3); - } - break; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1 = x2; y1 = y2; - selection_copy(x1, y1, x2, y2, event->clicks); /* start selection */ - break; - - case GPM_B_MIDDLE: - selection_paste(); - break; - - case GPM_B_RIGHT: - if (three_button_mode == 1) - selection_copy(x1, y1, x2, y2, event->clicks); - else - selection_paste(); - break; - } - } -} - -/*-------------------------------------------------------------------*/ -void selection_disable_paste(void) -{ - sel_opts.aged = 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/server_tools.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/server_tools.c deleted file mode 100644 index 36f97cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/server_tools.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002 Nico Schottelius - * - * - * 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. - ********/ - -#include -#include /* malloc() */ -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - -struct micetab *micelist; - -/* DESCR: allocate a new mouse and to the list of mice. initialization follows later */ -/* RETURN: new mouse structure */ -/* COMMENT: does error handling and exiting itself */ -struct micetab *add_mouse(void) -{ - struct micetab *mouse; - - gpm_report(GPM_PR_DEBUG, "adding mouse device"); - if (!(mouse = malloc(sizeof(struct micetab)))) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - - memset(mouse, 0, sizeof(struct micetab)); - - mouse->dev.timeout = -1; - - mouse->options.sequence = NULL; - mouse->options.sample = DEF_SAMPLE; - mouse->options.delta = DEF_DELTA; - mouse->options.accel = DEF_ACCEL; - mouse->options.scalex = DEF_SCALE; - mouse->options.scaley = DEF_SCALE; - mouse->options.time = DEF_TIME; - mouse->options.cluster = DEF_CLUSTER; - mouse->options.three_button = DEF_THREE; - mouse->options.glidepoint_tap = DEF_GLIDEPOINT_TAP; - mouse->options.text = NULL; - - mouse->next = micelist; - micelist = mouse; - - return mouse; -} - -/* DESCR: mice initialization. calls appropriate init functions. */ -/* COMMENT: does error handling and exiting itself */ -void init_mice(void) -{ - struct micetab *mouse; - - for (mouse = micelist; mouse; mouse = mouse->next) { - if (!strcmp(mouse->device, "-")) - mouse->dev.fd = 0; /* use stdin */ - else if ((mouse->dev.fd = open(mouse->device, O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, mouse->device); - - /* and then reset the flag */ - fcntl(mouse->dev.fd, F_SETFL, fcntl(mouse->dev.fd, F_GETFL) & ~O_NDELAY); - - /* init the device, and use the return value as new mouse type */ - if (mouse->type->init) - if (mouse->type->init(&mouse->dev, &mouse->options, mouse->type)) - gpm_report(GPM_PR_OOPS, GPM_MESS_MOUSE_INIT); - } -} - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* COMMENT: does error handling and exiting itself */ -void cleanup_mice(void) -{ - struct micetab *tmp; - - while ((tmp = micelist)) { - if (micelist->dev.private) - free(micelist->dev.private); - micelist = micelist->next; - free(tmp); - } -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/special.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/special.c deleted file mode 100644 index 5bed91aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/special.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001 Nico@Schottelius.org (Nico Schottelius) - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/console.h" - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef = fopen(console.device, "w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(console.device, O_WRONLY); /* stdout */ - dup(1); /* stderr */ - for (i=3;i - * - * - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/console.h" -#include "headers/selection.h" - -/* what todo atexit */ -static void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG, GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - -void startup(int argc, char **argv) -{ - extern struct options option; - extern int errno; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - - get_console_name(); - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - - console_load_lut(); - - if (repeater.raw || repeater.type) { - if (mkfifo(GPM_NODE_FIFO, 0666) && errno != EEXIST) - gpm_report(GPM_PR_OOPS, GPM_MESS_CREATE_FIFO, GPM_NODE_FIFO); - if ((repeater.fd = open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - if(option.run_status == GPM_RUN_FORK) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ -// case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* now we are a daemon */ - option.run_status = GPM_RUN_DAEMON; - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - atexit(gpm_exited); /* call gpm_exited at the end */ -} - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if ((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid, 0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS, GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ -void kill_gpm(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp, "%d", &old_pid) != 1) - gpm_report(GPM_PR_OOPS, GPM_MESS_READ_PROB, GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG, GPM_MESS_KILLING, old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO, GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid, SIGTERM) == -1) - gpm_report(GPM_PR_OOPS, GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO, GPM_MESS_KILLED, old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/synaptics.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/synaptics.c deleted file mode 100644 index 41173d92..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/synaptics.c +++ /dev/null @@ -1,3324 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#ifdef HAVE_MATH_H -#include /* ceil */ -#endif -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - -static int mouse_fd; - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -#if DEBUG_REPORTS -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} -#endif - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(mouse_fd); - syn_ps2_absolute_mode(mouse_fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - if (stick_pressure_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_stick_buttons; - if (tmp_buttons || last_stick_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - last_stick_buttons = tmp_buttons; - } - } - if (four_way_button_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_4_way_buttons; - if (tmp_buttons || last_4_way_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - last_4_way_buttons = tmp_buttons; - } - } - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - syn_ps2_reset(mouse_fd); - syn_ps2_absolute_mode(mouse_fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (int fd, Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - mouse_fd = fd; /* cheat */ - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (int fd, Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - mouse_fd = fd; /* cheat */ - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.2-broken/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.2-broken/src/twiddler.c deleted file mode 100644 index 69f17d47..00000000 --- a/software/gpm/browse_source/gpm-1.20.2-broken/src/twiddler.c +++ /dev/null @@ -1,530 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico-gpm@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/console.h" -#include "headers/twiddler.h" - - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(console.device, O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/BUGS b/software/gpm/browse_source/gpm-1.20.3/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.3/COPYING b/software/gpm/browse_source/gpm-1.20.3/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.3/Changes b/software/gpm/browse_source/gpm-1.20.3/Changes deleted file mode 100644 index 920a80ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/Changes +++ /dev/null @@ -1,60 +0,0 @@ -* From 1.20.1 to 1.20.3: - o Applied many cleanups - o Added etouch support - o Added scripts/report_success.sh - o Updated README - - pre6: - Cleaned up "make dist" target - Added two debbugging programs: - src/prog/display-buttons.c: display pressed buttons - src/prog/display-coords.c: display mouse coordinates - Fixed Bug#474516: gpm: debug messages in syslog (Debian) - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.3/MANIFEST b/software/gpm/browse_source/gpm-1.20.3/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.3/Makefile.in b/software/gpm/browse_source/gpm-1.20.3/Makefile.in deleted file mode 100644 index 2e6dad9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/Makefile.in +++ /dev/null @@ -1,138 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -### RELEASE STUFF -TARS =../gpm-$(release).tar.gz -TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=$(D_BASE)/archives/ -D_SOURCE=$(D_BASE)/browse_source/ - - -# configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -../gpm-$(release).tar: $(srcdir) - # no exclude possible of .git with pax it seems - #pax -w -x ustar -s '/^\./gpm-$(release)/' -w . -f $@ - pax -w -x ustar -s ';^;gpm-$(release)/;' -f $@ -w * - -../gpm-$(release).tar.gz: ../gpm-$(release).tar - gzip -9 -c $^ > $@ - -../gpm-$(release).tar.bz2: ../gpm-$(release).tar - bzip2 -9 -c $^ > $@ - -../gpm-$(release).tar.lzma: ../gpm-$(release).tar - lzma -9 -c $^ > $@ - -# 3. Put package together into .tar.gz and .tar.bz2 -#dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz -dist: disttest distclean distconf $(TARS) - chmod 0644 $(TARS) - scp $(TARS) $(D_HOST):$(D_DIR) - ssh "$(D_HOST)" "tar xvfz $(D_DIR)/gpm-$(release).tar.gz -C $(D_SOURCE)" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type f -exec chmod 0644 {} \\;" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type d -exec chmod 0755 {} \\;" - - -# create / update configure, delete other parts from earlier build -disttest: distconf clean - ./configure - make all - -### CLEANUP -distclean: clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -allclean: do-allclean distclean - rm -f configure diff --git a/software/gpm/browse_source/gpm-1.20.3/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.3/Makefile.include.in deleted file mode 100644 index d07fdc03..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/Makefile.include.in +++ /dev/null @@ -1,67 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.3/README b/software/gpm/browse_source/gpm-1.20.3/README deleted file mode 100644 index b336d9e0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/README +++ /dev/null @@ -1,329 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001-2008 nico-gpm2008 at schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== REPORT SUCCESS - -As it is always nice to see as an author of FOSS that the software is -used and alive und which options are used, you can send a success -report to me via ./scripts/report_success.sh. - - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit - http://lists.linux.it/listinfo/gpm - -or send a message with "subscribe" in its body to - gpm-request@lists.linux.it. - -For example: - echo subscribe | mail gpm-request@lists.linux.it - - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following place: - - http://unix.schottelius.org/gpm/archives/ - http://unix.schottelius.org/gpm/browse_source/ - -The homepage of gpm can be found at - - http://unix.schottelius.org/gpm/ - -You can get the latest development tree of gpm via git: - - git-clone http://unix.schottelius.org/git/gpm - -There are three branches available: - - master: Contains the latest gpm1 code, may be broken. - gpm-1-stable: Contains the latest stable source code. - gpm-2-dev: Contains work that heads to gpm2. - -You can browse the git-tree via gitweb: - - http://unix.schottelius.org/cgi-bin/gitweb.cgi?p=gpm;a=summary - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.3/README.gpm2 b/software/gpm/browse_source/gpm-1.20.3/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.3/README.versions b/software/gpm/browse_source/gpm-1.20.3/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3/TODO b/software/gpm/browse_source/gpm-1.20.3/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.3/acconfig.h b/software/gpm/browse_source/gpm-1.20.3/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.20.3/aclocal.m4 b/software/gpm/browse_source/gpm-1.20.3/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.20.3/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.20.3/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/build-from-git.sh b/software/gpm/browse_source/gpm-1.20.3/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.20.3/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.3/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.3/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.3/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.3/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.3/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.3/configure b/software/gpm/browse_source/gpm-1.20.3/configure deleted file mode 100644 index b9fc011e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/configure +++ /dev/null @@ -1,6099 +0,0 @@ -#! /bin/sh -# From configure.in configure.in. -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="src/daemon/main.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -RANLIB -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -YACC -YFLAGS -LN_S -DVIPS -TEXI2HTML -TEX -TEXINDEX -MAKEINFO -DIFF -SED -emacs -CPP -GREP -EGREP -ALLOCA -GPMXTERM -release -release_date -abi_lev -abi_full -EMACS -ELISP -SHLIB -PICFLAGS -SOLDFLAGS -CURSES_OBJS -SHARED_LIBS -lispdir -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -YACC -YFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-curses disable curses support even if curses found - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - YACC The `Yet Another C Compiler' implementation to use. Defaults to - the first program found out of: `bison -y', `byacc', `yacc'. - YFLAGS The list of arguments that will be passed by default to $YACC. - This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_config_headers="$ac_config_headers src/headers/config.h" - - -release=1.20.3 -release_date="15th of April 2008" -cat >>confdefs.h <<_ACEOF -#define GPM_RELEASE "$release" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define GPM_RELEASE_DATE "$release_date" -_ACEOF - - -abi=21 -abi_age=20 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -for ac_prog in 'bison -y' byacc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_YACC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_YACC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" - -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } -fi - - -# check for programs. -# Extract the first word of "dvips", so it can be a program name with args. -set dummy dvips; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DVIPS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_DVIPS="$DVIPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DVIPS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DVIPS" && ac_cv_path_DVIPS="no" - ;; -esac -fi -DVIPS=$ac_cv_path_DVIPS -if test -n "$DVIPS"; then - { echo "$as_me:$LINENO: result: $DVIPS" >&5 -echo "${ECHO_T}$DVIPS" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "texi2html", so it can be a program name with args. -set dummy texi2html; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEXI2HTML+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEXI2HTML in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEXI2HTML="$TEXI2HTML" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEXI2HTML="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEXI2HTML" && ac_cv_path_TEXI2HTML="no" - ;; -esac -fi -TEXI2HTML=$ac_cv_path_TEXI2HTML -if test -n "$TEXI2HTML"; then - { echo "$as_me:$LINENO: result: $TEXI2HTML" >&5 -echo "${ECHO_T}$TEXI2HTML" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "tex", so it can be a program name with args. -set dummy tex; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEX="$TEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEX" && ac_cv_path_TEX="no" - ;; -esac -fi -TEX=$ac_cv_path_TEX -if test -n "$TEX"; then - { echo "$as_me:$LINENO: result: $TEX" >&5 -echo "${ECHO_T}$TEX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "texindex", so it can be a program name with args. -set dummy texindex; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEXINDEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEXINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEXINDEX="$TEXINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEXINDEX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEXINDEX" && ac_cv_path_TEXINDEX="no" - ;; -esac -fi -TEXINDEX=$ac_cv_path_TEXINDEX -if test -n "$TEXINDEX"; then - { echo "$as_me:$LINENO: result: $TEXINDEX" >&5 -echo "${ECHO_T}$TEXINDEX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "makeinfo", so it can be a program name with args. -set dummy makeinfo; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_MAKEINFO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAKEINFO in - [\\/]* | ?:[\\/]*) - ac_cv_path_MAKEINFO="$MAKEINFO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_MAKEINFO="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MAKEINFO" && ac_cv_path_MAKEINFO="no" - ;; -esac -fi -MAKEINFO=$ac_cv_path_MAKEINFO -if test -n "$MAKEINFO"; then - { echo "$as_me:$LINENO: result: $MAKEINFO" >&5 -echo "${ECHO_T}$MAKEINFO" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "diff", so it can be a program name with args. -set dummy diff; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DIFF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DIFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DIFF" && ac_cv_path_DIFF="no" - ;; -esac -fi -DIFF=$ac_cv_path_DIFF -if test -n "$DIFF"; then - { echo "$as_me:$LINENO: result: $DIFF" >&5 -echo "${ECHO_T}$DIFF" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "sed", so it can be a program name with args. -set dummy sed; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $SED in - [\\/]* | ?:[\\/]*) - ac_cv_path_SED="$SED" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_SED" && ac_cv_path_SED="no" - ;; -esac -fi -SED=$ac_cv_path_SED -if test -n "$SED"; then - { echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "emacs", so it can be a program name with args. -set dummy emacs; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_emacs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $emacs in - [\\/]* | ?:[\\/]*) - ac_cv_path_emacs="$emacs" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_emacs="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_emacs" && ac_cv_path_emacs="no" - ;; -esac -fi -emacs=$ac_cv_path_emacs -if test -n "$emacs"; then - { echo "$as_me:$LINENO: result: $emacs" >&5 -echo "${ECHO_T}$emacs" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - { echo "$as_me:$LINENO: checking where to install Emacs Lisp files" >&5 -echo $ECHO_N "checking where to install Emacs Lisp files... $ECHO_C" >&6; } -if test "${itz_cv_path_site_lisp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac -fi -{ echo "$as_me:$LINENO: result: $itz_cv_path_site_lisp" >&5 -echo "${ECHO_T}$itz_cv_path_site_lisp" >&6; } - - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - -for ac_header in syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -# Check whether --with-curses was given. -if test "${with_curses+set}" = set; then - withval=$with_curses; -fi - - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - - - - -for ac_header in sys/sysmacros.h linux/major.h linux/tty.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ echo "$as_me:$LINENO: checking for __u32" >&5 -echo $ECHO_N "checking for __u32... $ECHO_C" >&6; } -if test "${itz_cv_type___u32+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include - -int -main () -{ - -__u32 dummy; -return 0; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - itz_cv_type___u32=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - itz_cv_type___u32=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $itz_cv_type___u32" >&5 -echo "${ECHO_T}$itz_cv_type___u32" >&6; } - -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - cat >>confdefs.h <<\_ACEOF -#define HAVE___U32 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking whether system is ELF" >&5 -echo $ECHO_N "checking whether system is ELF... $ECHO_C" >&6; } -if test "${itz_cv_sys_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __ELF__ -win -#else -lose -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "win" >/dev/null 2>&1; then - itz_cv_sys_elf=yes -else - itz_cv_sys_elf=no -fi -rm -f conftest* - -fi -{ echo "$as_me:$LINENO: result: $itz_cv_sys_elf" >&5 -echo "${ECHO_T}$itz_cv_sys_elf" >&6; } -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_c_compiler_gnu} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi - -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_c_compiler_gnu} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - - - -for ac_func in vsyslog syslog -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - if (p) return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_working_alloca_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_working_alloca_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } -if test $ac_cv_working_alloca_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - if (p) return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_alloca_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_alloca_works=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=\${LIBOBJDIR}alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -int -main () -{ - return find_stack_direction () < 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } - -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF - - -fi - - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - -as_ac_Lib=`echo "ac_cv_lib_$i''_tputs" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for tputs in -l$i" >&5 -echo $ECHO_N "checking for tputs in -l$i... $ECHO_C" >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$i $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tputs (); -int -main () -{ -return tputs (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_Lib=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -ac_res=`eval echo '${'$as_ac_Lib'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Lib'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_LIB$i" | $as_tr_cpp` 1 -_ACEOF - - LIBS="-l$i $LIBS" - -fi - - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - -as_ac_Lib=`echo "ac_cv_lib_$i''_wgetch" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for wgetch in -l$i" >&5 -echo $ECHO_N "checking for wgetch in -l$i... $ECHO_C" >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$i $TERMLIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char wgetch (); -int -main () -{ -return wgetch (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_Lib=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -ac_res=`eval echo '${'$as_ac_Lib'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Lib'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_LIB$i" | $as_tr_cpp` 1 -_ACEOF - - LIBS="-l$i $LIBS" - -fi - - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= - - - - - - - - - - - - - - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -ac_config_files="$ac_config_files Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "src/headers/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/headers/config.h" ;; - "Makefile.include") CONFIG_FILES="$CONFIG_FILES Makefile.include" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; - "doc/doc.gpm") CONFIG_FILES="$CONFIG_FILES doc/doc.gpm" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -RANLIB!$RANLIB$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -YACC!$YACC$ac_delim -YFLAGS!$YFLAGS$ac_delim -LN_S!$LN_S$ac_delim -DVIPS!$DVIPS$ac_delim -TEXI2HTML!$TEXI2HTML$ac_delim -TEX!$TEX$ac_delim -TEXINDEX!$TEXINDEX$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -DIFF!$DIFF$ac_delim -SED!$SED$ac_delim -emacs!$emacs$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -ALLOCA!$ALLOCA$ac_delim -GPMXTERM!$GPMXTERM$ac_delim -release!$release$ac_delim -release_date!$release_date$ac_delim -abi_lev!$abi_lev$ac_delim -abi_full!$abi_full$ac_delim -EMACS!$EMACS$ac_delim -ELISP!$ELISP$ac_delim -SHLIB!$SHLIB$ac_delim -PICFLAGS!$PICFLAGS$ac_delim -SOLDFLAGS!$SOLDFLAGS$ac_delim -CURSES_OBJS!$CURSES_OBJS$ac_delim -SHARED_LIBS!$SHARED_LIBS$ac_delim -lispdir!$lispdir$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" - ;; - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff --git a/software/gpm/browse_source/gpm-1.20.3/configure.in b/software/gpm/browse_source/gpm-1.20.3/configure.in deleted file mode 100644 index 713d52ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.20.3 -release_date="15th of April 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=21 -abi_age=20 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/Makefile b/software/gpm/browse_source/gpm-1.20.3/contrib/Makefile deleted file mode 100644 index 757ae02d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = /home/user/nico/projekte/gpm/gpm/contrib -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.3/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.3/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.3/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.3/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/other/README b/software/gpm/browse_source/gpm-1.20.3/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.3/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/Announce b/software/gpm/browse_source/gpm-1.20.3/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/FAQ b/software/gpm/browse_source/gpm-1.20.3/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.3/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.3/doc/Makefile.in deleted file mode 100644 index 4667fc2e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/Makefile.in +++ /dev/null @@ -1,189 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -## CLEANUP section -# normal cleanup -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# for creating distribution -distclean: clean - rm -f Makefile doc.gpm - -# to even remove things we leave for end-users -allclean: distclean - rm -f gpm.info - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -## DIST section -# when we cleaned it, we can securely copy us. -dist: distclean - # unneeded now: using pax + -s option and create tars in .. - #$(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.3/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.3/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.3/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.3/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.3/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.3/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.3/doc/doc.gpm.in deleted file mode 100644 index 94cb300b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/doc.gpm.in +++ /dev/null @@ -1,2295 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001-2008 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001-2008 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for me to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/gpm.info b/software/gpm/browse_source/gpm-1.20.3/doc/gpm.info deleted file mode 100644 index cd9761a4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/gpm.info +++ /dev/null @@ -1,1922 +0,0 @@ -This is /home/user/nico/projekte/gpm/gpm/doc/gpm.info, produced by makeinfo version 4.11 from /home/user/nico/projekte/gpm/gpm/doc/gpm.texinfo. - -INFO-DIR-SECTION Miscellaneous -START-INFO-DIR-ENTRY -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -END-INFO-DIR-ENTRY - - This file is a user's and programmer's manual for gpm 1.20.3. - - Copyright (C) 1994,1995,1998 Alessandro Rubini Copyright (C) -2001-2008 Nico Schottelius - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - This file documents the 1.20.3 release of the "General Purpose -Mouse" (gpm) server for the Linux text console (15th of April 2008). - - -File: gpm.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - -gpm -*** - -* Menu: - -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: - - -File: gpm.info, Node: Overview, Next: Server Invocation, Prev: Top, Up: Top - -1 Overview -********** - -The "gpm" package is a mouse server for the Linux console. It is meant -to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -`gpm' come from the `selection-1.5' package, by Andrew Haylett. - - The first application to support the mouse has been The Midnight -Commander, by Miguel de Icaza. `mc-0.11' and later releases offer -mouse support if you have the mouse server running on your system. The -file `t-mouse.el' provides support for using the mouse from within -Emacs. *Note Emacs Support::. - - As of release 0.96, a default-handler is released with gpm, and can -be used to handle Control-Mouse events to draw menus on the screen. -The `gpm-root' program, however, needs kernel 1.1.73 or newer. *Note -gpm-root::. - - Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as `kmouse-?.??.tar.gz' from the mirrors of -`ftp://tsx-11.mit.edu'. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - - As of release 1.20.0 the default device is removed. Now -m is a must. - - Release 1.20.1 introduces the must for -t and a specific way to use --m,-t,-o: Now you've got to use -m first, then -t and at last -o. This -seems to be more complex, but makes using of multiply mice possible with -clean code. - -* Menu: - -* Building the Release:: - - -File: gpm.info, Node: Building the Release, Prev: Overview, Up: Overview - -1.1 Compiling and Installing -============================ - -Just say `./configure && make && make install' to your shell. You'll -need gpm installed to compile the latest release of The Midnight -Commander with mouse support enabled. - - Binaries are not released with the package because it's safer for -you to compile the package by yourself. - - -File: gpm.info, Node: Server Invocation, Next: Gpm Internals, Prev: Overview, Up: Top - -2 Server Invocation -******************* - -The `gpm' executable is meant to act like a daemon (thus, `gpmd' would -be a better name for it). This section is meant to describe the -command-line options for `gpm', while its internals are outlined in the -next section. *Note Gpm Internals::. - - Due to restrictions in the `ioctl(TIOCLINUX)' system call, `gpm' must -be run by the superuser. The restrictions have been added in the last -1.1 kernels to fix a security hole related to selection and screen -dumping. - - The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's attitude. From -release 1.02 up to 1.19.2 is was possible for any user logged on the -system console to change the mouse _feeling_ using the -q option. This -is no longer possible for security reasons. - - As of 0.97 the server program puts itself in the background. To kill -`gpm' you can just reinvoke it with the `-k' cmdline switch, although -`killall gpm' can be a better choice. - -* Menu: - -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: - - -File: gpm.info, Node: Special Commands, Next: Command Line, Prev: Server Invocation, Up: Server Invocation - -2.1 Special Commands -==================== - -Version 1.10 adds the capability to execute _special_ commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - - Special commands are toggled by triple-clicking the left and right -button - an unlikely event during normal mouse usage. The easiest way -to triple-click is pressing one of the buttons and triple-click the -other one. When special processing is toggled, a message appears on the -console (and the speaker beeps twice, if you have a speaker); if the -user releases all the buttons and presses one of them again within -three seconds, then the special command corresponding to the button is -executed. - - The default special commands are: - -LEFT BUTTON - Reboot the system by signalling the init process - -MIDDLE BUTTON (IF ANY) - Execute `/sbin/shutdown -h now' - -RIGHT BUTTON - Execute `/sbin/shutdown -r now' - - The `-S' command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use `-S ""' (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - - As an example, `-S ":telinit 1:/sbin/halt"', associates killing init -to the left button, going single user to the middle one, and halting -the system to the right button. - - System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - - -File: gpm.info, Node: Command Line, Next: Bugs and Problems, Prev: Special Commands, Up: Server Invocation - -2.2 Command Line Options -======================== - -Available command line options are the following: - -`-a ACCEL' - Set the acceleration value used when a single motion event is - longer than DELTA (see `-d'). - -`-A[LIMIT]' - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer (`rm -rf /') - including the terminating line break, then all the victim has to - do is click the middle mouse button .. As of version 1.17.2, this - has developed into a more general aging mechanism; the gpm daemon - can disable (_age_) selection pasting automatically after a period - of inactivity. To enable this mode just give the optional LIMIT - parameter (no space in between !) which is interpreted as the - time in seconds for which a selection is considered valid and - pastable. As of version 1.15.7, a trivial program called - `disable-paste' is provided. The following makes a good addition - to `/etc/profile' if you allow multiple users to work on your - console. - - `case $( /usr/bin/tty ) in - /dev/tty[0-9]*) /usr/bin/disable-paste ;; - esac' - -`-b BAUD' - Set the baud rate. - -`-B SEQUENCE' - Set the button sequence. `123' is the normal sequence, `321' can - be used by left-handed people, and `132' can be useful with - two-button mice (especially within Emacs). All the button - permutations are allowable. - -`-d DELTA' - Set the delta value. When a single motion event is longer than - DELTA, ACCEL is used as a multiplying factor. (Must be 2 or above) - -`-D' - Do not automatically enter background operation when started, and - log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases it - was done with a compile-time option. - -`-g NUMBER' - With glidepoint devices, emulate the specified button with tapping. - NUMBER must be `1', `2', or `3', and refers to the button number - _before_ the `-B' button remapping is performed. This option - applies to the mman and ps2 decoding. No button is emulated by - default because the ps2 tapping is incompatible with some normal - ps2 mice - -`-h' - Print a summary of command line options. - -`-i INTERVAL' - Set INTERVAL to be used as an upper time limit for multiple - clicks. If the interval between button-up and button-down events - is less than LIMIT, the press is considered a double or triple - click. Time is in milliseconds. - -`-k' - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use `-R' or the single-open - limitation is removed from the kernel). - -`-l CHARSET' - Choose the `inword()' look up table. The CHARSET argument is a - list of characters. `-' is used to specify a range and `\ ' is - used to escape the next character or to provide octal codes. Only - visible character can appear in CHARSET because control characters - can't appear in text-mode video memory, whence selection is cut. - -`-m FILENAME' - Choose the mouse file to open. Must be before -t and -o. - -`-M' - Enable multiple mode. The daemon will read two different mouse - devices. Any subsequent option will refer to the second device, - while any preceding option will be used for the first device. This - option automatically forces the _repeater_ (`-R') option on. - -`-o LIST-OF-EXTRA-OPTIONS' - The option works similary to the "-o" option of mount; it is used - to specify a list of "extra options" that are specific to each - mouse type. The list is comma-separated. The options `dtr', `rts' - or `both' are used by the serial initialization to toggle the - modem lines like, compatibly with earlier gpm versions; note - however that using -o dtr associated with non-plain-serial mouse - types may now generate an error. *Note Mouse Types::. And by the - way, use -o after -m and after -t. - -`-p' - Forces the pointer to be visible while selecting. This is the - behaviour of `selection-1.7', but it is sometimes confusing. The - default is not to show the pointer, which can be confusing as well. - -`-r NUMBER' - Set the responsiveness. A higher responsiveness is used for a - faster cursor motion. - -`-R[NAME]' - Causes `gpm' to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo `/dev/gpmdata' in - protocol NAME, given as an optional argument (no space in between - !). In principle, you can use the same names as for the `-t' - option, although repeating into some protocols may not be - implemented for a while. *Note Mouse Types::. In addition, you - can specify `raw' as the NAME, to repeat the mouse data byte by - byte, without any protocol translation. If NAME is omitted, it - defaults to `msc'. Using gpm in repeater mode, you can configure - the X server to use its fifo as a mouse device. This option is - useful for bus-mouse owners to override the single-open - limitation. It is also an easy way to manage those stupid - dual-mode mice which force you to keep the middle button down - while changing video mode. The option is forced on by the `-M' - option. - -`-s NUMBER' - Set the sample rate for the mouse device. - -`-S COMMANDS' - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -`-t NAME' - Set the mouse type. Use `-t help' to get a list of allowable - types. Since version 1.18.1, the list also shows which protocols - are available as repeaters (see -R above), by marking them with an - asterisk ("*"). *Note Mouse Types::. Use -t after you selected - the mouse device with -m. - -`-v' - Print version information and exit. - -`-2' - Force two buttons. This means that the middle button, if any, will - be taken as it was the right one. - -`-3' - Force three buttons. By default the mouse is considered to be a - 2-buttons one, until the middle button is pressed. If three - buttons are there, the right one is used to extend the selection, - and the middle one is used to paste it. Beware: if you use the - `-3' option with a 2-buttons mouse, you won't be able to paste the - selection. - - -* Menu: - -* Bugs and Problems:: - - -File: gpm.info, Node: Bugs and Problems, Next: Mouse Types, Prev: Command Line, Up: Server Invocation - -2.3 Bugs and Problems -===================== - -The `gpm' server may have problems interacting with X: if your mouse is -a single-open device (i.e. a bus mouse), you should kill `gpm' before -starting X, or use the `-R' option (see above). To kill `gpm' just -invoke `gpm -k'. This problem doesn't apply to serial mice. - - Two instances of gpm can't run on the same system. If you have two -mice use the `-M' option (see above). - - While the current console is in graphic mode, `gpm' sleeps until -text mode is back (unless `-R' is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur out -in hidden consoles. - - The clients shipped out with gpm are not updated, thus there are -potential security risks when using them. - - -File: gpm.info, Node: Mouse Types, Prev: Bugs and Problems, Up: Server Invocation - -2.4 Mouse Types -=============== - -This section of the gpm documentation manual describes the various -pointer types currently available in gpm. If you look at the source -code, you'll find that pointer-specific code is confined to `mice.c' -(while it used to only include mouse decoders, gpm now supports tablets -and touchscreens as well). - - The mouse type is specified on command line with the `-t' option. -The option takes an argument, which represents the name of a mouse -type. Each type can be associated to different names. For old mouse -types, one name is the old selection-compatible name, and another is -the XFree name. After version 1.18.1 of gpm, the number of synonyms was -made arbitrary and the actual name being used is made available to the -function responsible for mouse initialization. Therefore it is possible -for a mouse decoder to behave slightly differently according to the -name being used for the device (if this feature was already present, we -wouldn't have for example ms+ and ms+lr as different mouse types). - - The initialization procedure of each mouse type can also receive -extra option, by means of the -o command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option string -is unused for that mouse type and specifying one generates an error. -When the document refer to "standard serial options" it means that one -of -o dtr, -o rts, -o both can be specified to toggle the control lines -of the serial port. - - The following mouse type are corrently recognized: - -`bare Microsoft' - The Microsoft protocol, without any extension. It only reports two - buttons. If your device has three, you should either try running - the mman decoder or msc. In the latter case, you need to tell the - mouse to talk msc protocol by toggling the DTR and RTS lines (with - one of -o drt, -o rts or -o both) or invoking `gpm -t msc' while - keeping the middle button pressed. Very annoying, indeed. This - mouse decoder accepts standard serial options, although they - should not be needed. - -`ms' - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious packets - which can be misunderstood as middle-button events. If this is - your case, use the `bare' mouse type. Some new two-button devices - are "plug and play", and they don't play fair at all; in this case - try -t pnp. Many (most) three-button devices that use the - microsoft protocol fail to report some middle-button events during - mouse motion. Since the protocol does not distinguish between the - middle button going up and the middle button going down it would - be liable to get out of step, so this decoder declares the middle - button to be up whenever the mouse moves. This prevents dragging - with the middle button, so you should probably use `-t ms+lr' - instead of this decoder, especially if you want to use X. This - mouse decoder accepts standard serial options, although they - should not be needed. - -`ms+' - This is the same as `-t ms' except that the middle button is not - reset during mouse motion. So you can drag with the middle button. - However, if your mouse exhibits the usual buggy behaviour the - decoder is likely to get out of step with reality, thinking the - middle button is up when it's down and vice versa. You should - probably use `-t ms+lr' instead of this decoder. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`ms+lr' - This is the same as `-t ms+' except that there is an additional - facility to reset the state of the middle button by pressing the - other two buttons together. Do this when the decoder gets into a - confused state where it thinks the middle button is up when it's - down and vice versa. (If you get sick of having to do this, please - don't blame gpm; blame your buggy mouse! Note that most - three-button mice that do the microsoft protocol can be made to do - the MouseSystems protocol instead. The "3 Button Serial Mouse - mini-HOWTO" has information about this.) This mouse decoder - accepts standard serial options, although they should not be - needed. - -`msc MouseSystems' - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try -t msc associated - with -o rts, -o dtr or -o both. - -`mman Mouseman' - The protocol used by the new Logitech devices with three buttons. - It is backward compatible with the Microsoft protocol, so if your - mouse has three buttons and works with -t ms or similar decoders - you may try -t mman instead to use the middle button. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`sun' - The protocol used on Sparc computers and a few others. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`mm MMSeries' - Title says it all. This mouse decoder accepts standard serial - options, although they should not be needed. - -`logi Logitech' - This is the protocol used by old serial Logitech mice. - -`bm BusMouse' - Some bus devices use this protocol, including those produced by - Logitech. - -`ps2 PS/2' - The protocol used by most busmice. - -`ncr' - This `type' is able to decode the pointing pen found on some - laptops (the NCR 3125 pen) - -`wacom' - The protocol used by the Wacom tablet. Since version 1.18.1 we - have a new Wacom decoder, as the old one was not working with new - tablets. This decoder was tested with Ultrapad, PenPartner, and - Graphire tablets. Options: -o relative (default) for relative - mode, -o absolute for absolute mode. - -`genitizer' - The \"Genitizer\" tablet, in relative mode. This mouse decoder - accepts standard serial options, although they should not be - needed. - -`logim' - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -`pnp' - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is hardwired - at 1200 baud and is upset by normal initialization, so this is a - -t bare decoder with no initialization at all. This mouse decoder - accepts standard serial options, although they should not be - needed. - -`ms3' - A decoder for the new serial IntelliMouse devices, the ones with - three buttons and a protocol incompatible with older ones. The - wheel is currently unused. - -`imps2' - "IntelliMouse" on the ps/2 port. This type can also be used for a - generic 2-button ps/2 mouse too, since it will auto-detect the - type. - -`netmouse' - Decodes the "Genius NetMouse" type of devices on the ps/2 port. - For serial "Netmouse" devices, use the "ms3" decoder. - -`cal' - A decoder of the "Calcomp UltraSlate device. - -`calr' - Same as above, but in relative mode. - -`twid' - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't yet - support X keycodes. If used with `-R', `gpm' will anyway repeat - mouse events to the X server. More information about twiddler - support can be found in `README.twiddler', in the gpm distribution. - -`syn synaptics' - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although they - should not be needed. - -`synps2 synaptics_ps2' - Same as above, but for the devices attached to the ps2 port. - -`brw' - A decoder for the Fellowes Browser, a device with 4 buttons and a - wheel. This mouse decoder accepts standard serial options, - although they should not be needed. - -`js Joystick' - This mouse type uses the joystick device to generate mouse events. - It is only available if the header `linux/joystick.h' is found at - compile time. The header (and the device as well) has been - introduced only during 2.1 development, and is not present in - version 2.0 of the kernel. - -`summa' - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it can - -R summa can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified xf86Summa.o module. - -`mtouch' - A decoder for the MicroTouch touch screen. Please refer to the - file `README.microtouch' in the source tree of gpm for further - information. In the near future, anyways, I plan to fold back to - this documentation the content of that file. - -`gunze' - A decoder for the gunze touch screen. Please refer to the file - `README.gunze' in the source tree of gpm for further information. - In the near future, anyways, I plan to fold back to this - documentation the content of that file. The decoder accepts the - following options: smooth=, debounce=. An higher smoothness - results in slower motion as well; a smaller smoothness gives - faster motion but, obviously, less smooth. The default smoothness - is 9. The debounce time is express in milliseconds and is the - minimum duration of an up-down event to be taken as a tap. Smaller - bounces are ignored. - -`acecad' - The Acecad tablet in absolute mode. - -`wp wizardpad' - Genius WizardPad tablet - - - -File: gpm.info, Node: Gpm Internals, Next: The ClientLib, Prev: Server Invocation, Up: Top - -3 Gpm Internals -*************** - -The server is organized as a main loop built around a `select()' system -call. It responds both to mouse events and to input from the clients, -which are connected to the server through a unix domain socket. The -connection is used to tell the server what a client is interested in, -and to get mouse events. - - When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most interesting). - -* Menu: - -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: - - -File: gpm.info, Node: Events, Next: Margins, Prev: Gpm Internals, Up: Gpm Internals - -3.1 Events -========== - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual consoles. *Note -Default Handlers::. - - When a client is involved, it is handled a `Gpm_Event' structure, -built by the server. The fields for `Gpm_Event' are the following: - -`unsigned char buttons;' - An or-mask of the values `GPM_B_LEFT', `GPM_B_MIDDLE' and - `GPM_B_RIGHT'. It corresponds to the state of the mouse buttons - when the event is reported. The current implementation of gpm - allows at most three buttons. - -`unsigned char modifiers;' - The value of the kernel variable `shift_state', as of - `keyboard.c', when the event is reported. It is a bitmask value, - and corresponds to the least significant byte of the value used by - the `loadkeys' program. Use of symbolic names in source code is - available after inclusion of `linux/keyboard.h', as exemplified in - `mev.c'. - -`unsigned short vc;' - The number of the active virtual console when the event is - reported. The client is not expected to use this value, which - corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. *Note Default - Handlers::. - -`short x, y;' - The position of the mouse pointer where the event is reported. It - is 1-based by default, to be compatible with `selection' and - `libcurses'. This behavior can be overriden, though, by setting - the library variable `gpm_zerobased'. *Note Variables::. - -`short dx, dy;' - The change in position since the last reported event. - -`enum Gpm_Etype type;' - A bit-mask, representing the type of reported event, as described - later. *Note Event Types::. - -`int clicks;' - A counter, which is valid at button-down, drag or button-up. It - can be 0, 1 or 2 to mean single, double or triple click. - -`enum Gpm_Margin margin;' - A bit-mask, telling if the pointer has gone out of the visible - screen. The indivudual bits are named `GPM_TOP', `GPM_BOT', - `GPM_LFT', `GPM_RGT'. Only one of them is active at a time, to - allow using `switch' on the value. Vertical outrun takes - precedence on horizontal outrun. *Note Margins::. - - -File: gpm.info, Node: Margins, Next: Event Types, Prev: Events, Up: Gpm Internals - -3.2 How margins are managed -=========================== - -Motion and button-press events are constrained to remain within the -visible screen. This means that the `x' will be within 1 and 80 and `y' -will be within 1 and 25 when the console is 80x25 cells. However, a -client can keep track of movements outside the screen, by using the -`dx' and `dy' fields, which aren't subject to clipping. - - The server helps applications in detecting margin conditions by -filling the `margin' field. Whenever the pointer tries to cross screen -boundaries, it is forced to remain on the border, but a flag is set in -`margin'. - - A different policy is in force for drag and button-release events. -In this case the pointer is allowed to go outside the physical screen -by exactly one position. This allows, for example, selecting to end of -line by dragging down-left. The peculiar situation is nonetheless -signaled through the `margin' flags. The client should be careful to -fit the values within the screen if needed. *Note Utility Functions::. - - -File: gpm.info, Node: Event Types, Next: Connection Details, Prev: Margins, Up: Gpm Internals - -3.3 Event Types -=============== - -The `type' field in `Gpm_Event' is made up of bit-wide flags. The -existing bit masks belong to two groups: bare events and cooked events. -The bit-mask `GPM_BARE_EVENTS' is provided to extract bare events, by -and-ing (`&') it with the `type' field. For any event, exactly one bit -will be set in the resulting bitmask. - - Bare events are the following: - -`GPM_MOVE' - A motion event, with all buttons up. - -`GPM_DRAG' - A motion event, but one or more buttons are kept pressed. - -`GPM_DOWN' - A button press event. The `buttons' field will report which - buttons are pressed after the event. - -`GPM_UP' - A button release event. The `buttons' field will report which - buttons are being released. Note that this is different from the - previous case. - -`GPM_ENTER' - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. When the - type is `GPM_ENTER', all the other fields are undefined. *Note - High Level Lib::. - -`GPM_LEAVE' - This is only delivered by the high level library, too. Events of - type `GPM_LEAVE' have all other fields undefined. - - Cooked events are the following: - -`GPM_SINGLE' - This bit may be set at button-press, drag and button release - events, and can be used to identify a single press. The time - interval used to choose a double click from two single clicks is - set by a parameter in the daemon (configurable at daemon - invocation). - -`GPM_DOUBLE' - Used to identify a double click (press, drag, release) - -`GPM_TRIPLE' - Used to identify a triple click (press, drag, release) - -`GPM_MFLAG' - The "motion flag" is true if some dragging happened between - button-press and button-release. It can be used by those - applications which respond to events at button release. It is - available at drag and release. - - -File: gpm.info, Node: Connection Details, Next: Default Handlers, Prev: Event Types, Up: Gpm Internals - -3.4 Connection Details -====================== - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading it. -All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - - In addition to the per-console stacks, another stack is there to -store default-handling clients. *Note Default Handlers::. - - Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - - Clients are required to fill a `Gpm_Connect' structure and pass it -to the server. The structure is made up by four `unsigned int' fields. -*Note Open and Close::. - -`eventMask' - A bitmask of the events the client wants to receive. Both bare and - cooked events are allowed to appear in the mask. - -`defaultMask' - A mask to tell which events allow a default treatment (the - selection one). These are mouse events, independent of the - modifier keys. - -`minMod' - The minimum amount of modifiers required by the client. This field - is used for default-handlers which manage control-mouse events - without interfering with mouse-only ones. *Note Default - Handlers::. - -`maxMod' - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in `maxMod' won't be - passed to the client. - Two more fields are there to tell about the connection itself, and -you're not asked to fill them, because `Gpm_Open' will do it for you. - -`int pid' - The process id of the connecting application. - -`int vc' - Which virtual console to gain control of. - - Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in *note Default Handlers::, but you only -need to choose the right values for your application. - - Examples: -`minMod=0; maxMod=0;' - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -`minMod=0; maxMod=~0;' - is a client which gets any mouse event. - -`minMod=1< /tmp/du" - } - - button 3 { - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - - The syntax for the file won't be described here, being it quite -apparent from the example above. Blanks and newlines are unused in -parsing the file, and the layout of the file is free. Comments are -allowed in the file: any hash mark (`#') found at the beginning of the -line or after white space makes the parser discard anything up to the -next line. To insert quotes (`"') in strings precede them with a -backslash. - - Note that recursive menus are allowed, to any level of recursion. - - Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -`button NUMBER MENU' - The `button' keyword is used to introduce a menu. It is followed - by the number of the relevant button (1=left, 2=middle, 3=right), - an open brace, a menu and a closed brace. A menu is made up of - cfg statements, followed by action statements. Cfg statements can - come in any order, while the order of action statements tells the - actual order in which actions will appear on the screen, top to - bottom. - - The following statements belong to the cfg set. - -`name STRING' - If the `name' keyword is present, the specified STRING will be - used as the name for the current menu. - -`background COLOR' - This statements is used to specify the background color to be used - in the current menu. The COLOR can be specified with one of the - eight canonical strings `black', `red', `cyan' etc. The background - defaults to black. - -`foreground COLOR' - This statements is used to specify the foreground color for menu - items. Its value defaults to `white'. An optional `bright' - keyword can appear before the actual color. - -`border COLOR' - `border' is used to specify the border color for the menu. Its - value defaults to `white'. An optional `bright' keyword can - appear before the actual color. - -`head COLOR' - `head' is used to specify the foreground color for the title of - the menu. Its value defaults to `white'. An optional `bright' - keyword can appear before the actual color. - - The following statements belong to the action set. - -`STRING f.fgcmd CMDSTRING' - When the mouse button is released above the corresponding menu - item, the CMDSTRING is pasted in the keyboard queue of the current - console. This is not yet implemented. - -`STRING f.bgcmd CMDSTRING' - When the mouse button is released above the corresponding menu - item, a shell (`/bin/sh') is forked to execute the specified - command, with `stdin' connected to `/dev/null', and `stdout', - `stderr' connected to the active console. - -`STRING f.jptty TTYNUMBER' - When the mouse button is released above the corresponding menu - item, the console is switched to the one specified. The TTYNUMBER - must be specified as a string. Any tty can be reached this way, - even those which are not accessible via the keyboard. - -`STRING f.mktty TTYNUMBER' - When the mouse button is released above the corresponding menu - item, an unused console is selected, and `/sbin/mingetty' is - executed in it. The current console is switched to the newly - opened console. I use this command to save kernel memory by - opening a single console through `/etc/inittab' and requesting the - others only when i need to login. - -`STRING WHOLE-MENU' - A menu can directly follow the label string. When the mouse - pointer leaves the menu frame at the level of STRING, a second - menu is posted on screen. - -`STRING f.lock' - When the mouse button is released above the corresponding menu - item, the keyboard and the screen are locked, and only the locking - user or the superuser can unlock them. This is not yet implemented. - -`STRING f.load' - The current loadavg when the menu is posted is concatenated to - STRING to build the actual message displayed on screen. Nothing - happens at button release. - -`STRING f.free' - The free memory and swap when the menu is posted is concatenated - to STRING to build the actual message displayed on screen. Nothing - happens at button release. - -`STRING f.time' - The current time is formatted with strftime(3), according to - STRING. The resulting string is the actual message displayed on - screen. Nothing happens at button release. - -`STRING f.pipe CMDLINE' - When the mouse pointer leaves the menu frame at the level of - STRING, a message box is posted on screen showing the last ten - lines of the output of CMDLINE. CMDLINE is executed by `/bin/sh'. - This is not yet implemented. - -`STRING f.nop' - This does nothing, it only displays STRING on the menu. - - The `HOME', `LOGNAME' and `USER' environment variables are setup to -the values for the invoking user before spawning an external process -(`f.bgcmd', `f.pipe'). The current directory is always `/'. - - Known bugs have been fixed. In particular, if you invoke `gpm-root' -right after `gpm', it will delay a few seconds before trying to connect -to the daemon. - - -File: gpm.info, Node: hltest, Next: mouse-test, Prev: gpm-root, Up: Demo Clients - -5.5 `hltest' -============ - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - - The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help in -understanding the internal workings. - - -File: gpm.info, Node: mouse-test, Prev: hltest, Up: Demo Clients - -5.6 `mouse-test' -================ - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between `-t ms' (three-buttons aware) and `-t -bare' old two-buttons-only serial mice. - - I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -File: gpm.info, Node: Type Index, Next: Function Index, Prev: Demo Clients, Up: Top - -Type Index -********** - -[index] -* Menu: - -* Gpm_Connect: Connection Details. (line 26) -* Gpm_Event: Events. (line 13) -* Gpm_Handler: Handling Functions. (line 11) -* Gpm_roi: Concepts. (line 12) - - -File: gpm.info, Node: Function Index, Next: Variable Index, Prev: Type Index, Up: Top - -API Index -********* - -[index] -* Menu: - -* Gpm_CharsQueued: Getting Events. (line 17) -* Gpm_Close: Open and Close. (line 34) -* GPM_DRAWPOINTER: Utility Functions. (line 14) -* Gpm_DrawPointer: Utility Functions. (line 13) -* Gpm_FitEvent: Utility Functions. (line 25) -* Gpm_FitValues: Utility Functions. (line 24) -* Gpm_FitValuesM: Utility Functions. (line 23) -* Gpm_Getc: Getting Events. (line 31) -* Gpm_Getch: Getting Events. (line 42) -* Gpm_Getchar: Getting Events. (line 32) -* Gpm_GetEvent: Getting Events. (line 7) -* Gpm_GetLibVersion: Extra Functions. (line 7) -* Gpm_GetServerVersion: Extra Functions. (line 16) -* Gpm_GetSnapshot: Extra Functions. (line 29) -* Gpm_HandleRoi: hl-Functions. (line 40) -* Gpm_LowerRoi: hl-Functions. (line 34) -* Gpm_Open: Open and Close. (line 7) -* Gpm_PopRoi: hl-Functions. (line 25) -* Gpm_PushRoi: hl-Functions. (line 8) -* Gpm_RaiseRoi: hl-Functions. (line 29) -* Gpm_Repeat: Utility Functions. (line 7) -* Gpm_UseRoi: hl-Functions. (line 20) -* Gpm_Wgetch: Getting Events. (line 41) - - -File: gpm.info, Node: Variable Index, Prev: Function Index, Up: Top - -Variable Index -************** - -[index] -* Menu: - -* gpm_current_roi: hl-Variables. (line 11) -* gpm_data: Variables. (line 44) -* gpm_fd: Variables. (line 16) -* gpm_flag: Variables. (line 9) -* gpm_handler: Variables. (line 44) -* gpm_hflag: Variables. (line 40) -* gpm_morekeys: Variables. (line 48) -* gpm_mx: Variables. (line 30) -* gpm_my: Variables. (line 30) -* gpm_roi: hl-Variables. (line 7) -* gpm_roi_data: hl-Variables. (line 20) -* gpm_roi_handler: hl-Variables. (line 17) -* gpm_tried: Variables. (line 12) -* gpm_visiblepointer: Variables. (line 26) -* gpm_zerobased: Variables. (line 20) - - - -Tag Table: -Node: Top1253 -Node: Overview1486 -Node: Building the Release3261 -Node: Server Invocation3682 -Node: Special Commands4870 -Node: Command Line7283 -Node: Bugs and Problems13889 -Node: Mouse Types14760 -Node: Gpm Internals24602 -Node: Events25480 -Node: Margins27960 -Node: Event Types29078 -Node: Connection Details31089 -Node: Default Handlers35089 -Node: The ClientLib36662 -Node: Handling Functions37343 -Node: Low Level Library40208 -Node: Variables40701 -Node: Open and Close42799 -Node: Getting Events44772 -Node: Utility Functions47011 -Node: Extra Functions48594 -Node: High Level Lib51016 -Node: Concepts51964 -Node: hl-Variables53360 -Node: hl-Functions54031 -Node: Xterm56560 -Node: Demo Clients57678 -Node: mev57908 -Node: sample/rmev61120 -Node: Emacs Support61623 -Node: gpm-root63725 -Node: hltest72080 -Node: mouse-test72547 -Node: Type Index73060 -Node: Function Index73488 -Node: Variable Index75303 - -End Tag Table diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/infofilter b/software/gpm/browse_source/gpm-1.20.3/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/manpager b/software/gpm/browse_source/gpm-1.20.3/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/mktxt b/software/gpm/browse_source/gpm-1.20.3/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/old/Changelog b/software/gpm/browse_source/gpm-1.20.3/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.20.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.20.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/support/README b/software/gpm/browse_source/gpm-1.20.3/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.3/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.3/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.4 deleted file mode 100644 index 0017ac8a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.4 +++ /dev/null @@ -1,3 +0,0 @@ -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c -- add report success diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.3 deleted file mode 100644 index d7630018..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.3 +++ /dev/null @@ -1,5 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c -- check for rmev (1.19.6 or 1.17.8) diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.4 deleted file mode 100644 index 16a89d5c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- cleanup autoconf stuff diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.7 deleted file mode 100644 index c7e2e926..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.7 +++ /dev/null @@ -1 +0,0 @@ -- first vertical prototype: have on mouse input running diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.20.3/install-sh b/software/gpm/browse_source/gpm-1.20.3/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.3/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.3/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.3/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.3/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/Makefile b/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/Makefile deleted file mode 100644 index cfb65333..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Makefile for a basic kernel module - -CC=gcc - -#MODCFLAGS := -Wall -DMODULE -D__KERNEL__ -DLINUX -MODCFLAGS := -D__KERNEL__ -I/usr/src/linux-2.3.99-pre6/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -march=i586 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.3.99-pre6/include/linux/modversions.h - - -touchscreen.o: touchscreen.c /usr/include/linux/version.h - $(CC) $(MODCFLAGS) -c touchscreen.c - -audio.o: audio.c /usr/include/linux/version.h - $(CC) $(MODCFLAGS) -c audio.c diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.3/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.3/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.3/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.3/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.3/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.3/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.20.3/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.20.3/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.3/scripts/gpm.release deleted file mode 100644 index 963e0c6d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/scripts/gpm.release +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(awk -F= '/^release=/ { print $2 }' configure.in )" -#VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo -n "=> Version: $VERSION; ok?" -read ok -#echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.3/scripts/report_success.sh b/software/gpm/browse_source/gpm-1.20.3/scripts/report_success.sh deleted file mode 100644 index ab66ae70..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/scripts/report_success.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-ccollect at schottelius.org) -# -# This file is part of ccollect. -# -# ccollect 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 3 of the License, or -# (at your option) any later version. -# -# ccollect 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 ccollect. If not, see . -# -# Sends feedback -# -# Adapted for gpm -# - -software="gpm" -author="Nico Schottelius" -subject="==> success: $software" -to="nico-gpm-success" -host="schottelius.org" -fullto="${to}@${host}" - -info="$(awk -F= '/^release=/ { print $2 }' configure.in; uname -s -v -r -m)" - - -echo "Reporting success for $software to ${author}" -echo "-----------------" -echo -n "Your name (leave free for anonymous): " -read name -echo -n "Your email (leave free for anonymous): " -read email -echo -n "Your normal gpm parameters (-m -t -o ...): " -read params -echo -n "Comment (leave free for no comment): " -read comment - -echo "" -echo "The following information will be send to ${author}:" -echo "" - -cat << eof -Name: $name (will be used to contact you and kept secret) -E-Mail: $email (will be used to contact you and kept secret) -Comment: $comment -Info: $info -Parameters: $params - -eof - -echo -n "Is it ok to send out that mail (press enter to send or ctrl-c to abort)? " -read yes - -cat << eof | mail -s "$subject" "$fullto" -Name: $name -E-Mail: $email -Comment: $comment -Info: $info -Parameters: $params -eof - -echo "Send. Thank you for your feedback." diff --git a/software/gpm/browse_source/gpm-1.20.3/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.3/src/Makefile.in deleted file mode 100644 index 56451484..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/Makefile.in +++ /dev/null @@ -1,181 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/header.c daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c \ - prog/display-buttons.c prog/display-coords.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) -Iheaders @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) - -## Release / Dist - - -## Cleanup -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/drivers.h \ - Makefile $(DEPFILE) - -allclean: clean - rm -f headers/config.h.in diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/cmdline.c deleted file mode 100644 index 66c8ecc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm.c deleted file mode 100644 index 33a1b20a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/header.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/main.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/main.c deleted file mode 100644 index 724e4db8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/processconn.c deleted file mode 100644 index 646acdc0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/processmouse.c deleted file mode 100644 index b3f3994e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/processmouse.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/processrequest.c deleted file mode 100644 index 309834c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/startup.c deleted file mode 100644 index b58fb6c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/startup.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* log to debug, who we are */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_VERSION); - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.20.3/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/drivers/README b/software/gpm/browse_source/gpm-1.20.3/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.20.3/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.20.3/src/generic/getsym.c deleted file mode 100644 index b8f5bfcd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/generic/getsym.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.20.3/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/Makefile b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/Makefile deleted file mode 100644 index 6b8ac786..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/Makefile +++ /dev/null @@ -1,136 +0,0 @@ -# -# cinit -# -# Nico Schottelius -# -# Don't edit Makefiles, use conf/* for configuration. -# - -#include Makefile.tests - -# Build tools / locations -CC=./tmp/cc -CFLAGS= -LD=./tmp/ld -LDFLAGS= -STRIP=./tmp/strip -SBIN=../sbin - -# directories and files -CONFIG_H=include/config.h - -BIN=cinit - -# -# End user targets -# -all: out/gpm2-daemon - - -# -# All objects depend on headers. -# -GPM2_DAEMON_HEADERS=$(shell cat deps/gpm2-daemon-headers) - - -# -# Objects -# - -GPM2_DAEMON_OBJECTS=$(shell cat deps/gpm2-daemon) -$(GPM2_DAEMON_OBJECTS): $(GPM2_DAEMON_HEADERS) - -GPM2_DAEMON_PROTOCOLS=$(shell cat tmp/protocol-deps) - -CLIENT= - -COMMUNICATION= - -OBJ= - -# -# Programs -# - -out/gpm2-daemon: $(GPM2_DAEMON_OBJECTS) $(GPM2_DAEMON_PROTOCOLS) - $(LD) -o $@ $^ - - -# -# Generic -# - -%.o: %.c .configured - $(CC) -c -o $@ $< - - - -# -# First do configuration, so we include the right variables -# -Makefile: .configured - -.configured: conf/* - @./scripts/generate_cbuiltconfig.sh conf - -$(CINIT_OBJ): $(CONFIG_H) - - -$(CONFIG_H): ../conf/* - ../scripts/cinit.mkheader > $(CONFIG_H) - -cservice: $(SBIN)/cservice - -$(SBIN)/cservice util/cservice: $(SBIN) $(CSVC_OBJ) - $(LD) $(LDFLAGS) $(CSVC_OBJ) -o $@ - $(STRIP) $@ - -ccontrol: $(SBIN)/ccontrol - -$(SBIN)/ccontrol util/ccontrol: config.h $(SBIN) $(CCO_OBJ) - $(LD) $(LDFLAGS) $(CCO_OBJ) -o $@ - $(STRIP) $@ - -install: install-dir cinit cservice ccontrol - @echo '*** Installing cinit ***' - ./bin/cinit.install.binary - -install-miniconf: - ./bin/cinit.install.miniconf - -install-dir: - ./bin/cinit.install.dir - - -################################################################################ -# -# Build targets -# -cinit: $(CINIT_OBJ) - $(LD) $^ -o $@ - -uml: cinit - ../../vm/uml/uml-mount.sh - cp cinit ../../vm/uml/root/sbin/cinit - ../../vm/uml/uml-umount.sh - -umlstart: uml - ../../vm/uml/uml-start.sh - -################################################################################ -# -# Generic targets -# - -.PHONY: dist -dist: distclean - -.PHONY: distclean -distclean: clean - rm -f os/current ipc/current .configured - -.PHONY: clean -clean: - rm -f ../tmpbin/*.configured - rm -f $(BIN) $(CINIT_OBJ) - rm -f test/*.o diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/main.o b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/main.o deleted file mode 100644 index f9c81a6a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/main.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/read_config.o b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/read_config.o deleted file mode 100644 index 8de7c7f9..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/read_config.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/set_defaults.o b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/set_defaults.o deleted file mode 100644 index 7df4451c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/core/set_defaults.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/commandline.o b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/commandline.o deleted file mode 100644 index 0ef739e4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/commandline.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/daemon-usage.o b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/daemon-usage.o deleted file mode 100644 index 793bf9cd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/daemon-usage.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/mini_printf.o b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/mini_printf.o deleted file mode 100644 index 0c1c81ad..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/mini_printf.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/ps2.o b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/ps2.o deleted file mode 100644 index baa8bd84..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/mice/ps2.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/out/gpm2-daemon b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/out/gpm2-daemon deleted file mode 100644 index 49e027f6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/out/gpm2-daemon and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/README b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/README deleted file mode 100644 index 30214bfd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/README +++ /dev/null @@ -1 +0,0 @@ -Directory for temporarily created files. diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/cc b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/cc deleted file mode 100644 index dec616cc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/cc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -"gcc" -pipe -W -Wall -Werror -I. -Iinclude -g "$@" diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/ld b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/ld deleted file mode 100644 index 6693ab93..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/ld +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -"gcc" "$@" diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/protocol-deps b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/protocol-deps deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/protocol-deps +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/protocols.h b/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/protocols.h deleted file mode 100644 index 51f8a082..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/gpm2/tmp/protocols.h +++ /dev/null @@ -1,2 +0,0 @@ -int gpm2_open_ps2(int fd); -int gpm2_decode_ps2(int fd); diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/config.h.in b/software/gpm/browse_source/gpm-1.20.3/src/headers/config.h.in deleted file mode 100644 index 6235e1f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/config.h.in +++ /dev/null @@ -1,114 +0,0 @@ -/* src/headers/config.h.in. Generated from configure.in by autoheader. */ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_INPUT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_JOYSTICK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_MAJOR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_TTY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_CURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `syslog' function. */ -#undef HAVE_SYSLOG - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYSLOG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSMACROS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vsyslog' function. */ -#undef HAVE_VSYSLOG - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.20.3/src/headers/daemon.h deleted file mode 100644 index a8936ad4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/daemon.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.3/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.3/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.3/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.3/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.3/src/headers/message.h deleted file mode 100644 index 37e87f42..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.3/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.3/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.3/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.3/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.3/src/lib/liblow.c deleted file mode 100644 index 25a1d5c4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/lib/liblow.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.3/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.3/src/lib/report-lib.c deleted file mode 100644 index 812fdb8e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/lib/report-lib.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/mice.c b/software/gpm/browse_source/gpm-1.20.3/src/mice.c deleted file mode 100644 index f62dca0a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/mice.c +++ /dev/null @@ -1,2509 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.3/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/display-buttons.c b/software/gpm/browse_source/gpm-1.20.3/src/prog/display-buttons.c deleted file mode 100644 index de8e5b25..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/prog/display-buttons.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-buttons -lgpm display-buttons.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * left/middle/right button - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": p=%d, l=%1d, m=%1d, r=%1d, clicks=%d\n", - event->type & GPM_DOWN, - event->buttons & GPM_B_LEFT, - event->buttons & GPM_B_MIDDLE, - event->buttons & GPM_B_RIGHT, - event->clicks); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_DRAG | GPM_DOWN | GPM_UP; - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - printf("\tp=pressed (0=release)\n\tl=left\n\tm=middle\n\tr=right\n"); - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/display-coords.c b/software/gpm/browse_source/gpm-1.20.3/src/prog/display-coords.c deleted file mode 100644 index ed15c8a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/prog/display-coords.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-coords -lgpm display-coords.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * x/y coords on the screen - * dx, dy: deltas - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_MOVE; /* read only moves */ - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.3/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.3/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.3/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.3/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.20.3/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/prog/open_console.o b/software/gpm/browse_source/gpm-1.20.3/src/prog/open_console.o deleted file mode 100644 index 4ca2472d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3/src/prog/open_console.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/report.c b/software/gpm/browse_source/gpm-1.20.3/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.3/src/synaptics.c b/software/gpm/browse_source/gpm-1.20.3/src/synaptics.c deleted file mode 100644 index 54d4aa3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/synaptics.c +++ /dev/null @@ -1,3305 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/tools.c b/software/gpm/browse_source/gpm-1.20.3/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.20.3/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.3/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/.exclude b/software/gpm/browse_source/gpm-1.20.3pre3/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/.gitignore b/software/gpm/browse_source/gpm-1.20.3pre3/.gitignore deleted file mode 100644 index 00e23427..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -*.o -*.a -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in -src/gpm2/tmp -src/gpm2/out diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/BUGS b/software/gpm/browse_source/gpm-1.20.3pre3/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/COPYING b/software/gpm/browse_source/gpm-1.20.3pre3/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/Changelog b/software/gpm/browse_source/gpm-1.20.3pre3/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/Changes b/software/gpm/browse_source/gpm-1.20.3pre3/Changes deleted file mode 100644 index 1cc65649..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/Changes +++ /dev/null @@ -1,35 +0,0 @@ -* From 1.20.1 to 1.20.3: - o many cleanups - o etouch support -* From 1.20.1 to 1.20.2: -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/MANIFEST b/software/gpm/browse_source/gpm-1.20.3pre3/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre3/Makefile.in deleted file mode 100644 index 1cfaa7c4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/Makefile.in +++ /dev/null @@ -1,123 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -f configure - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.3pre3/Makefile.include.in deleted file mode 100644 index fab5ac79..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/Makefile.include.in +++ /dev/null @@ -1,68 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/README b/software/gpm/browse_source/gpm-1.20.3pre3/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/README.gpm2 b/software/gpm/browse_source/gpm-1.20.3pre3/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/TODO b/software/gpm/browse_source/gpm-1.20.3pre3/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/acconfig.h b/software/gpm/browse_source/gpm-1.20.3pre3/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/aclocal.m4 b/software/gpm/browse_source/gpm-1.20.3pre3/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.20.3pre3/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/build-from-git.sh b/software/gpm/browse_source/gpm-1.20.3pre3/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/configure.in b/software/gpm/browse_source/gpm-1.20.3pre3/configure.in deleted file mode 100644 index f5624b8b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.20.3pre3 -release_date="Summer 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/other/README b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/Announce b/software/gpm/browse_source/gpm-1.20.3pre3/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/FAQ b/software/gpm/browse_source/gpm-1.20.3pre3/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.3pre3/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre3/doc/Makefile.in deleted file mode 100644 index d8b95c65..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/Makefile.in +++ /dev/null @@ -1,180 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.3pre3/doc/doc.gpm.in deleted file mode 100644 index bc800fa1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001,2002 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001,2002 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/infofilter b/software/gpm/browse_source/gpm-1.20.3pre3/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/manpager b/software/gpm/browse_source/gpm-1.20.3pre3/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/mktxt b/software/gpm/browse_source/gpm-1.20.3pre3/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/README b/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.4 deleted file mode 100644 index 7191a2eb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.5 deleted file mode 100644 index 2511028d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.5 +++ /dev/null @@ -1 +0,0 @@ -- seperate "drivers" from the rest diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/install-sh b/software/gpm/browse_source/gpm-1.20.3pre3/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/scripts/build-tar.sh b/software/gpm/browse_source/gpm-1.20.3pre3/scripts/build-tar.sh deleted file mode 100644 index 2ddeedd8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/scripts/build-tar.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -version=1.20.3pre3 - -git archive --format=tar --prefix=gpm-${version}/ HEAD | \ - tee ../gpm-${version}.tar | bzip2 -9 > ../gpm-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.3pre3/scripts/gpm.release deleted file mode 100644 index fbf03ef4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/scripts/gpm.release +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre3/src/Makefile.in deleted file mode 100644 index 15914e9e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/Makefile.in +++ /dev/null @@ -1,166 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = daemon/main.c gpn.c mice.c special.c twiddler.c synaptics.c \ - daemon/startup.c daemon/server_tools.c \ - daemon/open_console.c daemon/build_argv.c \ - daemon/gpm.c daemon/gpm-killed.c - - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# cleaning up section - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile $(DEPFILE) - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/gpm.c deleted file mode 100644 index 057b2f6b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/gpm.c +++ /dev/null @@ -1,1081 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/* global variables */ -struct options option; /* one should be enough for us */ - -extern int errno; - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; -int opt_aged = 0; -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; -Gpm_Type *repeated_type=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; -fd_set selSet, readySet, connSet; - -time_t last_selection_time; -time_t opt_age_limit = 0; - -/* BRAINDEAD..ok not really, but got to leave anyway... FIXME */ -/* argc and argv for mice initialization */ -static int mouse_argc[3]; /* 0 for default (unused) and two mice */ -static char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - - -/*********************************************************************** - * Clean global variables - */ -int opt_resize=0; /* not really an option */ - - -/*===================================================================*/ -/* - * first, all the stuff that used to be in gpn.c (i.e., not main-loop) - */ -/*-------------------------------------------------------------------*/ - -/*-------------------------------------------------------------------*/ -static inline int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } - while (kd_mode != KD_TEXT) ; - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open(opt_dev,O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,opt_dev); - if (m_type->init) - m_type=(m_type->init)(*fdptr, m_type->flags, m_type, mouse_argc[1], - mouse_argv[1]); - return (1); -} - -/*-------------------------------------------------------------------*/ -static inline void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - - -/*-------------------------------------------------------------------*/ -/* comment missing; FIXME */ -/*-------------------------------------------------------------------*/ -static inline void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - -/*-------------------------------------------------------------------*/ -static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if (opt_three==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) { - if (m_type->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - - -static int statusX,statusY,statusB; /* to return info */ -static int statusC=0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/*------------------------------------------------------------------- - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - *-------------------------------------------------------------------*/ -static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, - int kd_mode) -{ - char *data; - static int fine_dx, fine_dy; - static int i, j, m; - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - oldT=event->type; - - if (eventFlag) { - eventFlag=0; - - if (m_type->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy=0; - event->wdx=event->wdy=0; - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do { /* cluster loop */ - if(((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) { - if (!i) return 0; - else break; - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB!=newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!(m_type->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!(m_type)->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/opt_scale; event->dy=fine_dy/opt_scaley; - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - if (!event->dx && !event->dy && (event->buttons==oldB)) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"M: %3i %3i (%3i %3i) - butt=%i vc=%i cl=%i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -static int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - -static void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - -/*-------------------------------------------------------------------*/ - /* returns -1 if closing connection */ -static inline int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO,GPM_MESS_CON_REQUEST, ci->fd, vc); - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_INFO,GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i=open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ -static inline int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} - -/*-------------------------------------------------------------------*/ -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - opt_scaley=opt_scale*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,opt_scale,opt_scaley); - } -} - -/*-------------------------------------------------------------------*/ -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!opt_dev) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp(opt_dev,"-")) fd=0; /* use stdin */ - else if( (fd=open(opt_dev,O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,opt_dev); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if (m_type->init) - m_type=(m_type->init)(fd, m_type->flags, m_type, mouse_argc[i], - mouse_argv[i]); - if (!m_type) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/main.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/main.c deleted file mode 100644 index 724e4db8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/server_tools.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/server_tools.c deleted file mode 100644 index d4aaec54..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/server_tools.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/startup.c deleted file mode 100644 index c25d7c79..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/daemon/startup.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002 Nico Schottelius - * - * - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -/* what todo atexit */ -static void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (opt_accel < 1) exit(usage("acceleration")); - if (opt_delta < 2) exit(usage("delta")); - if (strlen(opt_sequence) != 3 || atoi(opt_sequence)<100) - exit(usage("sequence")); - if (opt_glidepoint_tap > 3) exit(usage("glidepoint tap button")); - if (opt_glidepoint_tap) - opt_glidepoint_tap=GPM_B_LEFT >> (opt_glidepoint_tap-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,opt_sequence); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - opt_sequence=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ - -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/drivers/README b/software/gpm/browse_source/gpm-1.20.3pre3/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpn.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/gpn.c deleted file mode 100644 index 2a72ee16..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/gpn.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * gpn.c - support functions for gpm-Linux - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001 Nico Schottelius - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? memcpy() */ -#include /* isdigit */ -#include -#include /* Log uses it */ -#include -#include /* getopt(),symlink() */ -#include /* mkdir() */ -#include -#include /* timeval */ -#include /* wait() */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* __u32 */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#ifndef HAVE___U32 -# ifndef _I386_TYPES_H /* /usr/include/asm/types.h */ -typedef unsigned int __u32; -# endif -#endif - -#include "headers/message.h" -#include "headers/gpmInt.h" -#include "headers/gpm.h" - -#include "headers/daemon.h" - -extern int errno; - -/*===================================================================*/ -/* octal digit */ -static int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - -/* routine to convert digits from octal notation (Andries Brouwer) */ -static int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - -/* description missing! FIXME */ -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static __u32 long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - -/* usage: display for usage informations */ -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse=mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': opt_accel = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': opt_glidepoint_tap=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': opt_time=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - opt_dev = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - opt_scale=atoi(optarg); - if(!opt_scale || opt_scale > 100) opt_scale=100; /* the maximum */ - else opt_scale=100/opt_scale; break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': opt_sample = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - opt_type = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/header.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/daemon.h deleted file mode 100644 index 924d05ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/daemon.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Types - */ - -struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -/************************************************************************* - * Global variables - */ - -extern int opt_resize; /* not really an option */ -extern struct options option; /* one should be enough for us */ - -/************************************************************************* - * Functions - */ - -void gpm_killed(int signo); -int open_console(const int mode); -char **build_argv(char *argv0, char *str, int *argcptr, char sep); - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpm.h deleted file mode 100644 index d88897be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpm.h +++ /dev/null @@ -1,269 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -/* $Id: gpm.h,v 1.5 2002/11/30 13:20:10 nico Exp $ */ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpmInt.h deleted file mode 100644 index 30d71932..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/gpmInt.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001,20022002co Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -/*....................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -/* - * and this is the entry in the mouse-type table - */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - int (*fun)(Gpm_Event *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -} Gpm_Type; - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - - -/*....................................... Global variables */ - -/* this structure is used to hide the dual-mouse stuff */ - -struct mouse_features { - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -extern struct mouse_features mouse_table[3], *which_mouse; /*the current one*/ - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* this is not very clean, actually, but it works fine */ -#define opt_type (which_mouse->opt_type) -#define opt_dev (which_mouse->opt_dev) -#define opt_sequence (which_mouse->opt_sequence) -#define opt_baud (which_mouse->opt_baud) -#define opt_sample (which_mouse->opt_sample) -#define opt_delta (which_mouse->opt_delta) -#define opt_accel (which_mouse->opt_accel) -#define opt_scale (which_mouse->opt_scale) -#define opt_scaley (which_mouse->opt_scaley) -#define opt_time (which_mouse->opt_time) -#define opt_cluster (which_mouse->opt_cluster) -#define opt_three (which_mouse->opt_three) -#define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) -#define opt_options (which_mouse->opt_options) - -#define m_type (which_mouse->m_type) - -/* the other variables */ - -extern char *opt_lut; -extern int opt_test, opt_ptrdrag; -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; -extern char *opt_special; -extern int opt_rawrep; -extern int fifofd; -extern int opt_double; - -extern Gpm_Type *repeated_type; -extern Gpm_Type mice[]; /* where the hell are the descriptions...*/ -extern struct winsize win; -extern int maxx, maxy; -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -/* new variables */ - -/* structure prototypes */ - -/* contains all mice */ -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -/* new variables */ - - -/*....................................... Prototypes */ - /* server_tools.c */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - - /* startup.c */ -void startup(int argc, char **argv); - - /* gpm.c */ -int old_main(); - - /* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/message.h deleted file mode 100644 index 31083cc6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE " (X-Mas), " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/liblow.c deleted file mode 100644 index 1eb05480..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/liblow.c +++ /dev/null @@ -1,662 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - do { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } while(gpm_stack); - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/report-lib.c deleted file mode 100644 index fd9d6080..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/lib/report-lib.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; - } - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/mice.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/mice.c deleted file mode 100644 index 5ae13a1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/mice.c +++ /dev/null @@ -1,2493 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001,2002 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - -#include "headers/daemon.h" - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - buffer[3] = - (state->buttons & GPM_B_UP ? -1 : 0) + - (state->buttons & GPM_B_DOWN ? 1 : 0); - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && opt_glidepoint_tap) // by default this is false - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - /* old code: - - did it signed: - state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; - - and unsigned: - state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; - */ - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= opt_glidepoint_tap; - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < opt_time) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < opt_time) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < opt_time) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, opt_baud, 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, opt_baud, opt_baud, 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;opt_sample<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if(opt_baud==DEF_BAUD) opt_baud = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if (opt_baud == 1200) opt_baud=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if (opt_baud == DEF_BAUD) opt_baud = 19200; /* force 19200 as default */ - if (opt_baud != 9600 && opt_baud != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - opt_baud = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = (opt_baud == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/mouse-test.c deleted file mode 100644 index 2efb5f4d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - opt_baud=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",opt_baud); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - opt_baud=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - opt_baud=BAUD(trial); - printf("\tBaud rate is %i\r\n",opt_baud); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/report.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/report.c deleted file mode 100644 index 80be4141..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/report.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/special.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/special.c deleted file mode 100644 index ecb2d169..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/special.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001 Nico@Schottelius.org (Nico Schottelius) - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/tools.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre3/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.3pre3/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre3/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/.exclude b/software/gpm/browse_source/gpm-1.20.3pre4/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/.gitignore b/software/gpm/browse_source/gpm-1.20.3pre4/.gitignore deleted file mode 100644 index 8bf3b974..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -*.o -*.a -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in -src/gpm2/tmp -src/gpm2/out -.*.swp diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/BUGS b/software/gpm/browse_source/gpm-1.20.3pre4/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/COPYING b/software/gpm/browse_source/gpm-1.20.3pre4/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/Changelog b/software/gpm/browse_source/gpm-1.20.3pre4/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/Changes b/software/gpm/browse_source/gpm-1.20.3pre4/Changes deleted file mode 100644 index 1cc65649..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/Changes +++ /dev/null @@ -1,35 +0,0 @@ -* From 1.20.1 to 1.20.3: - o many cleanups - o etouch support -* From 1.20.1 to 1.20.2: -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/MANIFEST b/software/gpm/browse_source/gpm-1.20.3pre4/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre4/Makefile.in deleted file mode 100644 index c89e6051..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/Makefile.in +++ /dev/null @@ -1,123 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf configure autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.3pre4/Makefile.include.in deleted file mode 100644 index fab5ac79..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/Makefile.include.in +++ /dev/null @@ -1,68 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/README b/software/gpm/browse_source/gpm-1.20.3pre4/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/README.gpm2 b/software/gpm/browse_source/gpm-1.20.3pre4/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/README.versions b/software/gpm/browse_source/gpm-1.20.3pre4/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/TODO b/software/gpm/browse_source/gpm-1.20.3pre4/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/acconfig.h b/software/gpm/browse_source/gpm-1.20.3pre4/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/aclocal.m4 b/software/gpm/browse_source/gpm-1.20.3pre4/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.20.3pre4/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/build-from-git.sh b/software/gpm/browse_source/gpm-1.20.3pre4/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/configure.in b/software/gpm/browse_source/gpm-1.20.3pre4/configure.in deleted file mode 100644 index 53bd3344..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.20.3pre4 -release_date="A calm night, 13. March 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/other/README b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/Announce b/software/gpm/browse_source/gpm-1.20.3pre4/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/FAQ b/software/gpm/browse_source/gpm-1.20.3pre4/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.3pre4/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre4/doc/Makefile.in deleted file mode 100644 index d8b95c65..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/Makefile.in +++ /dev/null @@ -1,180 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.3pre4/doc/doc.gpm.in deleted file mode 100644 index bc800fa1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001,2002 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001,2002 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/infofilter b/software/gpm/browse_source/gpm-1.20.3pre4/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/manpager b/software/gpm/browse_source/gpm-1.20.3pre4/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/mktxt b/software/gpm/browse_source/gpm-1.20.3pre4/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/README b/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.4 deleted file mode 100644 index 7191a2eb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.3 deleted file mode 100644 index 655965cc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.3 +++ /dev/null @@ -1,4 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.4 deleted file mode 100644 index 16a89d5c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- cleanup autoconf stuff diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.7 deleted file mode 100644 index c7e2e926..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.7 +++ /dev/null @@ -1 +0,0 @@ -- first vertical prototype: have on mouse input running diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/install-sh b/software/gpm/browse_source/gpm-1.20.3pre4/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/scripts/build-tar.sh b/software/gpm/browse_source/gpm-1.20.3pre4/scripts/build-tar.sh deleted file mode 100644 index d4d83626..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/scripts/build-tar.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -version=$1 - -[ "$version" ] || exit 3 - -git archive --format=tar --prefix=gpm-${version}/ HEAD | \ - tee ../gpm-${version}.tar | bzip2 -9 > ../gpm-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.3pre4/scripts/gpm.release deleted file mode 100644 index fbf03ef4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/scripts/gpm.release +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre4/src/Makefile.in deleted file mode 100644 index c5f7901b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/Makefile.in +++ /dev/null @@ -1,174 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/header.c daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# cleaning up section - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile $(DEPFILE) - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/cmdline.c deleted file mode 100644 index 14096b0f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm.c deleted file mode 100644 index 33a1b20a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/header.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/main.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/main.c deleted file mode 100644 index 724e4db8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processconn.c deleted file mode 100644 index 5212c0cd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processmouse.c deleted file mode 100644 index 13ef144c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processmouse.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -#define abs(value) ((value) < 0 ? -(value) : (value)) - -/*------------------------------------------------------------------- - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - *-------------------------------------------------------------------*/ -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, fine_dy; - static int i, j, m; - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - oldT=event->type; - - if (eventFlag) { - eventFlag=0; - - if ((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy=0; - event->wdx=event->wdy=0; - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do { /* cluster loop */ - if(((data=getMouseData(fd,(which_mouse->m_type),kd_mode))==NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - if (!i) return 0; - else break; - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB!=newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - if (!event->dx && !event->dy && (event->buttons==oldB)) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"M: %3i %3i (%3i %3i) - butt=%i vc=%i cl=%i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processrequest.c deleted file mode 100644 index 71e1140a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/startup.c deleted file mode 100644 index 166dab1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/startup.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/drivers/README b/software/gpm/browse_source/gpm-1.20.3pre4/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/generic/getsym.c deleted file mode 100644 index b8f5bfcd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/generic/getsym.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/daemon.h deleted file mode 100644 index a24b9ede..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/daemon.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpm.h deleted file mode 100644 index f4c0c2f4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpm.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/message.h deleted file mode 100644 index 31083cc6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE " (X-Mas), " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/liblow.c deleted file mode 100644 index 28236cf1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/liblow.c +++ /dev/null @@ -1,660 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/report-lib.c deleted file mode 100644 index 812fdb8e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/lib/report-lib.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/mice.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/mice.c deleted file mode 100644 index 4bbc7baa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/mice.c +++ /dev/null @@ -1,2503 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - buffer[3] = - (state->buttons & GPM_B_UP ? -1 : 0) + - (state->buttons & GPM_B_DOWN ? 1 : 0); - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - /* old code: - - did it signed: - state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; - - and unsigned: - state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; - */ - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/report.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/synaptics.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/synaptics.c deleted file mode 100644 index 54d4aa3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/synaptics.c +++ /dev/null @@ -1,3305 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/tools.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre4/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.3pre4/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre4/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/.exclude b/software/gpm/browse_source/gpm-1.20.3pre5/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/.gitignore b/software/gpm/browse_source/gpm-1.20.3pre5/.gitignore deleted file mode 100644 index 8bf3b974..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -*.o -*.a -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in -src/gpm2/tmp -src/gpm2/out -.*.swp diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/BUGS b/software/gpm/browse_source/gpm-1.20.3pre5/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/COPYING b/software/gpm/browse_source/gpm-1.20.3pre5/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/Changelog b/software/gpm/browse_source/gpm-1.20.3pre5/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/Changes b/software/gpm/browse_source/gpm-1.20.3pre5/Changes deleted file mode 100644 index 5011f919..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/Changes +++ /dev/null @@ -1,51 +0,0 @@ -* From 1.20.1 to 1.20.3: - o Applied many cleanups - o Added etouch support - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/MANIFEST b/software/gpm/browse_source/gpm-1.20.3pre5/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre5/Makefile.in deleted file mode 100644 index c89e6051..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/Makefile.in +++ /dev/null @@ -1,123 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf configure autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.3pre5/Makefile.include.in deleted file mode 100644 index fab5ac79..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/Makefile.include.in +++ /dev/null @@ -1,68 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/README b/software/gpm/browse_source/gpm-1.20.3pre5/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/README.gpm2 b/software/gpm/browse_source/gpm-1.20.3pre5/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/README.versions b/software/gpm/browse_source/gpm-1.20.3pre5/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/TODO b/software/gpm/browse_source/gpm-1.20.3pre5/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/acconfig.h b/software/gpm/browse_source/gpm-1.20.3pre5/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/aclocal.m4 b/software/gpm/browse_source/gpm-1.20.3pre5/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.20.3pre5/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/build-from-git.sh b/software/gpm/browse_source/gpm-1.20.3pre5/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/configure.in b/software/gpm/browse_source/gpm-1.20.3pre5/configure.in deleted file mode 100644 index 03bdb53d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.20.3pre5 -release_date="A cold, but sunny saturday, 22. March 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/other/README b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/Announce b/software/gpm/browse_source/gpm-1.20.3pre5/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/FAQ b/software/gpm/browse_source/gpm-1.20.3pre5/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.3pre5/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre5/doc/Makefile.in deleted file mode 100644 index d8b95c65..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/Makefile.in +++ /dev/null @@ -1,180 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.3pre5/doc/doc.gpm.in deleted file mode 100644 index bc800fa1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001,2002 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001,2002 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/infofilter b/software/gpm/browse_source/gpm-1.20.3pre5/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/manpager b/software/gpm/browse_source/gpm-1.20.3pre5/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/mktxt b/software/gpm/browse_source/gpm-1.20.3pre5/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.20.3pre5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.20.3pre5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/README b/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.4 deleted file mode 100644 index 7191a2eb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.3 deleted file mode 100644 index 655965cc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.3 +++ /dev/null @@ -1,4 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.4 deleted file mode 100644 index 16a89d5c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- cleanup autoconf stuff diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.7 deleted file mode 100644 index c7e2e926..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.7 +++ /dev/null @@ -1 +0,0 @@ -- first vertical prototype: have on mouse input running diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/install-sh b/software/gpm/browse_source/gpm-1.20.3pre5/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.20.3pre5/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.3pre5/scripts/gpm.release deleted file mode 100644 index fbf03ef4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/scripts/gpm.release +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre5/src/Makefile.in deleted file mode 100644 index c5f7901b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/Makefile.in +++ /dev/null @@ -1,174 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/header.c daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# cleaning up section - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile $(DEPFILE) - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/cmdline.c deleted file mode 100644 index 66c8ecc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm.c deleted file mode 100644 index 33a1b20a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/header.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/main.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/main.c deleted file mode 100644 index 724e4db8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processconn.c deleted file mode 100644 index 5212c0cd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processmouse.c deleted file mode 100644 index b3f3994e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processmouse.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processrequest.c deleted file mode 100644 index 71e1140a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/startup.c deleted file mode 100644 index 166dab1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/startup.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/drivers/README b/software/gpm/browse_source/gpm-1.20.3pre5/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/generic/getsym.c deleted file mode 100644 index b8f5bfcd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/generic/getsym.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/daemon.h deleted file mode 100644 index a8936ad4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/daemon.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/message.h deleted file mode 100644 index 31083cc6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE " (X-Mas), " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/liblow.c deleted file mode 100644 index 25a1d5c4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/liblow.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/report-lib.c deleted file mode 100644 index 812fdb8e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/lib/report-lib.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/mice.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/mice.c deleted file mode 100644 index f62dca0a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/mice.c +++ /dev/null @@ -1,2509 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/report.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/synaptics.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/synaptics.c deleted file mode 100644 index 54d4aa3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/synaptics.c +++ /dev/null @@ -1,3305 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/tools.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre5/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.3pre5/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre5/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/BUGS b/software/gpm/browse_source/gpm-1.20.3pre6/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/COPYING b/software/gpm/browse_source/gpm-1.20.3pre6/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/Changes b/software/gpm/browse_source/gpm-1.20.3pre6/Changes deleted file mode 100644 index 046eb9ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/Changes +++ /dev/null @@ -1,57 +0,0 @@ -* From 1.20.1 to 1.20.3: - o Applied many cleanups - o Added etouch support - - pre6: - Cleaned up "make dist" target - Added two debbugging programs: - src/prog/display-buttons.c: display pressed buttons - src/prog/display-coords.c: display mouse coordinates - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/MANIFEST b/software/gpm/browse_source/gpm-1.20.3pre6/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre6/Makefile.in deleted file mode 100644 index 2e6dad9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/Makefile.in +++ /dev/null @@ -1,138 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -### RELEASE STUFF -TARS =../gpm-$(release).tar.gz -TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=$(D_BASE)/archives/ -D_SOURCE=$(D_BASE)/browse_source/ - - -# configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -../gpm-$(release).tar: $(srcdir) - # no exclude possible of .git with pax it seems - #pax -w -x ustar -s '/^\./gpm-$(release)/' -w . -f $@ - pax -w -x ustar -s ';^;gpm-$(release)/;' -f $@ -w * - -../gpm-$(release).tar.gz: ../gpm-$(release).tar - gzip -9 -c $^ > $@ - -../gpm-$(release).tar.bz2: ../gpm-$(release).tar - bzip2 -9 -c $^ > $@ - -../gpm-$(release).tar.lzma: ../gpm-$(release).tar - lzma -9 -c $^ > $@ - -# 3. Put package together into .tar.gz and .tar.bz2 -#dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz -dist: disttest distclean distconf $(TARS) - chmod 0644 $(TARS) - scp $(TARS) $(D_HOST):$(D_DIR) - ssh "$(D_HOST)" "tar xvfz $(D_DIR)/gpm-$(release).tar.gz -C $(D_SOURCE)" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type f -exec chmod 0644 {} \\;" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type d -exec chmod 0755 {} \\;" - - -# create / update configure, delete other parts from earlier build -disttest: distconf clean - ./configure - make all - -### CLEANUP -distclean: clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -allclean: do-allclean distclean - rm -f configure diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.3pre6/Makefile.include.in deleted file mode 100644 index d07fdc03..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/Makefile.include.in +++ /dev/null @@ -1,67 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/README b/software/gpm/browse_source/gpm-1.20.3pre6/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/README.gpm2 b/software/gpm/browse_source/gpm-1.20.3pre6/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/README.versions b/software/gpm/browse_source/gpm-1.20.3pre6/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/TODO b/software/gpm/browse_source/gpm-1.20.3pre6/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/acconfig.h b/software/gpm/browse_source/gpm-1.20.3pre6/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/aclocal.m4 b/software/gpm/browse_source/gpm-1.20.3pre6/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.20.3pre6/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/build-from-git.sh b/software/gpm/browse_source/gpm-1.20.3pre6/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/configure b/software/gpm/browse_source/gpm-1.20.3pre6/configure deleted file mode 100644 index 77a183e8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/configure +++ /dev/null @@ -1,6099 +0,0 @@ -#! /bin/sh -# From configure.in configure.in. -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="src/daemon/main.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -RANLIB -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -YACC -YFLAGS -LN_S -DVIPS -TEXI2HTML -TEX -TEXINDEX -MAKEINFO -DIFF -SED -emacs -CPP -GREP -EGREP -ALLOCA -GPMXTERM -release -release_date -abi_lev -abi_full -EMACS -ELISP -SHLIB -PICFLAGS -SOLDFLAGS -CURSES_OBJS -SHARED_LIBS -lispdir -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -YACC -YFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-curses disable curses support even if curses found - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - YACC The `Yet Another C Compiler' implementation to use. Defaults to - the first program found out of: `bison -y', `byacc', `yacc'. - YFLAGS The list of arguments that will be passed by default to $YACC. - This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_config_headers="$ac_config_headers src/headers/config.h" - - -release=1.20.3pre6 -release_date="6th of April 2008" -cat >>confdefs.h <<_ACEOF -#define GPM_RELEASE "$release" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define GPM_RELEASE_DATE "$release_date" -_ACEOF - - -abi=21 -abi_age=20 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -for ac_prog in 'bison -y' byacc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_YACC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_YACC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" - -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } -fi - - -# check for programs. -# Extract the first word of "dvips", so it can be a program name with args. -set dummy dvips; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DVIPS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_DVIPS="$DVIPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DVIPS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DVIPS" && ac_cv_path_DVIPS="no" - ;; -esac -fi -DVIPS=$ac_cv_path_DVIPS -if test -n "$DVIPS"; then - { echo "$as_me:$LINENO: result: $DVIPS" >&5 -echo "${ECHO_T}$DVIPS" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "texi2html", so it can be a program name with args. -set dummy texi2html; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEXI2HTML+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEXI2HTML in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEXI2HTML="$TEXI2HTML" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEXI2HTML="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEXI2HTML" && ac_cv_path_TEXI2HTML="no" - ;; -esac -fi -TEXI2HTML=$ac_cv_path_TEXI2HTML -if test -n "$TEXI2HTML"; then - { echo "$as_me:$LINENO: result: $TEXI2HTML" >&5 -echo "${ECHO_T}$TEXI2HTML" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "tex", so it can be a program name with args. -set dummy tex; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEX="$TEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEX" && ac_cv_path_TEX="no" - ;; -esac -fi -TEX=$ac_cv_path_TEX -if test -n "$TEX"; then - { echo "$as_me:$LINENO: result: $TEX" >&5 -echo "${ECHO_T}$TEX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "texindex", so it can be a program name with args. -set dummy texindex; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEXINDEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEXINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEXINDEX="$TEXINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEXINDEX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEXINDEX" && ac_cv_path_TEXINDEX="no" - ;; -esac -fi -TEXINDEX=$ac_cv_path_TEXINDEX -if test -n "$TEXINDEX"; then - { echo "$as_me:$LINENO: result: $TEXINDEX" >&5 -echo "${ECHO_T}$TEXINDEX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "makeinfo", so it can be a program name with args. -set dummy makeinfo; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_MAKEINFO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAKEINFO in - [\\/]* | ?:[\\/]*) - ac_cv_path_MAKEINFO="$MAKEINFO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_MAKEINFO="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MAKEINFO" && ac_cv_path_MAKEINFO="no" - ;; -esac -fi -MAKEINFO=$ac_cv_path_MAKEINFO -if test -n "$MAKEINFO"; then - { echo "$as_me:$LINENO: result: $MAKEINFO" >&5 -echo "${ECHO_T}$MAKEINFO" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "diff", so it can be a program name with args. -set dummy diff; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DIFF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DIFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DIFF" && ac_cv_path_DIFF="no" - ;; -esac -fi -DIFF=$ac_cv_path_DIFF -if test -n "$DIFF"; then - { echo "$as_me:$LINENO: result: $DIFF" >&5 -echo "${ECHO_T}$DIFF" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "sed", so it can be a program name with args. -set dummy sed; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $SED in - [\\/]* | ?:[\\/]*) - ac_cv_path_SED="$SED" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_SED" && ac_cv_path_SED="no" - ;; -esac -fi -SED=$ac_cv_path_SED -if test -n "$SED"; then - { echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "emacs", so it can be a program name with args. -set dummy emacs; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_emacs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $emacs in - [\\/]* | ?:[\\/]*) - ac_cv_path_emacs="$emacs" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_emacs="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_emacs" && ac_cv_path_emacs="no" - ;; -esac -fi -emacs=$ac_cv_path_emacs -if test -n "$emacs"; then - { echo "$as_me:$LINENO: result: $emacs" >&5 -echo "${ECHO_T}$emacs" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - { echo "$as_me:$LINENO: checking where to install Emacs Lisp files" >&5 -echo $ECHO_N "checking where to install Emacs Lisp files... $ECHO_C" >&6; } -if test "${itz_cv_path_site_lisp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac -fi -{ echo "$as_me:$LINENO: result: $itz_cv_path_site_lisp" >&5 -echo "${ECHO_T}$itz_cv_path_site_lisp" >&6; } - - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - -for ac_header in syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -# Check whether --with-curses was given. -if test "${with_curses+set}" = set; then - withval=$with_curses; -fi - - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - - - - -for ac_header in sys/sysmacros.h linux/major.h linux/tty.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ echo "$as_me:$LINENO: checking for __u32" >&5 -echo $ECHO_N "checking for __u32... $ECHO_C" >&6; } -if test "${itz_cv_type___u32+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include - -int -main () -{ - -__u32 dummy; -return 0; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - itz_cv_type___u32=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - itz_cv_type___u32=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $itz_cv_type___u32" >&5 -echo "${ECHO_T}$itz_cv_type___u32" >&6; } - -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - cat >>confdefs.h <<\_ACEOF -#define HAVE___U32 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking whether system is ELF" >&5 -echo $ECHO_N "checking whether system is ELF... $ECHO_C" >&6; } -if test "${itz_cv_sys_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __ELF__ -win -#else -lose -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "win" >/dev/null 2>&1; then - itz_cv_sys_elf=yes -else - itz_cv_sys_elf=no -fi -rm -f conftest* - -fi -{ echo "$as_me:$LINENO: result: $itz_cv_sys_elf" >&5 -echo "${ECHO_T}$itz_cv_sys_elf" >&6; } -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_c_compiler_gnu} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi - -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_c_compiler_gnu} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - - - -for ac_func in vsyslog syslog -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - if (p) return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_working_alloca_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_working_alloca_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } -if test $ac_cv_working_alloca_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - if (p) return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_alloca_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_alloca_works=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=\${LIBOBJDIR}alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -int -main () -{ - return find_stack_direction () < 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } - -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF - - -fi - - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - -as_ac_Lib=`echo "ac_cv_lib_$i''_tputs" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for tputs in -l$i" >&5 -echo $ECHO_N "checking for tputs in -l$i... $ECHO_C" >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$i $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tputs (); -int -main () -{ -return tputs (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_Lib=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -ac_res=`eval echo '${'$as_ac_Lib'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Lib'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_LIB$i" | $as_tr_cpp` 1 -_ACEOF - - LIBS="-l$i $LIBS" - -fi - - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - -as_ac_Lib=`echo "ac_cv_lib_$i''_wgetch" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for wgetch in -l$i" >&5 -echo $ECHO_N "checking for wgetch in -l$i... $ECHO_C" >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$i $TERMLIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char wgetch (); -int -main () -{ -return wgetch (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_Lib=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -ac_res=`eval echo '${'$as_ac_Lib'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Lib'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_LIB$i" | $as_tr_cpp` 1 -_ACEOF - - LIBS="-l$i $LIBS" - -fi - - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= - - - - - - - - - - - - - - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -ac_config_files="$ac_config_files Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "src/headers/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/headers/config.h" ;; - "Makefile.include") CONFIG_FILES="$CONFIG_FILES Makefile.include" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; - "doc/doc.gpm") CONFIG_FILES="$CONFIG_FILES doc/doc.gpm" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -RANLIB!$RANLIB$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -YACC!$YACC$ac_delim -YFLAGS!$YFLAGS$ac_delim -LN_S!$LN_S$ac_delim -DVIPS!$DVIPS$ac_delim -TEXI2HTML!$TEXI2HTML$ac_delim -TEX!$TEX$ac_delim -TEXINDEX!$TEXINDEX$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -DIFF!$DIFF$ac_delim -SED!$SED$ac_delim -emacs!$emacs$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -ALLOCA!$ALLOCA$ac_delim -GPMXTERM!$GPMXTERM$ac_delim -release!$release$ac_delim -release_date!$release_date$ac_delim -abi_lev!$abi_lev$ac_delim -abi_full!$abi_full$ac_delim -EMACS!$EMACS$ac_delim -ELISP!$ELISP$ac_delim -SHLIB!$SHLIB$ac_delim -PICFLAGS!$PICFLAGS$ac_delim -SOLDFLAGS!$SOLDFLAGS$ac_delim -CURSES_OBJS!$CURSES_OBJS$ac_delim -SHARED_LIBS!$SHARED_LIBS$ac_delim -lispdir!$lispdir$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" - ;; - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/configure.in b/software/gpm/browse_source/gpm-1.20.3pre6/configure.in deleted file mode 100644 index 78fabe35..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.20.3pre6 -release_date="6th of April 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=21 -abi_age=20 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/Makefile b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/Makefile deleted file mode 100644 index 757ae02d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = /home/user/nico/projekte/gpm/gpm/contrib -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/other/README b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/Announce b/software/gpm/browse_source/gpm-1.20.3pre6/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/FAQ b/software/gpm/browse_source/gpm-1.20.3pre6/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.3pre6/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre6/doc/Makefile.in deleted file mode 100644 index 4667fc2e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/Makefile.in +++ /dev/null @@ -1,189 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -## CLEANUP section -# normal cleanup -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# for creating distribution -distclean: clean - rm -f Makefile doc.gpm - -# to even remove things we leave for end-users -allclean: distclean - rm -f gpm.info - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -## DIST section -# when we cleaned it, we can securely copy us. -dist: distclean - # unneeded now: using pax + -s option and create tars in .. - #$(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.3pre6/doc/doc.gpm.in deleted file mode 100644 index 94cb300b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/doc.gpm.in +++ /dev/null @@ -1,2295 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001-2008 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001-2008 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for me to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/gpm.info b/software/gpm/browse_source/gpm-1.20.3pre6/doc/gpm.info deleted file mode 100644 index 6a1633b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/gpm.info +++ /dev/null @@ -1,1922 +0,0 @@ -This is /home/user/nico/projekte/gpm/gpm/doc/gpm.info, produced by makeinfo version 4.11 from /home/user/nico/projekte/gpm/gpm/doc/gpm.texinfo. - -INFO-DIR-SECTION Miscellaneous -START-INFO-DIR-ENTRY -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -END-INFO-DIR-ENTRY - - This file is a user's and programmer's manual for gpm 1.20.3pre6. - - Copyright (C) 1994,1995,1998 Alessandro Rubini Copyright (C) -2001-2008 Nico Schottelius - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - This file documents the 1.20.3pre6 release of the "General Purpose -Mouse" (gpm) server for the Linux text console (6th of April 2008). - - -File: gpm.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - -gpm -*** - -* Menu: - -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: - - -File: gpm.info, Node: Overview, Next: Server Invocation, Prev: Top, Up: Top - -1 Overview -********** - -The "gpm" package is a mouse server for the Linux console. It is meant -to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -`gpm' come from the `selection-1.5' package, by Andrew Haylett. - - The first application to support the mouse has been The Midnight -Commander, by Miguel de Icaza. `mc-0.11' and later releases offer -mouse support if you have the mouse server running on your system. The -file `t-mouse.el' provides support for using the mouse from within -Emacs. *Note Emacs Support::. - - As of release 0.96, a default-handler is released with gpm, and can -be used to handle Control-Mouse events to draw menus on the screen. -The `gpm-root' program, however, needs kernel 1.1.73 or newer. *Note -gpm-root::. - - Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as `kmouse-?.??.tar.gz' from the mirrors of -`ftp://tsx-11.mit.edu'. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - - As of release 1.20.0 the default device is removed. Now -m is a must. - - Release 1.20.1 introduces the must for -t and a specific way to use --m,-t,-o: Now you've got to use -m first, then -t and at last -o. This -seems to be more complex, but makes using of multiply mice possible with -clean code. - -* Menu: - -* Building the Release:: - - -File: gpm.info, Node: Building the Release, Prev: Overview, Up: Overview - -1.1 Compiling and Installing -============================ - -Just say `./configure && make && make install' to your shell. You'll -need gpm installed to compile the latest release of The Midnight -Commander with mouse support enabled. - - Binaries are not released with the package because it's safer for -you to compile the package by yourself. - - -File: gpm.info, Node: Server Invocation, Next: Gpm Internals, Prev: Overview, Up: Top - -2 Server Invocation -******************* - -The `gpm' executable is meant to act like a daemon (thus, `gpmd' would -be a better name for it). This section is meant to describe the -command-line options for `gpm', while its internals are outlined in the -next section. *Note Gpm Internals::. - - Due to restrictions in the `ioctl(TIOCLINUX)' system call, `gpm' must -be run by the superuser. The restrictions have been added in the last -1.1 kernels to fix a security hole related to selection and screen -dumping. - - The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's attitude. From -release 1.02 up to 1.19.2 is was possible for any user logged on the -system console to change the mouse _feeling_ using the -q option. This -is no longer possible for security reasons. - - As of 0.97 the server program puts itself in the background. To kill -`gpm' you can just reinvoke it with the `-k' cmdline switch, although -`killall gpm' can be a better choice. - -* Menu: - -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: - - -File: gpm.info, Node: Special Commands, Next: Command Line, Prev: Server Invocation, Up: Server Invocation - -2.1 Special Commands -==================== - -Version 1.10 adds the capability to execute _special_ commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - - Special commands are toggled by triple-clicking the left and right -button - an unlikely event during normal mouse usage. The easiest way -to triple-click is pressing one of the buttons and triple-click the -other one. When special processing is toggled, a message appears on the -console (and the speaker beeps twice, if you have a speaker); if the -user releases all the buttons and presses one of them again within -three seconds, then the special command corresponding to the button is -executed. - - The default special commands are: - -LEFT BUTTON - Reboot the system by signalling the init process - -MIDDLE BUTTON (IF ANY) - Execute `/sbin/shutdown -h now' - -RIGHT BUTTON - Execute `/sbin/shutdown -r now' - - The `-S' command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use `-S ""' (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - - As an example, `-S ":telinit 1:/sbin/halt"', associates killing init -to the left button, going single user to the middle one, and halting -the system to the right button. - - System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - - -File: gpm.info, Node: Command Line, Next: Bugs and Problems, Prev: Special Commands, Up: Server Invocation - -2.2 Command Line Options -======================== - -Available command line options are the following: - -`-a ACCEL' - Set the acceleration value used when a single motion event is - longer than DELTA (see `-d'). - -`-A[LIMIT]' - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer (`rm -rf /') - including the terminating line break, then all the victim has to - do is click the middle mouse button .. As of version 1.17.2, this - has developed into a more general aging mechanism; the gpm daemon - can disable (_age_) selection pasting automatically after a period - of inactivity. To enable this mode just give the optional LIMIT - parameter (no space in between !) which is interpreted as the - time in seconds for which a selection is considered valid and - pastable. As of version 1.15.7, a trivial program called - `disable-paste' is provided. The following makes a good addition - to `/etc/profile' if you allow multiple users to work on your - console. - - `case $( /usr/bin/tty ) in - /dev/tty[0-9]*) /usr/bin/disable-paste ;; - esac' - -`-b BAUD' - Set the baud rate. - -`-B SEQUENCE' - Set the button sequence. `123' is the normal sequence, `321' can - be used by left-handed people, and `132' can be useful with - two-button mice (especially within Emacs). All the button - permutations are allowable. - -`-d DELTA' - Set the delta value. When a single motion event is longer than - DELTA, ACCEL is used as a multiplying factor. (Must be 2 or above) - -`-D' - Do not automatically enter background operation when started, and - log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases it - was done with a compile-time option. - -`-g NUMBER' - With glidepoint devices, emulate the specified button with tapping. - NUMBER must be `1', `2', or `3', and refers to the button number - _before_ the `-B' button remapping is performed. This option - applies to the mman and ps2 decoding. No button is emulated by - default because the ps2 tapping is incompatible with some normal - ps2 mice - -`-h' - Print a summary of command line options. - -`-i INTERVAL' - Set INTERVAL to be used as an upper time limit for multiple - clicks. If the interval between button-up and button-down events - is less than LIMIT, the press is considered a double or triple - click. Time is in milliseconds. - -`-k' - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use `-R' or the single-open - limitation is removed from the kernel). - -`-l CHARSET' - Choose the `inword()' look up table. The CHARSET argument is a - list of characters. `-' is used to specify a range and `\ ' is - used to escape the next character or to provide octal codes. Only - visible character can appear in CHARSET because control characters - can't appear in text-mode video memory, whence selection is cut. - -`-m FILENAME' - Choose the mouse file to open. Must be before -t and -o. - -`-M' - Enable multiple mode. The daemon will read two different mouse - devices. Any subsequent option will refer to the second device, - while any preceding option will be used for the first device. This - option automatically forces the _repeater_ (`-R') option on. - -`-o LIST-OF-EXTRA-OPTIONS' - The option works similary to the "-o" option of mount; it is used - to specify a list of "extra options" that are specific to each - mouse type. The list is comma-separated. The options `dtr', `rts' - or `both' are used by the serial initialization to toggle the - modem lines like, compatibly with earlier gpm versions; note - however that using -o dtr associated with non-plain-serial mouse - types may now generate an error. *Note Mouse Types::. And by the - way, use -o after -m and after -t. - -`-p' - Forces the pointer to be visible while selecting. This is the - behaviour of `selection-1.7', but it is sometimes confusing. The - default is not to show the pointer, which can be confusing as well. - -`-r NUMBER' - Set the responsiveness. A higher responsiveness is used for a - faster cursor motion. - -`-R[NAME]' - Causes `gpm' to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo `/dev/gpmdata' in - protocol NAME, given as an optional argument (no space in between - !). In principle, you can use the same names as for the `-t' - option, although repeating into some protocols may not be - implemented for a while. *Note Mouse Types::. In addition, you - can specify `raw' as the NAME, to repeat the mouse data byte by - byte, without any protocol translation. If NAME is omitted, it - defaults to `msc'. Using gpm in repeater mode, you can configure - the X server to use its fifo as a mouse device. This option is - useful for bus-mouse owners to override the single-open - limitation. It is also an easy way to manage those stupid - dual-mode mice which force you to keep the middle button down - while changing video mode. The option is forced on by the `-M' - option. - -`-s NUMBER' - Set the sample rate for the mouse device. - -`-S COMMANDS' - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -`-t NAME' - Set the mouse type. Use `-t help' to get a list of allowable - types. Since version 1.18.1, the list also shows which protocols - are available as repeaters (see -R above), by marking them with an - asterisk ("*"). *Note Mouse Types::. Use -t after you selected - the mouse device with -m. - -`-v' - Print version information and exit. - -`-2' - Force two buttons. This means that the middle button, if any, will - be taken as it was the right one. - -`-3' - Force three buttons. By default the mouse is considered to be a - 2-buttons one, until the middle button is pressed. If three - buttons are there, the right one is used to extend the selection, - and the middle one is used to paste it. Beware: if you use the - `-3' option with a 2-buttons mouse, you won't be able to paste the - selection. - - -* Menu: - -* Bugs and Problems:: - - -File: gpm.info, Node: Bugs and Problems, Next: Mouse Types, Prev: Command Line, Up: Server Invocation - -2.3 Bugs and Problems -===================== - -The `gpm' server may have problems interacting with X: if your mouse is -a single-open device (i.e. a bus mouse), you should kill `gpm' before -starting X, or use the `-R' option (see above). To kill `gpm' just -invoke `gpm -k'. This problem doesn't apply to serial mice. - - Two instances of gpm can't run on the same system. If you have two -mice use the `-M' option (see above). - - While the current console is in graphic mode, `gpm' sleeps until -text mode is back (unless `-R' is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur out -in hidden consoles. - - The clients shipped out with gpm are not updated, thus there are -potential security risks when using them. - - -File: gpm.info, Node: Mouse Types, Prev: Bugs and Problems, Up: Server Invocation - -2.4 Mouse Types -=============== - -This section of the gpm documentation manual describes the various -pointer types currently available in gpm. If you look at the source -code, you'll find that pointer-specific code is confined to `mice.c' -(while it used to only include mouse decoders, gpm now supports tablets -and touchscreens as well). - - The mouse type is specified on command line with the `-t' option. -The option takes an argument, which represents the name of a mouse -type. Each type can be associated to different names. For old mouse -types, one name is the old selection-compatible name, and another is -the XFree name. After version 1.18.1 of gpm, the number of synonyms was -made arbitrary and the actual name being used is made available to the -function responsible for mouse initialization. Therefore it is possible -for a mouse decoder to behave slightly differently according to the -name being used for the device (if this feature was already present, we -wouldn't have for example ms+ and ms+lr as different mouse types). - - The initialization procedure of each mouse type can also receive -extra option, by means of the -o command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option string -is unused for that mouse type and specifying one generates an error. -When the document refer to "standard serial options" it means that one -of -o dtr, -o rts, -o both can be specified to toggle the control lines -of the serial port. - - The following mouse type are corrently recognized: - -`bare Microsoft' - The Microsoft protocol, without any extension. It only reports two - buttons. If your device has three, you should either try running - the mman decoder or msc. In the latter case, you need to tell the - mouse to talk msc protocol by toggling the DTR and RTS lines (with - one of -o drt, -o rts or -o both) or invoking `gpm -t msc' while - keeping the middle button pressed. Very annoying, indeed. This - mouse decoder accepts standard serial options, although they - should not be needed. - -`ms' - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious packets - which can be misunderstood as middle-button events. If this is - your case, use the `bare' mouse type. Some new two-button devices - are "plug and play", and they don't play fair at all; in this case - try -t pnp. Many (most) three-button devices that use the - microsoft protocol fail to report some middle-button events during - mouse motion. Since the protocol does not distinguish between the - middle button going up and the middle button going down it would - be liable to get out of step, so this decoder declares the middle - button to be up whenever the mouse moves. This prevents dragging - with the middle button, so you should probably use `-t ms+lr' - instead of this decoder, especially if you want to use X. This - mouse decoder accepts standard serial options, although they - should not be needed. - -`ms+' - This is the same as `-t ms' except that the middle button is not - reset during mouse motion. So you can drag with the middle button. - However, if your mouse exhibits the usual buggy behaviour the - decoder is likely to get out of step with reality, thinking the - middle button is up when it's down and vice versa. You should - probably use `-t ms+lr' instead of this decoder. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`ms+lr' - This is the same as `-t ms+' except that there is an additional - facility to reset the state of the middle button by pressing the - other two buttons together. Do this when the decoder gets into a - confused state where it thinks the middle button is up when it's - down and vice versa. (If you get sick of having to do this, please - don't blame gpm; blame your buggy mouse! Note that most - three-button mice that do the microsoft protocol can be made to do - the MouseSystems protocol instead. The "3 Button Serial Mouse - mini-HOWTO" has information about this.) This mouse decoder - accepts standard serial options, although they should not be - needed. - -`msc MouseSystems' - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try -t msc associated - with -o rts, -o dtr or -o both. - -`mman Mouseman' - The protocol used by the new Logitech devices with three buttons. - It is backward compatible with the Microsoft protocol, so if your - mouse has three buttons and works with -t ms or similar decoders - you may try -t mman instead to use the middle button. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`sun' - The protocol used on Sparc computers and a few others. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`mm MMSeries' - Title says it all. This mouse decoder accepts standard serial - options, although they should not be needed. - -`logi Logitech' - This is the protocol used by old serial Logitech mice. - -`bm BusMouse' - Some bus devices use this protocol, including those produced by - Logitech. - -`ps2 PS/2' - The protocol used by most busmice. - -`ncr' - This `type' is able to decode the pointing pen found on some - laptops (the NCR 3125 pen) - -`wacom' - The protocol used by the Wacom tablet. Since version 1.18.1 we - have a new Wacom decoder, as the old one was not working with new - tablets. This decoder was tested with Ultrapad, PenPartner, and - Graphire tablets. Options: -o relative (default) for relative - mode, -o absolute for absolute mode. - -`genitizer' - The \"Genitizer\" tablet, in relative mode. This mouse decoder - accepts standard serial options, although they should not be - needed. - -`logim' - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -`pnp' - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is hardwired - at 1200 baud and is upset by normal initialization, so this is a - -t bare decoder with no initialization at all. This mouse decoder - accepts standard serial options, although they should not be - needed. - -`ms3' - A decoder for the new serial IntelliMouse devices, the ones with - three buttons and a protocol incompatible with older ones. The - wheel is currently unused. - -`imps2' - "IntelliMouse" on the ps/2 port. This type can also be used for a - generic 2-button ps/2 mouse too, since it will auto-detect the - type. - -`netmouse' - Decodes the "Genius NetMouse" type of devices on the ps/2 port. - For serial "Netmouse" devices, use the "ms3" decoder. - -`cal' - A decoder of the "Calcomp UltraSlate device. - -`calr' - Same as above, but in relative mode. - -`twid' - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't yet - support X keycodes. If used with `-R', `gpm' will anyway repeat - mouse events to the X server. More information about twiddler - support can be found in `README.twiddler', in the gpm distribution. - -`syn synaptics' - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although they - should not be needed. - -`synps2 synaptics_ps2' - Same as above, but for the devices attached to the ps2 port. - -`brw' - A decoder for the Fellowes Browser, a device with 4 buttons and a - wheel. This mouse decoder accepts standard serial options, - although they should not be needed. - -`js Joystick' - This mouse type uses the joystick device to generate mouse events. - It is only available if the header `linux/joystick.h' is found at - compile time. The header (and the device as well) has been - introduced only during 2.1 development, and is not present in - version 2.0 of the kernel. - -`summa' - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it can - -R summa can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified xf86Summa.o module. - -`mtouch' - A decoder for the MicroTouch touch screen. Please refer to the - file `README.microtouch' in the source tree of gpm for further - information. In the near future, anyways, I plan to fold back to - this documentation the content of that file. - -`gunze' - A decoder for the gunze touch screen. Please refer to the file - `README.gunze' in the source tree of gpm for further information. - In the near future, anyways, I plan to fold back to this - documentation the content of that file. The decoder accepts the - following options: smooth=, debounce=. An higher smoothness - results in slower motion as well; a smaller smoothness gives - faster motion but, obviously, less smooth. The default smoothness - is 9. The debounce time is express in milliseconds and is the - minimum duration of an up-down event to be taken as a tap. Smaller - bounces are ignored. - -`acecad' - The Acecad tablet in absolute mode. - -`wp wizardpad' - Genius WizardPad tablet - - - -File: gpm.info, Node: Gpm Internals, Next: The ClientLib, Prev: Server Invocation, Up: Top - -3 Gpm Internals -*************** - -The server is organized as a main loop built around a `select()' system -call. It responds both to mouse events and to input from the clients, -which are connected to the server through a unix domain socket. The -connection is used to tell the server what a client is interested in, -and to get mouse events. - - When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most interesting). - -* Menu: - -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: - - -File: gpm.info, Node: Events, Next: Margins, Prev: Gpm Internals, Up: Gpm Internals - -3.1 Events -========== - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual consoles. *Note -Default Handlers::. - - When a client is involved, it is handled a `Gpm_Event' structure, -built by the server. The fields for `Gpm_Event' are the following: - -`unsigned char buttons;' - An or-mask of the values `GPM_B_LEFT', `GPM_B_MIDDLE' and - `GPM_B_RIGHT'. It corresponds to the state of the mouse buttons - when the event is reported. The current implementation of gpm - allows at most three buttons. - -`unsigned char modifiers;' - The value of the kernel variable `shift_state', as of - `keyboard.c', when the event is reported. It is a bitmask value, - and corresponds to the least significant byte of the value used by - the `loadkeys' program. Use of symbolic names in source code is - available after inclusion of `linux/keyboard.h', as exemplified in - `mev.c'. - -`unsigned short vc;' - The number of the active virtual console when the event is - reported. The client is not expected to use this value, which - corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. *Note Default - Handlers::. - -`short x, y;' - The position of the mouse pointer where the event is reported. It - is 1-based by default, to be compatible with `selection' and - `libcurses'. This behavior can be overriden, though, by setting - the library variable `gpm_zerobased'. *Note Variables::. - -`short dx, dy;' - The change in position since the last reported event. - -`enum Gpm_Etype type;' - A bit-mask, representing the type of reported event, as described - later. *Note Event Types::. - -`int clicks;' - A counter, which is valid at button-down, drag or button-up. It - can be 0, 1 or 2 to mean single, double or triple click. - -`enum Gpm_Margin margin;' - A bit-mask, telling if the pointer has gone out of the visible - screen. The indivudual bits are named `GPM_TOP', `GPM_BOT', - `GPM_LFT', `GPM_RGT'. Only one of them is active at a time, to - allow using `switch' on the value. Vertical outrun takes - precedence on horizontal outrun. *Note Margins::. - - -File: gpm.info, Node: Margins, Next: Event Types, Prev: Events, Up: Gpm Internals - -3.2 How margins are managed -=========================== - -Motion and button-press events are constrained to remain within the -visible screen. This means that the `x' will be within 1 and 80 and `y' -will be within 1 and 25 when the console is 80x25 cells. However, a -client can keep track of movements outside the screen, by using the -`dx' and `dy' fields, which aren't subject to clipping. - - The server helps applications in detecting margin conditions by -filling the `margin' field. Whenever the pointer tries to cross screen -boundaries, it is forced to remain on the border, but a flag is set in -`margin'. - - A different policy is in force for drag and button-release events. -In this case the pointer is allowed to go outside the physical screen -by exactly one position. This allows, for example, selecting to end of -line by dragging down-left. The peculiar situation is nonetheless -signaled through the `margin' flags. The client should be careful to -fit the values within the screen if needed. *Note Utility Functions::. - - -File: gpm.info, Node: Event Types, Next: Connection Details, Prev: Margins, Up: Gpm Internals - -3.3 Event Types -=============== - -The `type' field in `Gpm_Event' is made up of bit-wide flags. The -existing bit masks belong to two groups: bare events and cooked events. -The bit-mask `GPM_BARE_EVENTS' is provided to extract bare events, by -and-ing (`&') it with the `type' field. For any event, exactly one bit -will be set in the resulting bitmask. - - Bare events are the following: - -`GPM_MOVE' - A motion event, with all buttons up. - -`GPM_DRAG' - A motion event, but one or more buttons are kept pressed. - -`GPM_DOWN' - A button press event. The `buttons' field will report which - buttons are pressed after the event. - -`GPM_UP' - A button release event. The `buttons' field will report which - buttons are being released. Note that this is different from the - previous case. - -`GPM_ENTER' - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. When the - type is `GPM_ENTER', all the other fields are undefined. *Note - High Level Lib::. - -`GPM_LEAVE' - This is only delivered by the high level library, too. Events of - type `GPM_LEAVE' have all other fields undefined. - - Cooked events are the following: - -`GPM_SINGLE' - This bit may be set at button-press, drag and button release - events, and can be used to identify a single press. The time - interval used to choose a double click from two single clicks is - set by a parameter in the daemon (configurable at daemon - invocation). - -`GPM_DOUBLE' - Used to identify a double click (press, drag, release) - -`GPM_TRIPLE' - Used to identify a triple click (press, drag, release) - -`GPM_MFLAG' - The "motion flag" is true if some dragging happened between - button-press and button-release. It can be used by those - applications which respond to events at button release. It is - available at drag and release. - - -File: gpm.info, Node: Connection Details, Next: Default Handlers, Prev: Event Types, Up: Gpm Internals - -3.4 Connection Details -====================== - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading it. -All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - - In addition to the per-console stacks, another stack is there to -store default-handling clients. *Note Default Handlers::. - - Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - - Clients are required to fill a `Gpm_Connect' structure and pass it -to the server. The structure is made up by four `unsigned int' fields. -*Note Open and Close::. - -`eventMask' - A bitmask of the events the client wants to receive. Both bare and - cooked events are allowed to appear in the mask. - -`defaultMask' - A mask to tell which events allow a default treatment (the - selection one). These are mouse events, independent of the - modifier keys. - -`minMod' - The minimum amount of modifiers required by the client. This field - is used for default-handlers which manage control-mouse events - without interfering with mouse-only ones. *Note Default - Handlers::. - -`maxMod' - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in `maxMod' won't be - passed to the client. - Two more fields are there to tell about the connection itself, and -you're not asked to fill them, because `Gpm_Open' will do it for you. - -`int pid' - The process id of the connecting application. - -`int vc' - Which virtual console to gain control of. - - Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in *note Default Handlers::, but you only -need to choose the right values for your application. - - Examples: -`minMod=0; maxMod=0;' - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -`minMod=0; maxMod=~0;' - is a client which gets any mouse event. - -`minMod=1< /tmp/du" - } - - button 3 { - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - - The syntax for the file won't be described here, being it quite -apparent from the example above. Blanks and newlines are unused in -parsing the file, and the layout of the file is free. Comments are -allowed in the file: any hash mark (`#') found at the beginning of the -line or after white space makes the parser discard anything up to the -next line. To insert quotes (`"') in strings precede them with a -backslash. - - Note that recursive menus are allowed, to any level of recursion. - - Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -`button NUMBER MENU' - The `button' keyword is used to introduce a menu. It is followed - by the number of the relevant button (1=left, 2=middle, 3=right), - an open brace, a menu and a closed brace. A menu is made up of - cfg statements, followed by action statements. Cfg statements can - come in any order, while the order of action statements tells the - actual order in which actions will appear on the screen, top to - bottom. - - The following statements belong to the cfg set. - -`name STRING' - If the `name' keyword is present, the specified STRING will be - used as the name for the current menu. - -`background COLOR' - This statements is used to specify the background color to be used - in the current menu. The COLOR can be specified with one of the - eight canonical strings `black', `red', `cyan' etc. The background - defaults to black. - -`foreground COLOR' - This statements is used to specify the foreground color for menu - items. Its value defaults to `white'. An optional `bright' - keyword can appear before the actual color. - -`border COLOR' - `border' is used to specify the border color for the menu. Its - value defaults to `white'. An optional `bright' keyword can - appear before the actual color. - -`head COLOR' - `head' is used to specify the foreground color for the title of - the menu. Its value defaults to `white'. An optional `bright' - keyword can appear before the actual color. - - The following statements belong to the action set. - -`STRING f.fgcmd CMDSTRING' - When the mouse button is released above the corresponding menu - item, the CMDSTRING is pasted in the keyboard queue of the current - console. This is not yet implemented. - -`STRING f.bgcmd CMDSTRING' - When the mouse button is released above the corresponding menu - item, a shell (`/bin/sh') is forked to execute the specified - command, with `stdin' connected to `/dev/null', and `stdout', - `stderr' connected to the active console. - -`STRING f.jptty TTYNUMBER' - When the mouse button is released above the corresponding menu - item, the console is switched to the one specified. The TTYNUMBER - must be specified as a string. Any tty can be reached this way, - even those which are not accessible via the keyboard. - -`STRING f.mktty TTYNUMBER' - When the mouse button is released above the corresponding menu - item, an unused console is selected, and `/sbin/mingetty' is - executed in it. The current console is switched to the newly - opened console. I use this command to save kernel memory by - opening a single console through `/etc/inittab' and requesting the - others only when i need to login. - -`STRING WHOLE-MENU' - A menu can directly follow the label string. When the mouse - pointer leaves the menu frame at the level of STRING, a second - menu is posted on screen. - -`STRING f.lock' - When the mouse button is released above the corresponding menu - item, the keyboard and the screen are locked, and only the locking - user or the superuser can unlock them. This is not yet implemented. - -`STRING f.load' - The current loadavg when the menu is posted is concatenated to - STRING to build the actual message displayed on screen. Nothing - happens at button release. - -`STRING f.free' - The free memory and swap when the menu is posted is concatenated - to STRING to build the actual message displayed on screen. Nothing - happens at button release. - -`STRING f.time' - The current time is formatted with strftime(3), according to - STRING. The resulting string is the actual message displayed on - screen. Nothing happens at button release. - -`STRING f.pipe CMDLINE' - When the mouse pointer leaves the menu frame at the level of - STRING, a message box is posted on screen showing the last ten - lines of the output of CMDLINE. CMDLINE is executed by `/bin/sh'. - This is not yet implemented. - -`STRING f.nop' - This does nothing, it only displays STRING on the menu. - - The `HOME', `LOGNAME' and `USER' environment variables are setup to -the values for the invoking user before spawning an external process -(`f.bgcmd', `f.pipe'). The current directory is always `/'. - - Known bugs have been fixed. In particular, if you invoke `gpm-root' -right after `gpm', it will delay a few seconds before trying to connect -to the daemon. - - -File: gpm.info, Node: hltest, Next: mouse-test, Prev: gpm-root, Up: Demo Clients - -5.5 `hltest' -============ - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - - The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help in -understanding the internal workings. - - -File: gpm.info, Node: mouse-test, Prev: hltest, Up: Demo Clients - -5.6 `mouse-test' -================ - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between `-t ms' (three-buttons aware) and `-t -bare' old two-buttons-only serial mice. - - I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -File: gpm.info, Node: Type Index, Next: Function Index, Prev: Demo Clients, Up: Top - -Type Index -********** - -[index] -* Menu: - -* Gpm_Connect: Connection Details. (line 26) -* Gpm_Event: Events. (line 13) -* Gpm_Handler: Handling Functions. (line 11) -* Gpm_roi: Concepts. (line 12) - - -File: gpm.info, Node: Function Index, Next: Variable Index, Prev: Type Index, Up: Top - -API Index -********* - -[index] -* Menu: - -* Gpm_CharsQueued: Getting Events. (line 17) -* Gpm_Close: Open and Close. (line 34) -* GPM_DRAWPOINTER: Utility Functions. (line 14) -* Gpm_DrawPointer: Utility Functions. (line 13) -* Gpm_FitEvent: Utility Functions. (line 25) -* Gpm_FitValues: Utility Functions. (line 24) -* Gpm_FitValuesM: Utility Functions. (line 23) -* Gpm_Getc: Getting Events. (line 31) -* Gpm_Getch: Getting Events. (line 42) -* Gpm_Getchar: Getting Events. (line 32) -* Gpm_GetEvent: Getting Events. (line 7) -* Gpm_GetLibVersion: Extra Functions. (line 7) -* Gpm_GetServerVersion: Extra Functions. (line 16) -* Gpm_GetSnapshot: Extra Functions. (line 29) -* Gpm_HandleRoi: hl-Functions. (line 40) -* Gpm_LowerRoi: hl-Functions. (line 34) -* Gpm_Open: Open and Close. (line 7) -* Gpm_PopRoi: hl-Functions. (line 25) -* Gpm_PushRoi: hl-Functions. (line 8) -* Gpm_RaiseRoi: hl-Functions. (line 29) -* Gpm_Repeat: Utility Functions. (line 7) -* Gpm_UseRoi: hl-Functions. (line 20) -* Gpm_Wgetch: Getting Events. (line 41) - - -File: gpm.info, Node: Variable Index, Prev: Function Index, Up: Top - -Variable Index -************** - -[index] -* Menu: - -* gpm_current_roi: hl-Variables. (line 11) -* gpm_data: Variables. (line 44) -* gpm_fd: Variables. (line 16) -* gpm_flag: Variables. (line 9) -* gpm_handler: Variables. (line 44) -* gpm_hflag: Variables. (line 40) -* gpm_morekeys: Variables. (line 48) -* gpm_mx: Variables. (line 30) -* gpm_my: Variables. (line 30) -* gpm_roi: hl-Variables. (line 7) -* gpm_roi_data: hl-Variables. (line 20) -* gpm_roi_handler: hl-Variables. (line 17) -* gpm_tried: Variables. (line 12) -* gpm_visiblepointer: Variables. (line 26) -* gpm_zerobased: Variables. (line 20) - - - -Tag Table: -Node: Top1260 -Node: Overview1493 -Node: Building the Release3268 -Node: Server Invocation3689 -Node: Special Commands4877 -Node: Command Line7290 -Node: Bugs and Problems13896 -Node: Mouse Types14767 -Node: Gpm Internals24609 -Node: Events25487 -Node: Margins27967 -Node: Event Types29085 -Node: Connection Details31096 -Node: Default Handlers35096 -Node: The ClientLib36669 -Node: Handling Functions37350 -Node: Low Level Library40215 -Node: Variables40708 -Node: Open and Close42806 -Node: Getting Events44779 -Node: Utility Functions47018 -Node: Extra Functions48601 -Node: High Level Lib51023 -Node: Concepts51971 -Node: hl-Variables53367 -Node: hl-Functions54038 -Node: Xterm56567 -Node: Demo Clients57685 -Node: mev57915 -Node: sample/rmev61127 -Node: Emacs Support61630 -Node: gpm-root63732 -Node: hltest72087 -Node: mouse-test72554 -Node: Type Index73067 -Node: Function Index73495 -Node: Variable Index75310 - -End Tag Table diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/infofilter b/software/gpm/browse_source/gpm-1.20.3pre6/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/manpager b/software/gpm/browse_source/gpm-1.20.3pre6/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/mktxt b/software/gpm/browse_source/gpm-1.20.3pre6/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/old/Changelog b/software/gpm/browse_source/gpm-1.20.3pre6/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.20.3pre6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.20.3pre6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/README b/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.4 deleted file mode 100644 index 0017ac8a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.4 +++ /dev/null @@ -1,3 +0,0 @@ -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c -- add report success diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.3 deleted file mode 100644 index d7630018..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.3 +++ /dev/null @@ -1,5 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c -- check for rmev (1.19.6 or 1.17.8) diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.4 deleted file mode 100644 index 16a89d5c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- cleanup autoconf stuff diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.7 deleted file mode 100644 index c7e2e926..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.7 +++ /dev/null @@ -1 +0,0 @@ -- first vertical prototype: have on mouse input running diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/install-sh b/software/gpm/browse_source/gpm-1.20.3pre6/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/Makefile b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/Makefile deleted file mode 100644 index cfb65333..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Makefile for a basic kernel module - -CC=gcc - -#MODCFLAGS := -Wall -DMODULE -D__KERNEL__ -DLINUX -MODCFLAGS := -D__KERNEL__ -I/usr/src/linux-2.3.99-pre6/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -march=i586 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.3.99-pre6/include/linux/modversions.h - - -touchscreen.o: touchscreen.c /usr/include/linux/version.h - $(CC) $(MODCFLAGS) -c touchscreen.c - -audio.o: audio.c /usr/include/linux/version.h - $(CC) $(MODCFLAGS) -c audio.c diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.20.3pre6/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.3pre6/scripts/gpm.release deleted file mode 100644 index 963e0c6d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/scripts/gpm.release +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(awk -F= '/^release=/ { print $2 }' configure.in )" -#VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo -n "=> Version: $VERSION; ok?" -read ok -#echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.3pre6/src/Makefile.in deleted file mode 100644 index 56451484..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/Makefile.in +++ /dev/null @@ -1,181 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/header.c daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c \ - prog/display-buttons.c prog/display-coords.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) -Iheaders @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) - -## Release / Dist - - -## Cleanup -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/drivers.h \ - Makefile $(DEPFILE) - -allclean: clean - rm -f headers/config.h.in diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/cmdline.c deleted file mode 100644 index 66c8ecc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm.c deleted file mode 100644 index 33a1b20a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/header.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/main.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/main.c deleted file mode 100644 index 724e4db8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processconn.c deleted file mode 100644 index 646acdc0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processmouse.c deleted file mode 100644 index b3f3994e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processmouse.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processrequest.c deleted file mode 100644 index 309834c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/startup.c deleted file mode 100644 index b58fb6c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/startup.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* log to debug, who we are */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_VERSION); - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/drivers/README b/software/gpm/browse_source/gpm-1.20.3pre6/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/generic/getsym.c deleted file mode 100644 index b8f5bfcd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/generic/getsym.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/Makefile b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/Makefile deleted file mode 100644 index 6b8ac786..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/Makefile +++ /dev/null @@ -1,136 +0,0 @@ -# -# cinit -# -# Nico Schottelius -# -# Don't edit Makefiles, use conf/* for configuration. -# - -#include Makefile.tests - -# Build tools / locations -CC=./tmp/cc -CFLAGS= -LD=./tmp/ld -LDFLAGS= -STRIP=./tmp/strip -SBIN=../sbin - -# directories and files -CONFIG_H=include/config.h - -BIN=cinit - -# -# End user targets -# -all: out/gpm2-daemon - - -# -# All objects depend on headers. -# -GPM2_DAEMON_HEADERS=$(shell cat deps/gpm2-daemon-headers) - - -# -# Objects -# - -GPM2_DAEMON_OBJECTS=$(shell cat deps/gpm2-daemon) -$(GPM2_DAEMON_OBJECTS): $(GPM2_DAEMON_HEADERS) - -GPM2_DAEMON_PROTOCOLS=$(shell cat tmp/protocol-deps) - -CLIENT= - -COMMUNICATION= - -OBJ= - -# -# Programs -# - -out/gpm2-daemon: $(GPM2_DAEMON_OBJECTS) $(GPM2_DAEMON_PROTOCOLS) - $(LD) -o $@ $^ - - -# -# Generic -# - -%.o: %.c .configured - $(CC) -c -o $@ $< - - - -# -# First do configuration, so we include the right variables -# -Makefile: .configured - -.configured: conf/* - @./scripts/generate_cbuiltconfig.sh conf - -$(CINIT_OBJ): $(CONFIG_H) - - -$(CONFIG_H): ../conf/* - ../scripts/cinit.mkheader > $(CONFIG_H) - -cservice: $(SBIN)/cservice - -$(SBIN)/cservice util/cservice: $(SBIN) $(CSVC_OBJ) - $(LD) $(LDFLAGS) $(CSVC_OBJ) -o $@ - $(STRIP) $@ - -ccontrol: $(SBIN)/ccontrol - -$(SBIN)/ccontrol util/ccontrol: config.h $(SBIN) $(CCO_OBJ) - $(LD) $(LDFLAGS) $(CCO_OBJ) -o $@ - $(STRIP) $@ - -install: install-dir cinit cservice ccontrol - @echo '*** Installing cinit ***' - ./bin/cinit.install.binary - -install-miniconf: - ./bin/cinit.install.miniconf - -install-dir: - ./bin/cinit.install.dir - - -################################################################################ -# -# Build targets -# -cinit: $(CINIT_OBJ) - $(LD) $^ -o $@ - -uml: cinit - ../../vm/uml/uml-mount.sh - cp cinit ../../vm/uml/root/sbin/cinit - ../../vm/uml/uml-umount.sh - -umlstart: uml - ../../vm/uml/uml-start.sh - -################################################################################ -# -# Generic targets -# - -.PHONY: dist -dist: distclean - -.PHONY: distclean -distclean: clean - rm -f os/current ipc/current .configured - -.PHONY: clean -clean: - rm -f ../tmpbin/*.configured - rm -f $(BIN) $(CINIT_OBJ) - rm -f test/*.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/main.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/main.o deleted file mode 100644 index 6fa047b4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/main.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/read_config.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/read_config.o deleted file mode 100644 index 686797bf..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/read_config.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/set_defaults.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/set_defaults.o deleted file mode 100644 index a04a35d5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/core/set_defaults.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/commandline.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/commandline.o deleted file mode 100644 index 3fae54d9..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/commandline.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/daemon-usage.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/daemon-usage.o deleted file mode 100644 index 773c1189..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/daemon-usage.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/mini_printf.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/mini_printf.o deleted file mode 100644 index 26468e2d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/mini_printf.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/mice_handler.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/mice_handler.o deleted file mode 100644 index ecc4f618..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/mice_handler.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/ps2.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/ps2.o deleted file mode 100644 index baa8bd84..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/mice/ps2.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/out/gpm2-daemon b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/out/gpm2-daemon deleted file mode 100644 index 49e027f6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/out/gpm2-daemon and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/README b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/README deleted file mode 100644 index 30214bfd..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/README +++ /dev/null @@ -1 +0,0 @@ -Directory for temporarily created files. diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/cc b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/cc deleted file mode 100644 index dec616cc..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/cc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -"gcc" -pipe -W -Wall -Werror -I. -Iinclude -g "$@" diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/ld b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/ld deleted file mode 100644 index 6693ab93..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/ld +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -"gcc" "$@" diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/protocol-deps b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/protocol-deps deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/protocol-deps +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/protocols.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/protocols.h deleted file mode 100644 index 51f8a082..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/gpm2/tmp/protocols.h +++ /dev/null @@ -1,2 +0,0 @@ -int gpm2_open_ps2(int fd); -int gpm2_decode_ps2(int fd); diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/config.h.in b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/config.h.in deleted file mode 100644 index 6235e1f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/config.h.in +++ /dev/null @@ -1,114 +0,0 @@ -/* src/headers/config.h.in. Generated from configure.in by autoheader. */ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_INPUT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_JOYSTICK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_MAJOR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_TTY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_CURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `syslog' function. */ -#undef HAVE_SYSLOG - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYSLOG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSMACROS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vsyslog' function. */ -#undef HAVE_VSYSLOG - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/daemon.h deleted file mode 100644 index a8936ad4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/daemon.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/message.h deleted file mode 100644 index 37e87f42..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/liblow.c deleted file mode 100644 index 25a1d5c4..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/liblow.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/report-lib.c deleted file mode 100644 index 812fdb8e..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/lib/report-lib.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/mice.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/mice.c deleted file mode 100644 index f62dca0a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/mice.c +++ /dev/null @@ -1,2509 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/display-buttons.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/display-buttons.c deleted file mode 100644 index de8e5b25..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/display-buttons.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-buttons -lgpm display-buttons.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * left/middle/right button - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": p=%d, l=%1d, m=%1d, r=%1d, clicks=%d\n", - event->type & GPM_DOWN, - event->buttons & GPM_B_LEFT, - event->buttons & GPM_B_MIDDLE, - event->buttons & GPM_B_RIGHT, - event->clicks); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_DRAG | GPM_DOWN | GPM_UP; - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - printf("\tp=pressed (0=release)\n\tl=left\n\tm=middle\n\tr=right\n"); - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/display-coords.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/display-coords.c deleted file mode 100644 index ed15c8a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/display-coords.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-coords -lgpm display-coords.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * x/y coords on the screen - * dx, dy: deltas - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_MOVE; /* read only moves */ - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/open_console.o b/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/open_console.o deleted file mode 100644 index 4ca2472d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.3pre6/src/prog/open_console.o and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/report.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/synaptics.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/synaptics.c deleted file mode 100644 index 54d4aa3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/synaptics.c +++ /dev/null @@ -1,3305 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/tools.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.20.3pre6/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.3pre6/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.20.3pre6/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/BUGS b/software/gpm/browse_source/gpm-1.20.4/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.4/COPYING b/software/gpm/browse_source/gpm-1.20.4/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.4/Changes b/software/gpm/browse_source/gpm-1.20.4/Changes deleted file mode 100644 index e6b48954..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/Changes +++ /dev/null @@ -1,65 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos - * Added automatic local build test - * Fixed SONAME (praise the Debian guys, Jonathan Nieder) - -* From 1.20.1 to 1.20.3: - o Applied many cleanups - o Added etouch support - o Added scripts/report_success.sh - o Updated README - - pre6: - Cleaned up "make dist" target - Added two debbugging programs: - src/prog/display-buttons.c: display pressed buttons - src/prog/display-coords.c: display mouse coordinates - Fixed Bug#474516: gpm: debug messages in syslog (Debian) - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.4/MANIFEST b/software/gpm/browse_source/gpm-1.20.4/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.4/Makefile.in b/software/gpm/browse_source/gpm-1.20.4/Makefile.in deleted file mode 100644 index e896cfb2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/Makefile.in +++ /dev/null @@ -1,153 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -### RELEASE STUFF -TARS =../gpm-$(release).tar.gz -TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=$(D_BASE)/archives/ -D_SOURCE=$(D_BASE)/browse_source/ - -M_HOST=arcana.linux.it -M_DIR=gpm/ - -tars: $(TARS) - -# configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -../gpm-$(release).tar: $(srcdir) - # no exclude possible of .git with pax it seems - #pax -w -x ustar -s '/^\./gpm-$(release)/' -w . -f $@ - pax -w -x ustar -s ';^;gpm-$(release)/;' -f $@ -w * - -../gpm-$(release).tar.gz: ../gpm-$(release).tar - gzip -9 -c $^ > $@ - -../gpm-$(release).tar.bz2: ../gpm-$(release).tar - bzip2 -9 -c $^ > $@ - -../gpm-$(release).tar.lzma: ../gpm-$(release).tar - lzma -9 -c $^ > $@ - -# 3. Put package together into .tar.gz and .tar.bz2 -#dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz -dist: disttest distclean distconf nicotest $(TARS) - chmod 0644 $(TARS) - scp $(TARS) $(D_HOST):$(D_DIR) - scp $(TARS) $(M_HOST):$(M_DIR) - ssh "$(D_HOST)" "tar xvfz $(D_DIR)/gpm-$(release).tar.gz -C $(D_SOURCE)" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type f -exec chmod 0644 {} \\;" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type d -exec chmod 0755 {} \\;" - - -### TEST: on nicos machine: not to be used anywhere else currently -# create / update configure, delete other parts from earlier build -disttest: distconf clean - ./configure - make all - -TESTBUILDDIR=~/temp/gpm-build-test -nicotest: $(TARS) - rm -rf $(TESTBUILDDIR) - mkdir -p $(TESTBUILDDIR) - cp $(TARS) $(TESTBUILDDIR) - cd $(TESTBUILDDIR); tar xvfj gpm-$(release).tar.bz2; - cd $(TESTBUILDDIR)/gpm-$(release); ./configure && make && ./src/gpm -v - -### CLEANUP -distclean: clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -allclean: do-allclean distclean - rm -f configure - diff --git a/software/gpm/browse_source/gpm-1.20.4/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.4/Makefile.include.in deleted file mode 100644 index d07fdc03..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/Makefile.include.in +++ /dev/null @@ -1,67 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.4/README b/software/gpm/browse_source/gpm-1.20.4/README deleted file mode 100644 index 03bb8b23..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/README +++ /dev/null @@ -1,334 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001-2008 nico-gpm2008 at schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== REPORT SUCCESS - -As it is always nice to see as an author of FOSS that the software is -used and alive und which options are used, you can send a success -report to me via ./scripts/report_success.sh. - - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit - http://lists.linux.it/listinfo/gpm - -or send a message with "subscribe" in its body to - gpm-request@lists.linux.it. - -For example: - echo subscribe | mail gpm-request@lists.linux.it - - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following place: - - http://unix.schottelius.org/gpm/archives/ - http://unix.schottelius.org/gpm/browse_source/ - - Mirror: - - ftp://arcana.linux.it/pub/gpm/ - http://www.ar.linux.it/pub/gpm/ - -The homepage of gpm can be found at - - http://unix.schottelius.org/gpm/ - -You can get the latest development tree of gpm via git: - - git-clone http://unix.schottelius.org/git/gpm - -There are three branches available: - - master: Contains the latest gpm1 code, may be broken. - gpm-1-stable: Contains the latest stable source code. - gpm-2-dev: Contains work that heads to gpm2. - -You can browse the git-tree via gitweb: - - http://unix.schottelius.org/cgi-bin/gitweb.cgi?p=gpm;a=summary - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.4/README.gpm2 b/software/gpm/browse_source/gpm-1.20.4/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.4/README.versions b/software/gpm/browse_source/gpm-1.20.4/README.versions deleted file mode 100644 index d4d5f0e4..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/README.versions +++ /dev/null @@ -1,29 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions: no new features. - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code. - includes new features. - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.4/TODO b/software/gpm/browse_source/gpm-1.20.4/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.4/aclocal.m4 b/software/gpm/browse_source/gpm-1.20.4/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.20.4/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.20.4/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/build-from-git.sh b/software/gpm/browse_source/gpm-1.20.4/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.20.4/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.4/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.4/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.4/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.4/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.4/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.4/configure b/software/gpm/browse_source/gpm-1.20.4/configure deleted file mode 100644 index d5c72bcd..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/configure +++ /dev/null @@ -1,6105 +0,0 @@ -#! /bin/sh -# From configure.in configure.in. -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="src/daemon/main.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -RANLIB -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -YACC -YFLAGS -LN_S -DVIPS -TEXI2HTML -TEX -TEXINDEX -MAKEINFO -DIFF -SED -emacs -CPP -GREP -EGREP -ALLOCA -GPMXTERM -release -release_date -abi_lev -abi_full -EMACS -ELISP -SHLIB -PICFLAGS -SOLDFLAGS -CURSES_OBJS -SHARED_LIBS -lispdir -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -YACC -YFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --without-curses disable curses support even if curses found - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - YACC The `Yet Another C Compiler' implementation to use. Defaults to - the first program found out of: `bison -y', `byacc', `yacc'. - YFLAGS The list of arguments that will be passed by default to $YACC. - This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_config_headers="$ac_config_headers src/headers/config.h" - - -release=1.20.4 -release_date="29th of May 2008" - -cat >>confdefs.h <<_ACEOF -#define GPM_RELEASE "$release" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define GPM_RELEASE_DATE "$release_date" -_ACEOF - - -#abi=21 -# -#abi_lev=`expr $abi - $abi_age` -#abi_full=$abi_lev.$abi_age.$abi_rev - -abi_lev="2" -abi_age="0" -abi_rev="0" -abi_full="${abi_lev}.${abi_age}.${abi_rev}" - -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -for ac_prog in 'bison -y' byacc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_YACC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_YACC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" - -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } -fi - - -# check for programs. -# Extract the first word of "dvips", so it can be a program name with args. -set dummy dvips; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DVIPS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DVIPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_DVIPS="$DVIPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DVIPS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DVIPS" && ac_cv_path_DVIPS="no" - ;; -esac -fi -DVIPS=$ac_cv_path_DVIPS -if test -n "$DVIPS"; then - { echo "$as_me:$LINENO: result: $DVIPS" >&5 -echo "${ECHO_T}$DVIPS" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "texi2html", so it can be a program name with args. -set dummy texi2html; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEXI2HTML+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEXI2HTML in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEXI2HTML="$TEXI2HTML" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEXI2HTML="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEXI2HTML" && ac_cv_path_TEXI2HTML="no" - ;; -esac -fi -TEXI2HTML=$ac_cv_path_TEXI2HTML -if test -n "$TEXI2HTML"; then - { echo "$as_me:$LINENO: result: $TEXI2HTML" >&5 -echo "${ECHO_T}$TEXI2HTML" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "tex", so it can be a program name with args. -set dummy tex; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEX="$TEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEX" && ac_cv_path_TEX="no" - ;; -esac -fi -TEX=$ac_cv_path_TEX -if test -n "$TEX"; then - { echo "$as_me:$LINENO: result: $TEX" >&5 -echo "${ECHO_T}$TEX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "texindex", so it can be a program name with args. -set dummy texindex; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TEXINDEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TEXINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_TEXINDEX="$TEXINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TEXINDEX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TEXINDEX" && ac_cv_path_TEXINDEX="no" - ;; -esac -fi -TEXINDEX=$ac_cv_path_TEXINDEX -if test -n "$TEXINDEX"; then - { echo "$as_me:$LINENO: result: $TEXINDEX" >&5 -echo "${ECHO_T}$TEXINDEX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "makeinfo", so it can be a program name with args. -set dummy makeinfo; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_MAKEINFO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAKEINFO in - [\\/]* | ?:[\\/]*) - ac_cv_path_MAKEINFO="$MAKEINFO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_MAKEINFO="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MAKEINFO" && ac_cv_path_MAKEINFO="no" - ;; -esac -fi -MAKEINFO=$ac_cv_path_MAKEINFO -if test -n "$MAKEINFO"; then - { echo "$as_me:$LINENO: result: $MAKEINFO" >&5 -echo "${ECHO_T}$MAKEINFO" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "diff", so it can be a program name with args. -set dummy diff; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DIFF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DIFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DIFF" && ac_cv_path_DIFF="no" - ;; -esac -fi -DIFF=$ac_cv_path_DIFF -if test -n "$DIFF"; then - { echo "$as_me:$LINENO: result: $DIFF" >&5 -echo "${ECHO_T}$DIFF" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "sed", so it can be a program name with args. -set dummy sed; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $SED in - [\\/]* | ?:[\\/]*) - ac_cv_path_SED="$SED" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_SED" && ac_cv_path_SED="no" - ;; -esac -fi -SED=$ac_cv_path_SED -if test -n "$SED"; then - { echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "emacs", so it can be a program name with args. -set dummy emacs; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_emacs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $emacs in - [\\/]* | ?:[\\/]*) - ac_cv_path_emacs="$emacs" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_emacs="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_emacs" && ac_cv_path_emacs="no" - ;; -esac -fi -emacs=$ac_cv_path_emacs -if test -n "$emacs"; then - { echo "$as_me:$LINENO: result: $emacs" >&5 -echo "${ECHO_T}$emacs" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - { echo "$as_me:$LINENO: checking where to install Emacs Lisp files" >&5 -echo $ECHO_N "checking where to install Emacs Lisp files... $ECHO_C" >&6; } -if test "${itz_cv_path_site_lisp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac -fi -{ echo "$as_me:$LINENO: result: $itz_cv_path_site_lisp" >&5 -echo "${ECHO_T}$itz_cv_path_site_lisp" >&6; } - - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - -for ac_header in syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -# Check whether --with-curses was given. -if test "${with_curses+set}" = set; then - withval=$with_curses; -fi - - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - - - - -for ac_header in sys/sysmacros.h linux/major.h linux/tty.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ echo "$as_me:$LINENO: checking for __u32" >&5 -echo $ECHO_N "checking for __u32... $ECHO_C" >&6; } -if test "${itz_cv_type___u32+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include - -int -main () -{ - -__u32 dummy; -return 0; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - itz_cv_type___u32=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - itz_cv_type___u32=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $itz_cv_type___u32" >&5 -echo "${ECHO_T}$itz_cv_type___u32" >&6; } - -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE___U32 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking whether system is ELF" >&5 -echo $ECHO_N "checking whether system is ELF... $ECHO_C" >&6; } -if test "${itz_cv_sys_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __ELF__ -win -#else -lose -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "win" >/dev/null 2>&1; then - itz_cv_sys_elf=yes -else - itz_cv_sys_elf=no -fi -rm -f conftest* - -fi -{ echo "$as_me:$LINENO: result: $itz_cv_sys_elf" >&5 -echo "${ECHO_T}$itz_cv_sys_elf" >&6; } -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_c_compiler_gnu} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi - -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_c_compiler_gnu} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - - - -for ac_func in vsyslog syslog -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - if (p) return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_working_alloca_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_working_alloca_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } -if test $ac_cv_working_alloca_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - if (p) return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_alloca_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_alloca_works=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=\${LIBOBJDIR}alloca.$ac_objext - -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF - - -{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -int -main () -{ - return find_stack_direction () < 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } - -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF - - -fi - - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - -as_ac_Lib=`echo "ac_cv_lib_$i''_tputs" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for tputs in -l$i" >&5 -echo $ECHO_N "checking for tputs in -l$i... $ECHO_C" >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$i $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tputs (); -int -main () -{ -return tputs (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_Lib=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -ac_res=`eval echo '${'$as_ac_Lib'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Lib'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_LIB$i" | $as_tr_cpp` 1 -_ACEOF - - LIBS="-l$i $LIBS" - -fi - - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - -as_ac_Lib=`echo "ac_cv_lib_$i''_wgetch" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for wgetch in -l$i" >&5 -echo $ECHO_N "checking for wgetch in -l$i... $ECHO_C" >&6; } -if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$i $TERMLIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char wgetch (); -int -main () -{ -return wgetch (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_Lib=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Lib=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -ac_res=`eval echo '${'$as_ac_Lib'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Lib'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_LIB$i" | $as_tr_cpp` 1 -_ACEOF - - LIBS="-l$i $LIBS" - -fi - - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= - - - - - - - - - - - - - - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -ac_config_files="$ac_config_files Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "src/headers/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/headers/config.h" ;; - "Makefile.include") CONFIG_FILES="$CONFIG_FILES Makefile.include" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; - "doc/doc.gpm") CONFIG_FILES="$CONFIG_FILES doc/doc.gpm" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -RANLIB!$RANLIB$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -YACC!$YACC$ac_delim -YFLAGS!$YFLAGS$ac_delim -LN_S!$LN_S$ac_delim -DVIPS!$DVIPS$ac_delim -TEXI2HTML!$TEXI2HTML$ac_delim -TEX!$TEX$ac_delim -TEXINDEX!$TEXINDEX$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -DIFF!$DIFF$ac_delim -SED!$SED$ac_delim -emacs!$emacs$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -ALLOCA!$ALLOCA$ac_delim -GPMXTERM!$GPMXTERM$ac_delim -release!$release$ac_delim -release_date!$release_date$ac_delim -abi_lev!$abi_lev$ac_delim -abi_full!$abi_full$ac_delim -EMACS!$EMACS$ac_delim -ELISP!$ELISP$ac_delim -SHLIB!$SHLIB$ac_delim -PICFLAGS!$PICFLAGS$ac_delim -SOLDFLAGS!$SOLDFLAGS$ac_delim -CURSES_OBJS!$CURSES_OBJS$ac_delim -SHARED_LIBS!$SHARED_LIBS$ac_delim -lispdir!$lispdir$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" - ;; - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff --git a/software/gpm/browse_source/gpm-1.20.4/configure.in b/software/gpm/browse_source/gpm-1.20.4/configure.in deleted file mode 100644 index 5f11c15a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/configure.in +++ /dev/null @@ -1,140 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.20.4 -release_date="29th of May 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release",[GPM release number as a string]) -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date",[release date as a string]) - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -dnl Nico, 20080520: Is this somewhere needed? -dnl I do not see the use right now -> disabled -#abi=21 -# -#abi_lev=`expr $abi - $abi_age` -#abi_full=$abi_lev.$abi_age.$abi_rev - -abi_lev="2" -abi_age="0" -abi_rev="0" -abi_full="${abi_lev}.${abi_age}.${abi_rev}" - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32, 1, [define if the __u32 type exists either in sys/types.h or in linux/types.h]) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/Makefile b/software/gpm/browse_source/gpm-1.20.4/contrib/Makefile deleted file mode 100644 index 757ae02d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = /home/user/nico/projekte/gpm/gpm/contrib -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.4/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.4/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.4/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.4/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/other/README b/software/gpm/browse_source/gpm-1.20.4/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.4/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/Announce b/software/gpm/browse_source/gpm-1.20.4/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/FAQ b/software/gpm/browse_source/gpm-1.20.4/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.4/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.4/doc/Makefile.in deleted file mode 100644 index 709fa6d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/Makefile.in +++ /dev/null @@ -1,190 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -$(MANPAGES): gpm.man -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -## CLEANUP section -# normal cleanup -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# for creating distribution -distclean: clean - rm -f Makefile doc.gpm - -# to even remove things we leave for end-users -allclean: distclean - rm -f gpm.info - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -## DIST section -# when we cleaned it, we can securely copy us. -dist: distclean - # unneeded now: using pax + -s option and create tars in .. - #$(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.4/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.4/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.4/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.4/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.4/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.4/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.4/doc/doc.gpm.in deleted file mode 100644 index 4ba4fd33..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/doc.gpm.in +++ /dev/null @@ -1,2295 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001-2008 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). Text-mode (non-X) mouse library and server daemon. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001-2008 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for me to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/gpm.info b/software/gpm/browse_source/gpm-1.20.4/doc/gpm.info deleted file mode 100644 index cf2ce1b4..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/gpm.info +++ /dev/null @@ -1,1922 +0,0 @@ -This is /home/user/nico/projekte/gpm/gpm/doc/gpm.info, produced by makeinfo version 4.11 from /home/user/nico/projekte/gpm/gpm/doc/gpm.texinfo. - -INFO-DIR-SECTION Miscellaneous -START-INFO-DIR-ENTRY -* Gpm: (gpm). Text-mode (non-X) mouse library and server daemon. -END-INFO-DIR-ENTRY - - This file is a user's and programmer's manual for gpm 1.20.4. - - Copyright (C) 1994,1995,1998 Alessandro Rubini Copyright (C) -2001-2008 Nico Schottelius - - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be stated in a -translation approved by the Free Software Foundation. - - This file documents the 1.20.4 release of the "General Purpose -Mouse" (gpm) server for the Linux text console (29th of May 2008). - - -File: gpm.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - -gpm -*** - -* Menu: - -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: - - -File: gpm.info, Node: Overview, Next: Server Invocation, Prev: Top, Up: Top - -1 Overview -********** - -The "gpm" package is a mouse server for the Linux console. It is meant -to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -`gpm' come from the `selection-1.5' package, by Andrew Haylett. - - The first application to support the mouse has been The Midnight -Commander, by Miguel de Icaza. `mc-0.11' and later releases offer -mouse support if you have the mouse server running on your system. The -file `t-mouse.el' provides support for using the mouse from within -Emacs. *Note Emacs Support::. - - As of release 0.96, a default-handler is released with gpm, and can -be used to handle Control-Mouse events to draw menus on the screen. -The `gpm-root' program, however, needs kernel 1.1.73 or newer. *Note -gpm-root::. - - Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as `kmouse-?.??.tar.gz' from the mirrors of -`ftp://tsx-11.mit.edu'. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - - As of release 1.20.0 the default device is removed. Now -m is a must. - - Release 1.20.1 introduces the must for -t and a specific way to use --m,-t,-o: Now you've got to use -m first, then -t and at last -o. This -seems to be more complex, but makes using of multiply mice possible with -clean code. - -* Menu: - -* Building the Release:: - - -File: gpm.info, Node: Building the Release, Prev: Overview, Up: Overview - -1.1 Compiling and Installing -============================ - -Just say `./configure && make && make install' to your shell. You'll -need gpm installed to compile the latest release of The Midnight -Commander with mouse support enabled. - - Binaries are not released with the package because it's safer for -you to compile the package by yourself. - - -File: gpm.info, Node: Server Invocation, Next: Gpm Internals, Prev: Overview, Up: Top - -2 Server Invocation -******************* - -The `gpm' executable is meant to act like a daemon (thus, `gpmd' would -be a better name for it). This section is meant to describe the -command-line options for `gpm', while its internals are outlined in the -next section. *Note Gpm Internals::. - - Due to restrictions in the `ioctl(TIOCLINUX)' system call, `gpm' must -be run by the superuser. The restrictions have been added in the last -1.1 kernels to fix a security hole related to selection and screen -dumping. - - The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's attitude. From -release 1.02 up to 1.19.2 is was possible for any user logged on the -system console to change the mouse _feeling_ using the -q option. This -is no longer possible for security reasons. - - As of 0.97 the server program puts itself in the background. To kill -`gpm' you can just reinvoke it with the `-k' cmdline switch, although -`killall gpm' can be a better choice. - -* Menu: - -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: - - -File: gpm.info, Node: Special Commands, Next: Command Line, Prev: Server Invocation, Up: Server Invocation - -2.1 Special Commands -==================== - -Version 1.10 adds the capability to execute _special_ commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - - Special commands are toggled by triple-clicking the left and right -button - an unlikely event during normal mouse usage. The easiest way -to triple-click is pressing one of the buttons and triple-click the -other one. When special processing is toggled, a message appears on the -console (and the speaker beeps twice, if you have a speaker); if the -user releases all the buttons and presses one of them again within -three seconds, then the special command corresponding to the button is -executed. - - The default special commands are: - -LEFT BUTTON - Reboot the system by signalling the init process - -MIDDLE BUTTON (IF ANY) - Execute `/sbin/shutdown -h now' - -RIGHT BUTTON - Execute `/sbin/shutdown -r now' - - The `-S' command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use `-S ""' (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - - As an example, `-S ":telinit 1:/sbin/halt"', associates killing init -to the left button, going single user to the middle one, and halting -the system to the right button. - - System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - - -File: gpm.info, Node: Command Line, Next: Bugs and Problems, Prev: Special Commands, Up: Server Invocation - -2.2 Command Line Options -======================== - -Available command line options are the following: - -`-a ACCEL' - Set the acceleration value used when a single motion event is - longer than DELTA (see `-d'). - -`-A[LIMIT]' - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer (`rm -rf /') - including the terminating line break, then all the victim has to - do is click the middle mouse button .. As of version 1.17.2, this - has developed into a more general aging mechanism; the gpm daemon - can disable (_age_) selection pasting automatically after a period - of inactivity. To enable this mode just give the optional LIMIT - parameter (no space in between !) which is interpreted as the - time in seconds for which a selection is considered valid and - pastable. As of version 1.15.7, a trivial program called - `disable-paste' is provided. The following makes a good addition - to `/etc/profile' if you allow multiple users to work on your - console. - - `case $( /usr/bin/tty ) in - /dev/tty[0-9]*) /usr/bin/disable-paste ;; - esac' - -`-b BAUD' - Set the baud rate. - -`-B SEQUENCE' - Set the button sequence. `123' is the normal sequence, `321' can - be used by left-handed people, and `132' can be useful with - two-button mice (especially within Emacs). All the button - permutations are allowable. - -`-d DELTA' - Set the delta value. When a single motion event is longer than - DELTA, ACCEL is used as a multiplying factor. (Must be 2 or above) - -`-D' - Do not automatically enter background operation when started, and - log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases it - was done with a compile-time option. - -`-g NUMBER' - With glidepoint devices, emulate the specified button with tapping. - NUMBER must be `1', `2', or `3', and refers to the button number - _before_ the `-B' button remapping is performed. This option - applies to the mman and ps2 decoding. No button is emulated by - default because the ps2 tapping is incompatible with some normal - ps2 mice - -`-h' - Print a summary of command line options. - -`-i INTERVAL' - Set INTERVAL to be used as an upper time limit for multiple - clicks. If the interval between button-up and button-down events - is less than LIMIT, the press is considered a double or triple - click. Time is in milliseconds. - -`-k' - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use `-R' or the single-open - limitation is removed from the kernel). - -`-l CHARSET' - Choose the `inword()' look up table. The CHARSET argument is a - list of characters. `-' is used to specify a range and `\ ' is - used to escape the next character or to provide octal codes. Only - visible character can appear in CHARSET because control characters - can't appear in text-mode video memory, whence selection is cut. - -`-m FILENAME' - Choose the mouse file to open. Must be before -t and -o. - -`-M' - Enable multiple mode. The daemon will read two different mouse - devices. Any subsequent option will refer to the second device, - while any preceding option will be used for the first device. This - option automatically forces the _repeater_ (`-R') option on. - -`-o LIST-OF-EXTRA-OPTIONS' - The option works similary to the "-o" option of mount; it is used - to specify a list of "extra options" that are specific to each - mouse type. The list is comma-separated. The options `dtr', `rts' - or `both' are used by the serial initialization to toggle the - modem lines like, compatibly with earlier gpm versions; note - however that using -o dtr associated with non-plain-serial mouse - types may now generate an error. *Note Mouse Types::. And by the - way, use -o after -m and after -t. - -`-p' - Forces the pointer to be visible while selecting. This is the - behaviour of `selection-1.7', but it is sometimes confusing. The - default is not to show the pointer, which can be confusing as well. - -`-r NUMBER' - Set the responsiveness. A higher responsiveness is used for a - faster cursor motion. - -`-R[NAME]' - Causes `gpm' to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo `/dev/gpmdata' in - protocol NAME, given as an optional argument (no space in between - !). In principle, you can use the same names as for the `-t' - option, although repeating into some protocols may not be - implemented for a while. *Note Mouse Types::. In addition, you - can specify `raw' as the NAME, to repeat the mouse data byte by - byte, without any protocol translation. If NAME is omitted, it - defaults to `msc'. Using gpm in repeater mode, you can configure - the X server to use its fifo as a mouse device. This option is - useful for bus-mouse owners to override the single-open - limitation. It is also an easy way to manage those stupid - dual-mode mice which force you to keep the middle button down - while changing video mode. The option is forced on by the `-M' - option. - -`-s NUMBER' - Set the sample rate for the mouse device. - -`-S COMMANDS' - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -`-t NAME' - Set the mouse type. Use `-t help' to get a list of allowable - types. Since version 1.18.1, the list also shows which protocols - are available as repeaters (see -R above), by marking them with an - asterisk ("*"). *Note Mouse Types::. Use -t after you selected - the mouse device with -m. - -`-v' - Print version information and exit. - -`-2' - Force two buttons. This means that the middle button, if any, will - be taken as it was the right one. - -`-3' - Force three buttons. By default the mouse is considered to be a - 2-buttons one, until the middle button is pressed. If three - buttons are there, the right one is used to extend the selection, - and the middle one is used to paste it. Beware: if you use the - `-3' option with a 2-buttons mouse, you won't be able to paste the - selection. - - -* Menu: - -* Bugs and Problems:: - - -File: gpm.info, Node: Bugs and Problems, Next: Mouse Types, Prev: Command Line, Up: Server Invocation - -2.3 Bugs and Problems -===================== - -The `gpm' server may have problems interacting with X: if your mouse is -a single-open device (i.e. a bus mouse), you should kill `gpm' before -starting X, or use the `-R' option (see above). To kill `gpm' just -invoke `gpm -k'. This problem doesn't apply to serial mice. - - Two instances of gpm can't run on the same system. If you have two -mice use the `-M' option (see above). - - While the current console is in graphic mode, `gpm' sleeps until -text mode is back (unless `-R' is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur out -in hidden consoles. - - The clients shipped out with gpm are not updated, thus there are -potential security risks when using them. - - -File: gpm.info, Node: Mouse Types, Prev: Bugs and Problems, Up: Server Invocation - -2.4 Mouse Types -=============== - -This section of the gpm documentation manual describes the various -pointer types currently available in gpm. If you look at the source -code, you'll find that pointer-specific code is confined to `mice.c' -(while it used to only include mouse decoders, gpm now supports tablets -and touchscreens as well). - - The mouse type is specified on command line with the `-t' option. -The option takes an argument, which represents the name of a mouse -type. Each type can be associated to different names. For old mouse -types, one name is the old selection-compatible name, and another is -the XFree name. After version 1.18.1 of gpm, the number of synonyms was -made arbitrary and the actual name being used is made available to the -function responsible for mouse initialization. Therefore it is possible -for a mouse decoder to behave slightly differently according to the -name being used for the device (if this feature was already present, we -wouldn't have for example ms+ and ms+lr as different mouse types). - - The initialization procedure of each mouse type can also receive -extra option, by means of the -o command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option string -is unused for that mouse type and specifying one generates an error. -When the document refer to "standard serial options" it means that one -of -o dtr, -o rts, -o both can be specified to toggle the control lines -of the serial port. - - The following mouse type are corrently recognized: - -`bare Microsoft' - The Microsoft protocol, without any extension. It only reports two - buttons. If your device has three, you should either try running - the mman decoder or msc. In the latter case, you need to tell the - mouse to talk msc protocol by toggling the DTR and RTS lines (with - one of -o drt, -o rts or -o both) or invoking `gpm -t msc' while - keeping the middle button pressed. Very annoying, indeed. This - mouse decoder accepts standard serial options, although they - should not be needed. - -`ms' - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious packets - which can be misunderstood as middle-button events. If this is - your case, use the `bare' mouse type. Some new two-button devices - are "plug and play", and they don't play fair at all; in this case - try -t pnp. Many (most) three-button devices that use the - microsoft protocol fail to report some middle-button events during - mouse motion. Since the protocol does not distinguish between the - middle button going up and the middle button going down it would - be liable to get out of step, so this decoder declares the middle - button to be up whenever the mouse moves. This prevents dragging - with the middle button, so you should probably use `-t ms+lr' - instead of this decoder, especially if you want to use X. This - mouse decoder accepts standard serial options, although they - should not be needed. - -`ms+' - This is the same as `-t ms' except that the middle button is not - reset during mouse motion. So you can drag with the middle button. - However, if your mouse exhibits the usual buggy behaviour the - decoder is likely to get out of step with reality, thinking the - middle button is up when it's down and vice versa. You should - probably use `-t ms+lr' instead of this decoder. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`ms+lr' - This is the same as `-t ms+' except that there is an additional - facility to reset the state of the middle button by pressing the - other two buttons together. Do this when the decoder gets into a - confused state where it thinks the middle button is up when it's - down and vice versa. (If you get sick of having to do this, please - don't blame gpm; blame your buggy mouse! Note that most - three-button mice that do the microsoft protocol can be made to do - the MouseSystems protocol instead. The "3 Button Serial Mouse - mini-HOWTO" has information about this.) This mouse decoder - accepts standard serial options, although they should not be - needed. - -`msc MouseSystems' - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try -t msc associated - with -o rts, -o dtr or -o both. - -`mman Mouseman' - The protocol used by the new Logitech devices with three buttons. - It is backward compatible with the Microsoft protocol, so if your - mouse has three buttons and works with -t ms or similar decoders - you may try -t mman instead to use the middle button. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`sun' - The protocol used on Sparc computers and a few others. This mouse - decoder accepts standard serial options, although they should not - be needed. - -`mm MMSeries' - Title says it all. This mouse decoder accepts standard serial - options, although they should not be needed. - -`logi Logitech' - This is the protocol used by old serial Logitech mice. - -`bm BusMouse' - Some bus devices use this protocol, including those produced by - Logitech. - -`ps2 PS/2' - The protocol used by most busmice. - -`ncr' - This `type' is able to decode the pointing pen found on some - laptops (the NCR 3125 pen) - -`wacom' - The protocol used by the Wacom tablet. Since version 1.18.1 we - have a new Wacom decoder, as the old one was not working with new - tablets. This decoder was tested with Ultrapad, PenPartner, and - Graphire tablets. Options: -o relative (default) for relative - mode, -o absolute for absolute mode. - -`genitizer' - The \"Genitizer\" tablet, in relative mode. This mouse decoder - accepts standard serial options, although they should not be - needed. - -`logim' - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -`pnp' - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is hardwired - at 1200 baud and is upset by normal initialization, so this is a - -t bare decoder with no initialization at all. This mouse decoder - accepts standard serial options, although they should not be - needed. - -`ms3' - A decoder for the new serial IntelliMouse devices, the ones with - three buttons and a protocol incompatible with older ones. The - wheel is currently unused. - -`imps2' - "IntelliMouse" on the ps/2 port. This type can also be used for a - generic 2-button ps/2 mouse too, since it will auto-detect the - type. - -`netmouse' - Decodes the "Genius NetMouse" type of devices on the ps/2 port. - For serial "Netmouse" devices, use the "ms3" decoder. - -`cal' - A decoder of the "Calcomp UltraSlate device. - -`calr' - Same as above, but in relative mode. - -`twid' - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't yet - support X keycodes. If used with `-R', `gpm' will anyway repeat - mouse events to the X server. More information about twiddler - support can be found in `README.twiddler', in the gpm distribution. - -`syn synaptics' - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although they - should not be needed. - -`synps2 synaptics_ps2' - Same as above, but for the devices attached to the ps2 port. - -`brw' - A decoder for the Fellowes Browser, a device with 4 buttons and a - wheel. This mouse decoder accepts standard serial options, - although they should not be needed. - -`js Joystick' - This mouse type uses the joystick device to generate mouse events. - It is only available if the header `linux/joystick.h' is found at - compile time. The header (and the device as well) has been - introduced only during 2.1 development, and is not present in - version 2.0 of the kernel. - -`summa' - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it can - -R summa can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified xf86Summa.o module. - -`mtouch' - A decoder for the MicroTouch touch screen. Please refer to the - file `README.microtouch' in the source tree of gpm for further - information. In the near future, anyways, I plan to fold back to - this documentation the content of that file. - -`gunze' - A decoder for the gunze touch screen. Please refer to the file - `README.gunze' in the source tree of gpm for further information. - In the near future, anyways, I plan to fold back to this - documentation the content of that file. The decoder accepts the - following options: smooth=, debounce=. An higher smoothness - results in slower motion as well; a smaller smoothness gives - faster motion but, obviously, less smooth. The default smoothness - is 9. The debounce time is express in milliseconds and is the - minimum duration of an up-down event to be taken as a tap. Smaller - bounces are ignored. - -`acecad' - The Acecad tablet in absolute mode. - -`wp wizardpad' - Genius WizardPad tablet - - - -File: gpm.info, Node: Gpm Internals, Next: The ClientLib, Prev: Server Invocation, Up: Top - -3 Gpm Internals -*************** - -The server is organized as a main loop built around a `select()' system -call. It responds both to mouse events and to input from the clients, -which are connected to the server through a unix domain socket. The -connection is used to tell the server what a client is interested in, -and to get mouse events. - - When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most interesting). - -* Menu: - -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: - - -File: gpm.info, Node: Events, Next: Margins, Prev: Gpm Internals, Up: Gpm Internals - -3.1 Events -========== - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual consoles. *Note -Default Handlers::. - - When a client is involved, it is handled a `Gpm_Event' structure, -built by the server. The fields for `Gpm_Event' are the following: - -`unsigned char buttons;' - An or-mask of the values `GPM_B_LEFT', `GPM_B_MIDDLE' and - `GPM_B_RIGHT'. It corresponds to the state of the mouse buttons - when the event is reported. The current implementation of gpm - allows at most three buttons. - -`unsigned char modifiers;' - The value of the kernel variable `shift_state', as of - `keyboard.c', when the event is reported. It is a bitmask value, - and corresponds to the least significant byte of the value used by - the `loadkeys' program. Use of symbolic names in source code is - available after inclusion of `linux/keyboard.h', as exemplified in - `mev.c'. - -`unsigned short vc;' - The number of the active virtual console when the event is - reported. The client is not expected to use this value, which - corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. *Note Default - Handlers::. - -`short x, y;' - The position of the mouse pointer where the event is reported. It - is 1-based by default, to be compatible with `selection' and - `libcurses'. This behavior can be overriden, though, by setting - the library variable `gpm_zerobased'. *Note Variables::. - -`short dx, dy;' - The change in position since the last reported event. - -`enum Gpm_Etype type;' - A bit-mask, representing the type of reported event, as described - later. *Note Event Types::. - -`int clicks;' - A counter, which is valid at button-down, drag or button-up. It - can be 0, 1 or 2 to mean single, double or triple click. - -`enum Gpm_Margin margin;' - A bit-mask, telling if the pointer has gone out of the visible - screen. The indivudual bits are named `GPM_TOP', `GPM_BOT', - `GPM_LFT', `GPM_RGT'. Only one of them is active at a time, to - allow using `switch' on the value. Vertical outrun takes - precedence on horizontal outrun. *Note Margins::. - - -File: gpm.info, Node: Margins, Next: Event Types, Prev: Events, Up: Gpm Internals - -3.2 How margins are managed -=========================== - -Motion and button-press events are constrained to remain within the -visible screen. This means that the `x' will be within 1 and 80 and `y' -will be within 1 and 25 when the console is 80x25 cells. However, a -client can keep track of movements outside the screen, by using the -`dx' and `dy' fields, which aren't subject to clipping. - - The server helps applications in detecting margin conditions by -filling the `margin' field. Whenever the pointer tries to cross screen -boundaries, it is forced to remain on the border, but a flag is set in -`margin'. - - A different policy is in force for drag and button-release events. -In this case the pointer is allowed to go outside the physical screen -by exactly one position. This allows, for example, selecting to end of -line by dragging down-left. The peculiar situation is nonetheless -signaled through the `margin' flags. The client should be careful to -fit the values within the screen if needed. *Note Utility Functions::. - - -File: gpm.info, Node: Event Types, Next: Connection Details, Prev: Margins, Up: Gpm Internals - -3.3 Event Types -=============== - -The `type' field in `Gpm_Event' is made up of bit-wide flags. The -existing bit masks belong to two groups: bare events and cooked events. -The bit-mask `GPM_BARE_EVENTS' is provided to extract bare events, by -and-ing (`&') it with the `type' field. For any event, exactly one bit -will be set in the resulting bitmask. - - Bare events are the following: - -`GPM_MOVE' - A motion event, with all buttons up. - -`GPM_DRAG' - A motion event, but one or more buttons are kept pressed. - -`GPM_DOWN' - A button press event. The `buttons' field will report which - buttons are pressed after the event. - -`GPM_UP' - A button release event. The `buttons' field will report which - buttons are being released. Note that this is different from the - previous case. - -`GPM_ENTER' - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. When the - type is `GPM_ENTER', all the other fields are undefined. *Note - High Level Lib::. - -`GPM_LEAVE' - This is only delivered by the high level library, too. Events of - type `GPM_LEAVE' have all other fields undefined. - - Cooked events are the following: - -`GPM_SINGLE' - This bit may be set at button-press, drag and button release - events, and can be used to identify a single press. The time - interval used to choose a double click from two single clicks is - set by a parameter in the daemon (configurable at daemon - invocation). - -`GPM_DOUBLE' - Used to identify a double click (press, drag, release) - -`GPM_TRIPLE' - Used to identify a triple click (press, drag, release) - -`GPM_MFLAG' - The "motion flag" is true if some dragging happened between - button-press and button-release. It can be used by those - applications which respond to events at button release. It is - available at drag and release. - - -File: gpm.info, Node: Connection Details, Next: Default Handlers, Prev: Event Types, Up: Gpm Internals - -3.4 Connection Details -====================== - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading it. -All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - - In addition to the per-console stacks, another stack is there to -store default-handling clients. *Note Default Handlers::. - - Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - - Clients are required to fill a `Gpm_Connect' structure and pass it -to the server. The structure is made up by four `unsigned int' fields. -*Note Open and Close::. - -`eventMask' - A bitmask of the events the client wants to receive. Both bare and - cooked events are allowed to appear in the mask. - -`defaultMask' - A mask to tell which events allow a default treatment (the - selection one). These are mouse events, independent of the - modifier keys. - -`minMod' - The minimum amount of modifiers required by the client. This field - is used for default-handlers which manage control-mouse events - without interfering with mouse-only ones. *Note Default - Handlers::. - -`maxMod' - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in `maxMod' won't be - passed to the client. - Two more fields are there to tell about the connection itself, and -you're not asked to fill them, because `Gpm_Open' will do it for you. - -`int pid' - The process id of the connecting application. - -`int vc' - Which virtual console to gain control of. - - Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in *note Default Handlers::, but you only -need to choose the right values for your application. - - Examples: -`minMod=0; maxMod=0;' - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -`minMod=0; maxMod=~0;' - is a client which gets any mouse event. - -`minMod=1< /tmp/du" - } - - button 3 { - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - - The syntax for the file won't be described here, being it quite -apparent from the example above. Blanks and newlines are unused in -parsing the file, and the layout of the file is free. Comments are -allowed in the file: any hash mark (`#') found at the beginning of the -line or after white space makes the parser discard anything up to the -next line. To insert quotes (`"') in strings precede them with a -backslash. - - Note that recursive menus are allowed, to any level of recursion. - - Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -`button NUMBER MENU' - The `button' keyword is used to introduce a menu. It is followed - by the number of the relevant button (1=left, 2=middle, 3=right), - an open brace, a menu and a closed brace. A menu is made up of - cfg statements, followed by action statements. Cfg statements can - come in any order, while the order of action statements tells the - actual order in which actions will appear on the screen, top to - bottom. - - The following statements belong to the cfg set. - -`name STRING' - If the `name' keyword is present, the specified STRING will be - used as the name for the current menu. - -`background COLOR' - This statements is used to specify the background color to be used - in the current menu. The COLOR can be specified with one of the - eight canonical strings `black', `red', `cyan' etc. The background - defaults to black. - -`foreground COLOR' - This statements is used to specify the foreground color for menu - items. Its value defaults to `white'. An optional `bright' - keyword can appear before the actual color. - -`border COLOR' - `border' is used to specify the border color for the menu. Its - value defaults to `white'. An optional `bright' keyword can - appear before the actual color. - -`head COLOR' - `head' is used to specify the foreground color for the title of - the menu. Its value defaults to `white'. An optional `bright' - keyword can appear before the actual color. - - The following statements belong to the action set. - -`STRING f.fgcmd CMDSTRING' - When the mouse button is released above the corresponding menu - item, the CMDSTRING is pasted in the keyboard queue of the current - console. This is not yet implemented. - -`STRING f.bgcmd CMDSTRING' - When the mouse button is released above the corresponding menu - item, a shell (`/bin/sh') is forked to execute the specified - command, with `stdin' connected to `/dev/null', and `stdout', - `stderr' connected to the active console. - -`STRING f.jptty TTYNUMBER' - When the mouse button is released above the corresponding menu - item, the console is switched to the one specified. The TTYNUMBER - must be specified as a string. Any tty can be reached this way, - even those which are not accessible via the keyboard. - -`STRING f.mktty TTYNUMBER' - When the mouse button is released above the corresponding menu - item, an unused console is selected, and `/sbin/mingetty' is - executed in it. The current console is switched to the newly - opened console. I use this command to save kernel memory by - opening a single console through `/etc/inittab' and requesting the - others only when i need to login. - -`STRING WHOLE-MENU' - A menu can directly follow the label string. When the mouse - pointer leaves the menu frame at the level of STRING, a second - menu is posted on screen. - -`STRING f.lock' - When the mouse button is released above the corresponding menu - item, the keyboard and the screen are locked, and only the locking - user or the superuser can unlock them. This is not yet implemented. - -`STRING f.load' - The current loadavg when the menu is posted is concatenated to - STRING to build the actual message displayed on screen. Nothing - happens at button release. - -`STRING f.free' - The free memory and swap when the menu is posted is concatenated - to STRING to build the actual message displayed on screen. Nothing - happens at button release. - -`STRING f.time' - The current time is formatted with strftime(3), according to - STRING. The resulting string is the actual message displayed on - screen. Nothing happens at button release. - -`STRING f.pipe CMDLINE' - When the mouse pointer leaves the menu frame at the level of - STRING, a message box is posted on screen showing the last ten - lines of the output of CMDLINE. CMDLINE is executed by `/bin/sh'. - This is not yet implemented. - -`STRING f.nop' - This does nothing, it only displays STRING on the menu. - - The `HOME', `LOGNAME' and `USER' environment variables are setup to -the values for the invoking user before spawning an external process -(`f.bgcmd', `f.pipe'). The current directory is always `/'. - - Known bugs have been fixed. In particular, if you invoke `gpm-root' -right after `gpm', it will delay a few seconds before trying to connect -to the daemon. - - -File: gpm.info, Node: hltest, Next: mouse-test, Prev: gpm-root, Up: Demo Clients - -5.5 `hltest' -============ - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - - The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help in -understanding the internal workings. - - -File: gpm.info, Node: mouse-test, Prev: hltest, Up: Demo Clients - -5.6 `mouse-test' -================ - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between `-t ms' (three-buttons aware) and `-t -bare' old two-buttons-only serial mice. - - I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -File: gpm.info, Node: Type Index, Next: Function Index, Prev: Demo Clients, Up: Top - -Type Index -********** - -[index] -* Menu: - -* Gpm_Connect: Connection Details. (line 26) -* Gpm_Event: Events. (line 13) -* Gpm_Handler: Handling Functions. (line 11) -* Gpm_roi: Concepts. (line 12) - - -File: gpm.info, Node: Function Index, Next: Variable Index, Prev: Type Index, Up: Top - -API Index -********* - -[index] -* Menu: - -* Gpm_CharsQueued: Getting Events. (line 17) -* Gpm_Close: Open and Close. (line 34) -* GPM_DRAWPOINTER: Utility Functions. (line 14) -* Gpm_DrawPointer: Utility Functions. (line 13) -* Gpm_FitEvent: Utility Functions. (line 25) -* Gpm_FitValues: Utility Functions. (line 24) -* Gpm_FitValuesM: Utility Functions. (line 23) -* Gpm_Getc: Getting Events. (line 31) -* Gpm_Getch: Getting Events. (line 42) -* Gpm_Getchar: Getting Events. (line 32) -* Gpm_GetEvent: Getting Events. (line 7) -* Gpm_GetLibVersion: Extra Functions. (line 7) -* Gpm_GetServerVersion: Extra Functions. (line 16) -* Gpm_GetSnapshot: Extra Functions. (line 29) -* Gpm_HandleRoi: hl-Functions. (line 40) -* Gpm_LowerRoi: hl-Functions. (line 34) -* Gpm_Open: Open and Close. (line 7) -* Gpm_PopRoi: hl-Functions. (line 25) -* Gpm_PushRoi: hl-Functions. (line 8) -* Gpm_RaiseRoi: hl-Functions. (line 29) -* Gpm_Repeat: Utility Functions. (line 7) -* Gpm_UseRoi: hl-Functions. (line 20) -* Gpm_Wgetch: Getting Events. (line 41) - - -File: gpm.info, Node: Variable Index, Prev: Function Index, Up: Top - -Variable Index -************** - -[index] -* Menu: - -* gpm_current_roi: hl-Variables. (line 11) -* gpm_data: Variables. (line 44) -* gpm_fd: Variables. (line 16) -* gpm_flag: Variables. (line 9) -* gpm_handler: Variables. (line 44) -* gpm_hflag: Variables. (line 40) -* gpm_morekeys: Variables. (line 48) -* gpm_mx: Variables. (line 30) -* gpm_my: Variables. (line 30) -* gpm_roi: hl-Variables. (line 7) -* gpm_roi_data: hl-Variables. (line 20) -* gpm_roi_handler: hl-Variables. (line 17) -* gpm_tried: Variables. (line 12) -* gpm_visiblepointer: Variables. (line 26) -* gpm_zerobased: Variables. (line 20) - - - -Tag Table: -Node: Top1250 -Node: Overview1483 -Node: Building the Release3258 -Node: Server Invocation3679 -Node: Special Commands4867 -Node: Command Line7280 -Node: Bugs and Problems13886 -Node: Mouse Types14757 -Node: Gpm Internals24599 -Node: Events25477 -Node: Margins27957 -Node: Event Types29075 -Node: Connection Details31086 -Node: Default Handlers35086 -Node: The ClientLib36659 -Node: Handling Functions37340 -Node: Low Level Library40205 -Node: Variables40698 -Node: Open and Close42796 -Node: Getting Events44769 -Node: Utility Functions47008 -Node: Extra Functions48591 -Node: High Level Lib51013 -Node: Concepts51961 -Node: hl-Variables53357 -Node: hl-Functions54028 -Node: Xterm56557 -Node: Demo Clients57675 -Node: mev57905 -Node: sample/rmev61117 -Node: Emacs Support61620 -Node: gpm-root63722 -Node: hltest72077 -Node: mouse-test72544 -Node: Type Index73057 -Node: Function Index73485 -Node: Variable Index75300 - -End Tag Table diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/infofilter b/software/gpm/browse_source/gpm-1.20.4/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/manpager b/software/gpm/browse_source/gpm-1.20.4/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/mktxt b/software/gpm/browse_source/gpm-1.20.4/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/old/Changelog b/software/gpm/browse_source/gpm-1.20.4/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.20.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.20.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/support/README b/software/gpm/browse_source/gpm-1.20.4/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.4/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.4/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.4 deleted file mode 100644 index 51ac3a38..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.4 +++ /dev/null @@ -1 +0,0 @@ -- soname fix diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.5 deleted file mode 100644 index 91fee450..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.5 +++ /dev/null @@ -1,6 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs -- add gitversion as found in gpm2! -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c -- add report success diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.3 deleted file mode 100644 index d7630018..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.3 +++ /dev/null @@ -1,5 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c -- check for rmev (1.19.6 or 1.17.8) diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.4 deleted file mode 100644 index 16a89d5c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- cleanup autoconf stuff diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.7 deleted file mode 100644 index 66b67515..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.7 +++ /dev/null @@ -1,4 +0,0 @@ -- first vertical prototype: have on mouse input running -- Add buildtest for gpm1 and gpm2 - in ~/temp/gpm, based on the tar - -> fix release errors diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.20.4/install-sh b/software/gpm/browse_source/gpm-1.20.4/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.4/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.4/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.4/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.4/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/Makefile b/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/Makefile deleted file mode 100644 index cfb65333..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Makefile for a basic kernel module - -CC=gcc - -#MODCFLAGS := -Wall -DMODULE -D__KERNEL__ -DLINUX -MODCFLAGS := -D__KERNEL__ -I/usr/src/linux-2.3.99-pre6/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -march=i586 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.3.99-pre6/include/linux/modversions.h - - -touchscreen.o: touchscreen.c /usr/include/linux/version.h - $(CC) $(MODCFLAGS) -c touchscreen.c - -audio.o: audio.c /usr/include/linux/version.h - $(CC) $(MODCFLAGS) -c audio.c diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.4/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.4/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.4/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.4/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.4/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.4/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.4/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.20.4/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.20.4/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.4/scripts/gpm.release deleted file mode 100644 index 963e0c6d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/scripts/gpm.release +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(awk -F= '/^release=/ { print $2 }' configure.in )" -#VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo -n "=> Version: $VERSION; ok?" -read ok -#echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.4/scripts/report_success.sh b/software/gpm/browse_source/gpm-1.20.4/scripts/report_success.sh deleted file mode 100644 index ab66ae70..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/scripts/report_success.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-ccollect at schottelius.org) -# -# This file is part of ccollect. -# -# ccollect 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 3 of the License, or -# (at your option) any later version. -# -# ccollect 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 ccollect. If not, see . -# -# Sends feedback -# -# Adapted for gpm -# - -software="gpm" -author="Nico Schottelius" -subject="==> success: $software" -to="nico-gpm-success" -host="schottelius.org" -fullto="${to}@${host}" - -info="$(awk -F= '/^release=/ { print $2 }' configure.in; uname -s -v -r -m)" - - -echo "Reporting success for $software to ${author}" -echo "-----------------" -echo -n "Your name (leave free for anonymous): " -read name -echo -n "Your email (leave free for anonymous): " -read email -echo -n "Your normal gpm parameters (-m -t -o ...): " -read params -echo -n "Comment (leave free for no comment): " -read comment - -echo "" -echo "The following information will be send to ${author}:" -echo "" - -cat << eof -Name: $name (will be used to contact you and kept secret) -E-Mail: $email (will be used to contact you and kept secret) -Comment: $comment -Info: $info -Parameters: $params - -eof - -echo -n "Is it ok to send out that mail (press enter to send or ctrl-c to abort)? " -read yes - -cat << eof | mail -s "$subject" "$fullto" -Name: $name -E-Mail: $email -Comment: $comment -Info: $info -Parameters: $params -eof - -echo "Send. Thank you for your feedback." diff --git a/software/gpm/browse_source/gpm-1.20.4/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.4/src/Makefile.in deleted file mode 100644 index 816ce43d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/Makefile.in +++ /dev/null @@ -1,189 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/header.c daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c \ - prog/display-buttons.c prog/display-coords.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) -Iheaders @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/libgpm.so.@abi_lev@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ; \ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ ; \ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ; \ - echo "Or to update everything just type ldconfig" ; \ - fi -# The unversioned files seems to be not needed -> correct me, if I am wrong. -# && $(LN_S) -f libgpm.so.@abi_lev@ libgpm.so ; \ - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# Configure & unconfigure - -Makefile: Makefile.in - $(top_builddir)/config.status Makefile - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so.@abi_lev@ - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so.@abi_lev@ - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so.@abi_lev@ - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so.@abi_lev@: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so.@abi_lev@ -# unneeded, isn't it? -#lib/libgpm.so: lib/libgpm.so.@abi_full@ -# $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) - -## Release / Dist - - -## Cleanup -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so.* $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c prog/open_console.o - -distclean: clean - rm -f headers/config.h headers/drivers.h \ - Makefile $(DEPFILE) - -allclean: clean - rm -f headers/config.h.in diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/cmdline.c deleted file mode 100644 index 66c8ecc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm.c deleted file mode 100644 index 33a1b20a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/header.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/main.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/main.c deleted file mode 100644 index b1ceda6e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - -#include "headers/daemon.h" -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/processconn.c deleted file mode 100644 index 646acdc0..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/processmouse.c deleted file mode 100644 index b3f3994e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/processmouse.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/processrequest.c deleted file mode 100644 index 309834c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/startup.c deleted file mode 100644 index 1d00255d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/startup.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* log to debug, who we are */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_VERSION); - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if (option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - if (daemon(0,0)) - gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - - option.run_status = GPM_RUN_DAEMON; /* child */ - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.20.4/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/drivers/README b/software/gpm/browse_source/gpm-1.20.4/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.20.4/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.20.4/src/generic/getsym.c deleted file mode 100644 index 5a667fa2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/generic/getsym.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -extern int isodigit(const unsigned char c); - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.20.4/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/Makefile b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/Makefile deleted file mode 100644 index 6b8ac786..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/Makefile +++ /dev/null @@ -1,136 +0,0 @@ -# -# cinit -# -# Nico Schottelius -# -# Don't edit Makefiles, use conf/* for configuration. -# - -#include Makefile.tests - -# Build tools / locations -CC=./tmp/cc -CFLAGS= -LD=./tmp/ld -LDFLAGS= -STRIP=./tmp/strip -SBIN=../sbin - -# directories and files -CONFIG_H=include/config.h - -BIN=cinit - -# -# End user targets -# -all: out/gpm2-daemon - - -# -# All objects depend on headers. -# -GPM2_DAEMON_HEADERS=$(shell cat deps/gpm2-daemon-headers) - - -# -# Objects -# - -GPM2_DAEMON_OBJECTS=$(shell cat deps/gpm2-daemon) -$(GPM2_DAEMON_OBJECTS): $(GPM2_DAEMON_HEADERS) - -GPM2_DAEMON_PROTOCOLS=$(shell cat tmp/protocol-deps) - -CLIENT= - -COMMUNICATION= - -OBJ= - -# -# Programs -# - -out/gpm2-daemon: $(GPM2_DAEMON_OBJECTS) $(GPM2_DAEMON_PROTOCOLS) - $(LD) -o $@ $^ - - -# -# Generic -# - -%.o: %.c .configured - $(CC) -c -o $@ $< - - - -# -# First do configuration, so we include the right variables -# -Makefile: .configured - -.configured: conf/* - @./scripts/generate_cbuiltconfig.sh conf - -$(CINIT_OBJ): $(CONFIG_H) - - -$(CONFIG_H): ../conf/* - ../scripts/cinit.mkheader > $(CONFIG_H) - -cservice: $(SBIN)/cservice - -$(SBIN)/cservice util/cservice: $(SBIN) $(CSVC_OBJ) - $(LD) $(LDFLAGS) $(CSVC_OBJ) -o $@ - $(STRIP) $@ - -ccontrol: $(SBIN)/ccontrol - -$(SBIN)/ccontrol util/ccontrol: config.h $(SBIN) $(CCO_OBJ) - $(LD) $(LDFLAGS) $(CCO_OBJ) -o $@ - $(STRIP) $@ - -install: install-dir cinit cservice ccontrol - @echo '*** Installing cinit ***' - ./bin/cinit.install.binary - -install-miniconf: - ./bin/cinit.install.miniconf - -install-dir: - ./bin/cinit.install.dir - - -################################################################################ -# -# Build targets -# -cinit: $(CINIT_OBJ) - $(LD) $^ -o $@ - -uml: cinit - ../../vm/uml/uml-mount.sh - cp cinit ../../vm/uml/root/sbin/cinit - ../../vm/uml/uml-umount.sh - -umlstart: uml - ../../vm/uml/uml-start.sh - -################################################################################ -# -# Generic targets -# - -.PHONY: dist -dist: distclean - -.PHONY: distclean -distclean: clean - rm -f os/current ipc/current .configured - -.PHONY: clean -clean: - rm -f ../tmpbin/*.configured - rm -f $(BIN) $(CINIT_OBJ) - rm -f test/*.o diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/tmp/README b/software/gpm/browse_source/gpm-1.20.4/src/gpm2/tmp/README deleted file mode 100644 index 30214bfd..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/gpm2/tmp/README +++ /dev/null @@ -1 +0,0 @@ -Directory for temporarily created files. diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/config.h.in b/software/gpm/browse_source/gpm-1.20.4/src/headers/config.h.in deleted file mode 100644 index 65f98d0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/config.h.in +++ /dev/null @@ -1,112 +0,0 @@ -/* src/headers/config.h.in. Generated from configure.in by autoheader. */ - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* GPM release number as a string */ -#undef GPM_RELEASE - -/* release date as a string */ -#undef GPM_RELEASE_DATE - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_INPUT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_JOYSTICK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_MAJOR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_TTY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_CURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `syslog' function. */ -#undef HAVE_SYSLOG - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYSLOG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSMACROS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vsyslog' function. */ -#undef HAVE_VSYSLOG - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h - */ -#undef HAVE___U32 - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.20.4/src/headers/daemon.h deleted file mode 100644 index a8936ad4..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/daemon.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.4/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.4/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.4/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.4/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.4/src/headers/message.h deleted file mode 100644 index 3e60b5c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE " " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mice. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.4/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.4/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.4/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.4/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.4/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.4/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.4/src/lib/liblow.c deleted file mode 100644 index 25a1d5c4..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/lib/liblow.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.4/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.4/src/lib/report-lib.c deleted file mode 100644 index 812fdb8e..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/lib/report-lib.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/mice.c b/software/gpm/browse_source/gpm-1.20.4/src/mice.c deleted file mode 100644 index dacee347..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/mice.c +++ /dev/null @@ -1,2509 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.4/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/prog/display-buttons.c b/software/gpm/browse_source/gpm-1.20.4/src/prog/display-buttons.c deleted file mode 100644 index de8e5b25..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/prog/display-buttons.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-buttons -lgpm display-buttons.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * left/middle/right button - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": p=%d, l=%1d, m=%1d, r=%1d, clicks=%d\n", - event->type & GPM_DOWN, - event->buttons & GPM_B_LEFT, - event->buttons & GPM_B_MIDDLE, - event->buttons & GPM_B_RIGHT, - event->clicks); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_DRAG | GPM_DOWN | GPM_UP; - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - printf("\tp=pressed (0=release)\n\tl=left\n\tm=middle\n\tr=right\n"); - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/prog/display-coords.c b/software/gpm/browse_source/gpm-1.20.4/src/prog/display-coords.c deleted file mode 100644 index ed15c8a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/prog/display-coords.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-coords -lgpm display-coords.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * x/y coords on the screen - * dx, dy: deltas - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_MOVE; /* read only moves */ - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.4/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.4/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.4/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.4/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.20.4/src/prog/open_console.c deleted file mode 100644 index 4a9d0bdc..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/prog/open_console.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/report.c b/software/gpm/browse_source/gpm-1.20.4/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.4/src/synaptics.c b/software/gpm/browse_source/gpm-1.20.4/src/synaptics.c deleted file mode 100644 index ba98fd1d..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/synaptics.c +++ /dev/null @@ -1,3320 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - if (stick_pressure_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_stick_buttons; - if (tmp_buttons || last_stick_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - last_stick_buttons = tmp_buttons; - } - } - if (four_way_button_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_4_way_buttons; - if (tmp_buttons || last_4_way_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - last_4_way_buttons = tmp_buttons; - } - } - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/tools.c b/software/gpm/browse_source/gpm-1.20.4/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.20.4/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.4/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.20.4/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/.gitignore b/software/gpm/browse_source/gpm-1.20.5/.gitignore deleted file mode 100644 index b794daab..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/.gitignore +++ /dev/null @@ -1,58 +0,0 @@ -.depend -*.o -*.lo -*.a -*.d -*.P -.*.swp - -Makefile -Makefile.include -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/config - -/contrib/Makefile - -/src/headers/config.h -/src/headers/config.h.in -/src/headers/drivers.h -/src/prog/gpm-root.c -/src/subdirs-exist -/src/headers/config.h.in -/src/gpm -/src/gpm2/tmp -/src/gpm2/out -/src/lib/libgpm.so.* -/src/prog/disable-paste -/src/prog/display-buttons -/src/prog/display-coords -/src/prog/gpm-root.c -/src/prog/gpm-root -/src/prog/get-versions -/src/prog/hltest -/src/prog/mev -/src/prog/mouse-test -/src/Makefile.drivers.generated -/src/subdirs-exist - -/doc/doc.gpm -/doc/gpm-root.1 -/doc/gpm-types.7 -/doc/gpm.8 -/doc/gpm.info -/doc/gpm.man -/doc/mev.1 -/doc/mouse-test.1 - -/.gitversion - -# gpm2 -/gpm2/out/* -/gpm2/tmp/* -/src/gpm2 -/.gitversion.m4 -/.releasedate diff --git a/software/gpm/browse_source/gpm-1.20.5/BUGS b/software/gpm/browse_source/gpm-1.20.5/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.5/COPYING b/software/gpm/browse_source/gpm-1.20.5/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.5/Changes b/software/gpm/browse_source/gpm-1.20.5/Changes deleted file mode 100644 index f98835f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/Changes +++ /dev/null @@ -1 +0,0 @@ -Can now be found in doc/changes/* diff --git a/software/gpm/browse_source/gpm-1.20.5/MANIFEST b/software/gpm/browse_source/gpm-1.20.5/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.5/Makefile.in b/software/gpm/browse_source/gpm-1.20.5/Makefile.in deleted file mode 100644 index 0be7784e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/Makefile.in +++ /dev/null @@ -1,186 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - - -versionfiles = .gitversion .gitversion.m4 .releasedate -dotfiles = .gitignore .git/HEAD $(versionfiles) -distfiles = configure - -# regen, if it changed; ignore if git is missing / fails -versioncheck: - @v1="$$(git-describe 2>/dev/null)"; \ - if [ -z "$$v1" ]; then \ - echo "No git available, not updating version"; \ - exit 0; \ - fi; \ - v2="$$(cat .gitversion)"; \ - if [ "$$v1" != "$$v2" ]; then \ - echo "updating versionfiles"; \ - date="$$(date +%Y%m%d\ %T\ %z)"; \ - version="$$v1"; \ - echo "define([AC_PACKAGE_VERSION], [$${version} $${date}])" > .gitversion.m4; \ - echo "$${version}" > .gitversion; \ - echo "$${date}" > .releasedate; \ - fi - -$(versionfiles): .git/HEAD versioncheck - -aclocal.m4: acinclude.m4 - $(MKDIR) config - aclocal -I config - -configure: configure.ac aclocal.m4 $(versionfiles) - libtoolize --force --copy - autoheader - autoconf - -config.status: configure - if [ -f config.status ]; then $(SHELL) ./config.status --recheck; \ - else $(SHELL) ./configure; fi - -Makefile: config.status $(srcdir)/Makefile.in Makefile.include - ./config.status -Makefile.include: config.status $(srcdir)/Makefile.include.in - ./config.status - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x$(ELISP)" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -### RELEASE STUFF -TARS =../gpm-$(release).tar.gz -TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=$(D_BASE)/archives/ -D_SOURCE=$(D_BASE)/browse_source/ - -M_HOST=arcana.linux.it -M_DIR=gpm/ - -tars: $(TARS) - -# configure headers, produce new configure script -distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles) - -../gpm-$(release).tar: $(srcdir) distclean distconf - # no exclude possible of .git with pax it seems, so the following is not possible: - #pax -w -x ustar -s '/^\./gpm-$(release)/' -w . -f $@ - pax -w -x ustar -s ';^;gpm-$(release)/;' -f $@ -w $(dotfiles) * - -../gpm-$(release).tar.gz: ../gpm-$(release).tar - gzip -9 -c $< > $@ - -../gpm-$(release).tar.bz2: ../gpm-$(release).tar - bzip2 -9 -c $< > $@ - -../gpm-$(release).tar.lzma: ../gpm-$(release).tar - lzma -9 -c $< > $@ - -# 3. Put package together into .tar.gz and .tar.bz2 -#dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz -dist: disttest distclean distconf nicotest $(TARS) - chmod 0644 $(TARS) - scp $(TARS) $(D_HOST):$(D_DIR) - scp $(TARS) $(M_HOST):$(M_DIR) - ssh "$(D_HOST)" "tar xvfz $(D_DIR)/gpm-$(release).tar.gz -C $(D_SOURCE)" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type f -exec chmod 0644 {} \\;" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type d -exec chmod 0755 {} \\;" - - -### TEST: on nicos machine: not to be used anywhere else currently -# create / update configure, delete other parts from earlier build -disttest: distconf clean - ./configure - make all - -TESTBUILDDIR=~/temp/gpm-build-test -nicotest: $(TARS) - rm -rf $(TESTBUILDDIR) - mkdir -p $(TESTBUILDDIR) - cp $(TARS) $(TESTBUILDDIR) - cd $(TESTBUILDDIR); tar xvfj gpm-$(release).tar.bz2; - cd $(TESTBUILDDIR)/gpm-$(release); ./configure && make && ./src/gpm -v - -### CLEANUP -distclean: clean do-clean do-distclean - rm -f config.log config.status* config.cache Makefile Makefile.include - rm -rf autom4te.cache - rm -f src/$(DEPFILE) - -allclean: do-allclean distclean - rm -f configure $(versionfiles) aclocal.m4 diff --git a/software/gpm/browse_source/gpm-1.20.5/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.5/Makefile.include.in deleted file mode 100644 index 6382bba5..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/Makefile.include.in +++ /dev/null @@ -1,70 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# autconf wants this, otherwise issues this warning: -# config.status: WARNING: Makefile.include.in seems to ignore the --datarootdir setting -datarootdir = @datarootdir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.5/README b/software/gpm/browse_source/gpm-1.20.5/README deleted file mode 100644 index 03bb8b23..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/README +++ /dev/null @@ -1,334 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001-2008 nico-gpm2008 at schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== REPORT SUCCESS - -As it is always nice to see as an author of FOSS that the software is -used and alive und which options are used, you can send a success -report to me via ./scripts/report_success.sh. - - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit - http://lists.linux.it/listinfo/gpm - -or send a message with "subscribe" in its body to - gpm-request@lists.linux.it. - -For example: - echo subscribe | mail gpm-request@lists.linux.it - - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following place: - - http://unix.schottelius.org/gpm/archives/ - http://unix.schottelius.org/gpm/browse_source/ - - Mirror: - - ftp://arcana.linux.it/pub/gpm/ - http://www.ar.linux.it/pub/gpm/ - -The homepage of gpm can be found at - - http://unix.schottelius.org/gpm/ - -You can get the latest development tree of gpm via git: - - git-clone http://unix.schottelius.org/git/gpm - -There are three branches available: - - master: Contains the latest gpm1 code, may be broken. - gpm-1-stable: Contains the latest stable source code. - gpm-2-dev: Contains work that heads to gpm2. - -You can browse the git-tree via gitweb: - - http://unix.schottelius.org/cgi-bin/gitweb.cgi?p=gpm;a=summary - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.5/README.gpm2 b/software/gpm/browse_source/gpm-1.20.5/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.5/README.versions b/software/gpm/browse_source/gpm-1.20.5/README.versions deleted file mode 100644 index d4d5f0e4..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/README.versions +++ /dev/null @@ -1,29 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions: no new features. - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code. - includes new features. - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.5/TODO b/software/gpm/browse_source/gpm-1.20.5/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.5/acinclude.m4 b/software/gpm/browse_source/gpm-1.20.5/acinclude.m4 deleted file mode 100644 index 8e9d9192..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/acinclude.m4 +++ /dev/null @@ -1,75 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN([ITZ_SYS_ELF], -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN([ITZ_PATH_SITE_LISP], -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN([ITZ_CHECK_TYPE], -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) - -# -# Fix autoconf: They don't allow shell variables in AC_INIT -# So we have to define them via m4 to be accepted.... -# -# What I simply wanted todo is -# -# AC_INIT([gpm],["$revgit"],[http://unix.schottelius.org/gpm/]) -# -# As neither -# -# revgit="`cat $srcdir/.gitversion`" -# m4_define([AC_PACKAGE_VERSION], [$revgit]) -# -# nor -# -# m4_define([AC_PACKAGE_VERSION], include(.gitversion)) -# -# work, I generate an m4 define in .gitversion, which is called by -# autogen.sh: -# -# [13:59] denkbrett:gpm% cat .gitversion -# define([AC_PACKAGE_VERSION], [1.99.6-83-gd80571b 20080611 13:56:54 +0200]) -# -# This works in general, because if AC_PACKAGE_VERSION is set before running -# AC_INIT, it will not overwrite it, as seen in /usr/share/autoconf/autoconf/general.m4: -# -# m4_ifndef([AC_PACKAGE_VERSION], -# [m4_define([AC_PACKAGE_VERSION], [$2])]) -# -# -# So effectively, to change the version of gpm to something dynamically, it goes this way: -# -# autogen.sh -> .gitversion -> acinclude.m4 -> auto* -> configure.ac -> configure -# -# Perhaps someone could simply this a bit? -# - -m4_include(.gitversion.m4) diff --git a/software/gpm/browse_source/gpm-1.20.5/autogen.sh b/software/gpm/browse_source/gpm-1.20.5/autogen.sh deleted file mode 100644 index e7d076ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/autogen.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -e - -set -x - -[ -d config ] || mkdir config - -# -# Generate version in m4 format, because the following two in acinclude.m4 -# do not work: -# -# revgit="`cat $srcdir/.gitversion`" -# m4_define([AC_PACKAGE_VERSION], [$revgit]) -# -# and -# m4_define([AC_PACKAGE_VERSION], include(.gitversion)) -# -version="$(git-describe)" -date="$(date +%Y%m%d\ %T\ %z)" -echo "define([AC_PACKAGE_VERSION], [${version} ${date}])" > .gitversion.m4 -echo "${version}" > .gitversion -echo "${date}" > .releasedate - -${ACLOCAL-aclocal} -I config -${LIBTOOLIZE-libtoolize} --force --copy -${AUTOHEADER-autoheader} -${AUTOCONF-autoconf} diff --git a/software/gpm/browse_source/gpm-1.20.5/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.20.5/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/build-from-git.sh b/software/gpm/browse_source/gpm-1.20.5/build-from-git.sh deleted file mode 100644 index 7c40be9e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -./autogen.sh && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.20.5/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.5/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.5/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.5/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.5/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.5/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.5/configure.ac b/software/gpm/browse_source/gpm-1.20.5/configure.ac deleted file mode 100644 index 97b2f0d8..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/configure.ac +++ /dev/null @@ -1,154 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_PREREQ(2.61) - - -AC_INIT([gpm],["version-set-in-.gitversion-via-acinclude.m4"],[http://unix.schottelius.org/gpm/]) - -AC_CONFIG_SRCDIR([src/daemon/main.c]) -AC_CONFIG_AUX_DIR([config]) -AC_CONFIG_HEADER([src/headers/config.h]) - -AC_CANONICAL_HOST - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -# -# Versioning stuff -# -abi_lev="2" -abi_age="1" -abi_rev="0" -abi_full="${abi_lev}.${abi_age}.${abi_rev}" - -AC_DEFINE_UNQUOTED([GPM_ABI_LEV], [$abi_lev], [Library level]) -AC_DEFINE_UNQUOTED([GPM_ABI_AGE], [$abi_age], [Library age]) -AC_DEFINE_UNQUOTED([GPM_ABI_REV], [$abi_rev], [Library revision]) -AC_DEFINE_UNQUOTED([GPM_ABI_FULL],["$abi_full"],[Full library version]) - -releasedate="`cat $srcdir/.releasedate`" -release="`cat $srcdir/.gitversion`" - - -# -# Find programs -# - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -# Header-checks -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -# Required headers -AC_CHECK_HEADERS(sys/socket.h,,[AC_MSG_ERROR([Required header file missing])]) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32, 1, [define if the __u32 type exists either in sys/types.h or in linux/types.h]) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) -AC_SUBST(AC_PACKAGE_VERSION) -AC_SUBST(release) -AC_SUBST(release_date) - -CPPFLAGS="$CPPFLAGS "'-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" -D_GNU_SOURCE' -LDFLAGS="$LDFLAGS "'-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.5/contrib/Makefile.in deleted file mode 100644 index af9a7ce4..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc Makefile diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.5/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.5/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.5/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/other/README b/software/gpm/browse_source/gpm-1.20.5/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.5/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/Announce b/software/gpm/browse_source/gpm-1.20.5/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/FAQ b/software/gpm/browse_source/gpm-1.20.5/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.5/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.5/doc/Makefile.in deleted file mode 100644 index 709fa6d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/Makefile.in +++ /dev/null @@ -1,190 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -$(MANPAGES): gpm.man -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -## CLEANUP section -# normal cleanup -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# for creating distribution -distclean: clean - rm -f Makefile doc.gpm - -# to even remove things we leave for end-users -allclean: distclean - rm -f gpm.info - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -## DIST section -# when we cleaned it, we can securely copy us. -dist: distclean - # unneeded now: using pax + -s option and create tars in .. - #$(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.5/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.5/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.5/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.5/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.5/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.5/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.20.4 b/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.20.4 deleted file mode 100644 index e3d96da0..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.20.4 +++ /dev/null @@ -1,4 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos - * Added automatic local build test - * Fixed SONAME (praise the Debian guys, Jonathan Nieder) diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.20.5 b/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.20.5 deleted file mode 100644 index 0f96524f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.20.5 +++ /dev/null @@ -1,13 +0,0 @@ -Released: 16th of June 2008 -Changes: - * Fix possible segfault (FD_SET/negative) (Guillem Jover) - * Move more messages to debug (Jonathan Nieder) - * Remove unecessary headers (Jonathan Nieder) - * Allow specifying ELISP variable on commandline (Ulrich Mueller) - * Fix broken code semantics (Mike Frysinger) - * Cleanup documentation (Nico Schottelius) - * Fix socklen_t issue: Require posix header (Mike Frysinger/Nico Schottelius) - * Fix building with glibc 2.8 (Mike Frysinger) - * Updated library to version 2.1.0 (Nico Schottelius) - Gpm_GetLibVersion behaves more consistent (all numbers are one or two digits) - * Including dynamically generated version from git (Nico Schottelius) diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.99.6 b/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.99.6 deleted file mode 100644 index afe22868..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/changes/1.99.6 +++ /dev/null @@ -1,11 +0,0 @@ -2008-04-29: Nico Schottelius - * Merge changes from 1.20.3pre6 and 1.20.3 - * Make it compile again on Linux/ppc (-Werror broke it) (acrux) - * Add initial evabs documentation (name missing) - * Update much autoconf stuff, do not use acconfig.h anymore - * Add bugfixes (possible segfault) and cleanups (Bernhard Fischer) - * Whitespace cleanup (Bernhard Fischer) - * Fix memory clobbering in synaptics code (Pavel Semerad) - * Makefile and documentation updates (Mike Frysinger) - * Include automatic generation of checksum - * Include release date and git version diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/changes/gpm-1-before-1.20.4 b/software/gpm/browse_source/gpm-1.20.5/doc/changes/gpm-1-before-1.20.4 deleted file mode 100644 index 2b2ece56..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/changes/gpm-1-before-1.20.4 +++ /dev/null @@ -1,66 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos - - pre1: - Possibly merge changes from 1.99.x to get tree up-to-date again - -* From 1.20.1 to 1.20.3: (bugfix/code cleanup) - o Applied many cleanups - o Added etouch support - o Added scripts/report_success.sh - o Updated README - - pre6: - Cleaned up "make dist" target - Added two debbugging programs: - src/prog/display-buttons.c: display pressed buttons - src/prog/display-coords.c: display mouse coordinates - Fixed Bug#474516: gpm: debug messages in syslog (Debian) - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/changes/gpm-2-before-1.99.6 b/software/gpm/browse_source/gpm-1.20.5/doc/changes/gpm-2-before-1.99.6 deleted file mode 100644 index ddfa4280..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/changes/gpm-2-before-1.99.6 +++ /dev/null @@ -1,13 +0,0 @@ -1.99.6: - * Merge changes from 1.20.3pre6 and 1.20.3 - * Make it compile again on Linux/ppc (-Werror broke it) - * Add initial evabs documentation - * Update autoconf stuff, do not use acconfig.h anymore - * Add bugfixes (possible segfault) and cleanups from Bernhard Fischer -1.99.5: Nico Schottelius, 20080401 - * Removed all compiling warnings: -Werror, -Wall, -Wextra are on! -1.99.4: Nico Schottelius, 20080330 - * Complete splitoff of mice.c! - * Renamed conf/ to example-configurations -1.99.3: Nico Schottelius, 20080326 - * Added evabs support diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.5/doc/doc.gpm.in deleted file mode 100644 index 0dafb316..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/doc.gpm.in +++ /dev/null @@ -1,2296 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001-2008 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). Text-mode (non-X) mouse library and server daemon. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001-2008 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for me to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/infofilter b/software/gpm/browse_source/gpm-1.20.5/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/manpager b/software/gpm/browse_source/gpm-1.20.5/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/mktxt b/software/gpm/browse_source/gpm-1.20.5/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/old/Changelog b/software/gpm/browse_source/gpm-1.20.5/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.20.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.20.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/support/README b/software/gpm/browse_source/gpm-1.20.5/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.5/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.5/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.20.6 deleted file mode 100644 index 30d7fbb9..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.20.6 +++ /dev/null @@ -1,8 +0,0 @@ -- fix Gpm_GetServerVersion -- remove all warnings -- use -Werror -W -Wall -- seperate "drivers" from the rest -- remove the unneeded typedefs -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c -- add report success diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.3 deleted file mode 100644 index d7630018..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.3 +++ /dev/null @@ -1,5 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c -- check for rmev (1.19.6 or 1.17.8) diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.4 deleted file mode 100644 index 16a89d5c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- cleanup autoconf stuff diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.7 deleted file mode 100644 index 66b67515..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.7 +++ /dev/null @@ -1,4 +0,0 @@ -- first vertical prototype: have on mouse input running -- Add buildtest for gpm1 and gpm2 - in ~/temp/gpm, based on the tar - -> fix release errors diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.20.5/install-sh b/software/gpm/browse_source/gpm-1.20.5/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.5/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.5/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.5/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.5/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.5/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.5/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.5/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.5/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.5/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.5/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.5/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.20.5/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.20.5/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.5/scripts/gpm.release deleted file mode 100644 index 963e0c6d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/scripts/gpm.release +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(awk -F= '/^release=/ { print $2 }' configure.in )" -#VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo -n "=> Version: $VERSION; ok?" -read ok -#echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.5/scripts/report_success.sh b/software/gpm/browse_source/gpm-1.20.5/scripts/report_success.sh deleted file mode 100644 index ab66ae70..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/scripts/report_success.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-ccollect at schottelius.org) -# -# This file is part of ccollect. -# -# ccollect 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 3 of the License, or -# (at your option) any later version. -# -# ccollect 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 ccollect. If not, see . -# -# Sends feedback -# -# Adapted for gpm -# - -software="gpm" -author="Nico Schottelius" -subject="==> success: $software" -to="nico-gpm-success" -host="schottelius.org" -fullto="${to}@${host}" - -info="$(awk -F= '/^release=/ { print $2 }' configure.in; uname -s -v -r -m)" - - -echo "Reporting success for $software to ${author}" -echo "-----------------" -echo -n "Your name (leave free for anonymous): " -read name -echo -n "Your email (leave free for anonymous): " -read email -echo -n "Your normal gpm parameters (-m -t -o ...): " -read params -echo -n "Comment (leave free for no comment): " -read comment - -echo "" -echo "The following information will be send to ${author}:" -echo "" - -cat << eof -Name: $name (will be used to contact you and kept secret) -E-Mail: $email (will be used to contact you and kept secret) -Comment: $comment -Info: $info -Parameters: $params - -eof - -echo -n "Is it ok to send out that mail (press enter to send or ctrl-c to abort)? " -read yes - -cat << eof | mail -s "$subject" "$fullto" -Name: $name -E-Mail: $email -Comment: $comment -Info: $info -Parameters: $params -eof - -echo "Send. Thank you for your feedback." diff --git a/software/gpm/browse_source/gpm-1.20.5/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.5/src/Makefile.in deleted file mode 100644 index da35a5de..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/Makefile.in +++ /dev/null @@ -1,189 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/header.c daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c \ - prog/display-buttons.c prog/display-coords.c prog/get-versions.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) -Iheaders @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/libgpm.so.@abi_lev@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ; \ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ ; \ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ; \ - echo "Or to update everything just type ldconfig" ; \ - fi -# The unversioned files seems to be not needed -> correct me, if I am wrong. -# && $(LN_S) -f libgpm.so.@abi_lev@ libgpm.so ; \ - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# Configure & unconfigure - -Makefile: Makefile.in - $(top_builddir)/config.status Makefile - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so.@abi_lev@ - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so.@abi_lev@ - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so.@abi_lev@ - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so.@abi_lev@: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so.@abi_lev@ -# unneeded, isn't it? -#lib/libgpm.so: lib/libgpm.so.@abi_full@ -# $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) - -## Release / Dist - - -## Cleanup -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so.* $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c prog/open_console.o - -distclean: clean - rm -f headers/config.h headers/drivers.h \ - Makefile $(DEPFILE) - -allclean: clean - rm -f headers/config.h.in diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/check_kill.c deleted file mode 100644 index 1aa622dd..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/cmdline.c deleted file mode 100644 index 66c8ecc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm.c deleted file mode 100644 index 771da5c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/header.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/main.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/main.c deleted file mode 100644 index b1ceda6e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - -#include "headers/daemon.h" -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/processconn.c deleted file mode 100644 index a5839a3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int processConn(int fd) -{ /* returns newfd or -1 */ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; - socklen_t len; - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *) &addr, sizeof(addr)); - addr.sun_family = AF_UNIX; - - len = sizeof(addr); - if((newfd = accept(fd, (struct sockaddr *) &addr, &len)) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_ACCEPT_FAILED, strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_CONECT_AT, newfd); - - info = malloc(sizeof(Gpm_Cinfo)); - if(!info) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - request = &(info->data); - - if(get_data(request, newfd) == -1) { - free(info); - close(newfd); - return -1; - } - - if((vc = request->vc) > MAX_VC) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } -#ifndef SO_PEERCRED - if(stat(addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR, GPM_MESS_ADDRES_NSOCKET, addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if(statbuf.st_atime < staletime - || statbuf.st_ctime < staletime || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR, GPM_MESS_SOCKET_OLD); - free(info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG, GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if(uid != 0) { - if((tty = - malloc(strlen(option.consolename) + Gpm_cnt_digits(vc) + - sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - - strncpy(tty, option.consolename, strlen(option.consolename) - 1); - sprintf(&tty[strlen(option.consolename) - 1], "%d", vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_STAT_FAILS, tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if(uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN, GPM_MESS_FAILED_CONNECT, uid, tty); /* SUSPECT! */ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* - * register the connection information in the right place - */ - info->next = next = cinfo[vc]; - info->fd = newfd; - cinfo[vc] = info; - gpm_report(GPM_PR_DEBUG, GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, - request->defaultMask, request->minMod, request->maxMod); - - /* - * if the client gets motions, give it the current position - */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event = { 0, 0, vc, 0, 0, statusX, statusY, GPM_MOVE, 0, 0 }; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/processmouse.c deleted file mode 100644 index b3f3994e..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/processmouse.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/processrequest.c deleted file mode 100644 index 309834c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/processspecial.c deleted file mode 100644 index 1da8dda1..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/processspecial.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/startup.c deleted file mode 100644 index 1d00255d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/startup.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* log to debug, who we are */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_VERSION); - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if (option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - if (daemon(0,0)) - gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - - option.run_status = GPM_RUN_DAEMON; /* child */ - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.20.5/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/drivers/README b/software/gpm/browse_source/gpm-1.20.5/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.20.5/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.20.5/src/generic/getsym.c deleted file mode 100644 index 5a667fa2..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/generic/getsym.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -extern int isodigit(const unsigned char c); - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.20.5/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.20.5/src/headers/daemon.h deleted file mode 100644 index a8936ad4..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/headers/daemon.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.5/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.5/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.5/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.5/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.5/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.5/src/headers/message.h deleted file mode 100644 index a0fed0e4..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " PACKAGE_VERSION -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mice. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.5/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.5/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.5/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.5/src/lib/libcurses.c deleted file mode 100644 index e7ebf847..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/lib/libcurses.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.5/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.5/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.5/src/lib/liblow.c deleted file mode 100644 index e789d09c..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/lib/liblow.c +++ /dev/null @@ -1,676 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - int gpm_is_disabled = 0; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - if (errno == ENOENT) { - gpm_report(GPM_PR_DEBUG,"cannot find %s; ignoring (gpm disabled?)", - GPM_NODE_CTL); - gpm_is_disabled++; - } else { - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL, - strerror(errno)); - } - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - if (errno == ENOENT) { - gpm_report(GPM_PR_DEBUG,"Cannot find %s; ignoring (gpm disabled?)", - GPM_NODE_DEV); - gpm_is_disabled++; - } else { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - } - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - if (gpm_is_disabled < 2) /* be quiet if no gpmctl socket found */ - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.5/src/lib/libxtra.c deleted file mode 100644 index e6dd4aa7..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/lib/libxtra.c +++ /dev/null @@ -1,140 +0,0 @@ - -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -//static char *gpml_ver_s = GPM_ABI_FULL; -//static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - if(where) - *where = GPM_ABI_LEV * 10000 + GPM_ABI_AGE * 100 + GPM_ABI_REV; - return GPM_ABI_FULL; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i, j, k = 0; - - if(!gpm_ver_s[0]) { - f = popen(SBINDIR "/gpm -v", "r"); - if(!f) - return NULL; - fgets(line, 128, f); - if(pclose(f)) - return 0; - sscanf(line, "%*s %s", gpm_ver_s); /* "gpm-Linux 0.98, March 1995" - */ - gpm_ver_s[strlen(gpm_ver_s) - 1] = '\0'; /* cut the ',' */ - - sscanf(gpm_ver_s, "%d.%d.%d", &i, &j, &k); - gpm_ver_i = i * 10000 + j * 100 + k; - } - - if(where) - *where = gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ - -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event * ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to = { 0, 0 }; - int i; - - if(!gpm_ver_i) { - if(0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN, "can't get gpm server version"); - } /* if */ - gpm_report(GPM_PR_INFO, "libgpm: got server version as %i", gpm_ver_i); - } - if(gpm_ver_i < 9802) { - gpm_report(GPM_PR_INFO, - "gpm server version too old to obtain status info"); - return -1; /* error */ - } - if(gpm_fd <= 0) { - gpm_report(GPM_PR_INFO, - "gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid = 0; /* this signals a request */ - if(ePtr) - conn.vc = GPM_REQ_SNAPSHOT; - else { - conn.vc = GPM_REQ_BUTTONS; - ePtr = &event; - } - - if(gpm_fd == -1) - return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd, &sillySet); - if(select(gpm_fd + 1, &sillySet, NULL, NULL, &to) == 1) - return 0; - write(gpm_fd, &conn, sizeof(Gpm_Connect)); - - if((i = Gpm_GetEvent(ePtr)) != 1) - return -1; - - i = ePtr->type; - ePtr->type = 0; - return i; /* number of buttons */ -} - -/* Local Variables: */ - -/* c-indent-level: 2 */ - -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.5/src/lib/report-lib.c deleted file mode 100644 index c0ae0860..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/lib/report-lib.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - - if (stat == GPM_STAT_DEBUG) return; - - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/mice.c b/software/gpm/browse_source/gpm-1.20.5/src/mice.c deleted file mode 100644 index dacee347..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/mice.c +++ /dev/null @@ -1,2509 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.5/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/display-buttons.c b/software/gpm/browse_source/gpm-1.20.5/src/prog/display-buttons.c deleted file mode 100644 index de8e5b25..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/display-buttons.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-buttons -lgpm display-buttons.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * left/middle/right button - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": p=%d, l=%1d, m=%1d, r=%1d, clicks=%d\n", - event->type & GPM_DOWN, - event->buttons & GPM_B_LEFT, - event->buttons & GPM_B_MIDDLE, - event->buttons & GPM_B_RIGHT, - event->clicks); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_DRAG | GPM_DOWN | GPM_UP; - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - printf("\tp=pressed (0=release)\n\tl=left\n\tm=middle\n\tr=right\n"); - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/display-coords.c b/software/gpm/browse_source/gpm-1.20.5/src/prog/display-coords.c deleted file mode 100644 index ed15c8a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/display-coords.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-coords -lgpm display-coords.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * x/y coords on the screen - * dx, dy: deltas - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_MOVE; /* read only moves */ - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/get-versions.c b/software/gpm/browse_source/gpm-1.20.5/src/prog/get-versions.c deleted file mode 100644 index 00f17536..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/get-versions.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Get gpm library and server version - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -lgpm - * - ********/ - -#include /* printf() */ -#include /* gpm information */ - -int main() -{ - char *ver; - int intver; - - ver = Gpm_GetLibVersion(&intver); - printf("lib: %s, %d\n",ver,intver); - - ver = Gpm_GetServerVersion(&intver); - printf("srv: %s, %d\n",ver,intver); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.5/src/prog/gpm-root.y deleted file mode 100644 index 069d8019..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/gpm-root.y +++ /dev/null @@ -1,1396 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.5/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.5/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.5/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.20.5/src/prog/open_console.c deleted file mode 100644 index 4a9d0bdc..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/prog/open_console.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/report.c b/software/gpm/browse_source/gpm-1.20.5/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.5/src/synaptics.c b/software/gpm/browse_source/gpm-1.20.5/src/synaptics.c deleted file mode 100644 index 2418c758..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/synaptics.c +++ /dev/null @@ -1,3322 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -#if DEBUG_REPORTS -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} -#endif - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - if (stick_pressure_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_stick_buttons; - if (tmp_buttons || last_stick_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - last_stick_buttons = tmp_buttons; - } - } - if (four_way_button_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_4_way_buttons; - if (tmp_buttons || last_4_way_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - last_4_way_buttons = tmp_buttons; - } - } - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/tools.c b/software/gpm/browse_source/gpm-1.20.5/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.20.5/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.5/src/twiddler.c deleted file mode 100644 index 1d2bd502..00000000 --- a/software/gpm/browse_source/gpm-1.20.5/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ++ptr) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, *mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/.gitignore b/software/gpm/browse_source/gpm-1.20.6/.gitignore deleted file mode 100644 index 41d5e2af..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/.gitignore +++ /dev/null @@ -1,59 +0,0 @@ -.depend -*~ -*.o -*.lo -*.a -*.d -*.P -.*.swp - -Makefile -Makefile.include -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/config - -/contrib/Makefile - -/src/headers/config.h -/src/headers/config.h.in -/src/headers/drivers.h -/src/prog/gpm-root.c -/src/subdirs-exist -/src/headers/config.h.in -/src/gpm -/src/gpm2/tmp -/src/gpm2/out -/src/lib/libgpm.so.* -/src/prog/disable-paste -/src/prog/display-buttons -/src/prog/display-coords -/src/prog/gpm-root.c -/src/prog/gpm-root -/src/prog/get-versions -/src/prog/hltest -/src/prog/mev -/src/prog/mouse-test -/src/Makefile.drivers.generated -/src/subdirs-exist - -/doc/doc.gpm -/doc/gpm-root.1 -/doc/gpm-types.7 -/doc/gpm.8 -/doc/gpm.info -/doc/gpm.man -/doc/mev.1 -/doc/mouse-test.1 - -/.gitversion - -# gpm2 -/gpm2/out/* -/gpm2/tmp/* -/src/gpm2 -/.gitversion.m4 -/.releasedate diff --git a/software/gpm/browse_source/gpm-1.20.6/BUGS b/software/gpm/browse_source/gpm-1.20.6/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.20.6/COPYING b/software/gpm/browse_source/gpm-1.20.6/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.20.6/Changes b/software/gpm/browse_source/gpm-1.20.6/Changes deleted file mode 100644 index f98835f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/Changes +++ /dev/null @@ -1 +0,0 @@ -Can now be found in doc/changes/* diff --git a/software/gpm/browse_source/gpm-1.20.6/MANIFEST b/software/gpm/browse_source/gpm-1.20.6/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.20.6/Makefile.in b/software/gpm/browse_source/gpm-1.20.6/Makefile.in deleted file mode 100644 index 90b92d04..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/Makefile.in +++ /dev/null @@ -1,187 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - rm -f config.status.lineno - - -versionfiles = .gitversion .gitversion.m4 .releasedate -dotfiles = .gitignore .git/HEAD $(versionfiles) -distfiles = configure - -# regen, if it changed; ignore if git is missing / fails -versioncheck: - @v1="$$(git-describe 2>/dev/null)"; \ - if [ -z "$$v1" ]; then \ - echo "No git available, not updating version"; \ - exit 0; \ - fi; \ - v2="$$(cat .gitversion)"; \ - if [ "$$v1" != "$$v2" ]; then \ - echo "updating versionfiles"; \ - date="$$(date +%Y%m%d\ %T\ %z)"; \ - version="$$v1"; \ - echo "define([AC_PACKAGE_VERSION], [$${version} $${date}])" > .gitversion.m4; \ - echo "$${version}" > .gitversion; \ - echo "$${date}" > .releasedate; \ - fi - -$(versionfiles): .git/HEAD versioncheck - -aclocal.m4: acinclude.m4 - $(MKDIR) config - aclocal -I config - -configure: configure.ac aclocal.m4 $(versionfiles) - libtoolize --force --copy `libtoolize -n --install >/dev/null 2>&1 && echo --install` - autoheader - autoconf - -config.status: configure - if [ -f config.status ]; then $(SHELL) ./config.status --recheck; \ - else $(SHELL) ./configure; fi - -Makefile: config.status $(srcdir)/Makefile.in Makefile.include - ./config.status -Makefile.include: config.status $(srcdir)/Makefile.include.in - ./config.status - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x$(ELISP)" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -### RELEASE STUFF -TARS =../gpm-$(release).tar.gz -TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma -D_HOST=home.schottelius.org -D_BASE=www/unix.schottelius.org/www/gpm -D_DIR=$(D_BASE)/archives/ -D_SOURCE=$(D_BASE)/browse_source/ - -M_HOST=arcana.linux.it -M_DIR=gpm/ - -tars: $(TARS) - -# configure headers, produce new configure script -distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles) - -../gpm-$(release).tar: $(srcdir) distclean distconf - # no exclude possible of .git with pax it seems, so the following is not possible: - #pax -w -x ustar -s '/^\./gpm-$(release)/' -w . -f $@ - pax -w -x ustar -s ';^;gpm-$(release)/;' -f $@ -w $(dotfiles) * - -../gpm-$(release).tar.gz: ../gpm-$(release).tar - gzip -9 -c $< > $@ - -../gpm-$(release).tar.bz2: ../gpm-$(release).tar - bzip2 -9 -c $< > $@ - -../gpm-$(release).tar.lzma: ../gpm-$(release).tar - lzma -9 -c $< > $@ - -# 3. Put package together into .tar.gz and .tar.bz2 -#dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz -dist: disttest distclean distconf nicotest $(TARS) - chmod 0644 $(TARS) - scp $(TARS) $(D_HOST):$(D_DIR) - scp $(TARS) $(M_HOST):$(M_DIR) - ssh "$(D_HOST)" "tar xvfz $(D_DIR)/gpm-$(release).tar.gz -C $(D_SOURCE)" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type f -exec chmod 0644 {} \\;" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type d -exec chmod 0755 {} \\;" - - -### TEST: on nicos machine: not to be used anywhere else currently -# create / update configure, delete other parts from earlier build -disttest: distconf clean - ./configure - make all - -TESTBUILDDIR=~/temp/gpm-build-test -nicotest: $(TARS) - rm -rf $(TESTBUILDDIR) - mkdir -p $(TESTBUILDDIR) - cp $(TARS) $(TESTBUILDDIR) - cd $(TESTBUILDDIR); tar xvfj gpm-$(release).tar.bz2; - cd $(TESTBUILDDIR)/gpm-$(release); ./configure && make && ./src/gpm -v - -### CLEANUP -distclean: clean do-clean do-distclean - rm -f config.log config.status* config.cache Makefile Makefile.include - rm -rf autom4te.cache - rm -f src/$(DEPFILE) - -allclean: do-allclean distclean - rm -f configure $(versionfiles) aclocal.m4 diff --git a/software/gpm/browse_source/gpm-1.20.6/Makefile.include.in b/software/gpm/browse_source/gpm-1.20.6/Makefile.include.in deleted file mode 100644 index 6382bba5..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/Makefile.include.in +++ /dev/null @@ -1,70 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# autconf wants this, otherwise issues this warning: -# config.status: WARNING: Makefile.include.in seems to ignore the --datarootdir setting -datarootdir = @datarootdir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.20.6/README b/software/gpm/browse_source/gpm-1.20.6/README deleted file mode 100644 index 03bb8b23..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/README +++ /dev/null @@ -1,334 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001-2008 nico-gpm2008 at schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== REPORT SUCCESS - -As it is always nice to see as an author of FOSS that the software is -used and alive und which options are used, you can send a success -report to me via ./scripts/report_success.sh. - - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit - http://lists.linux.it/listinfo/gpm - -or send a message with "subscribe" in its body to - gpm-request@lists.linux.it. - -For example: - echo subscribe | mail gpm-request@lists.linux.it - - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following place: - - http://unix.schottelius.org/gpm/archives/ - http://unix.schottelius.org/gpm/browse_source/ - - Mirror: - - ftp://arcana.linux.it/pub/gpm/ - http://www.ar.linux.it/pub/gpm/ - -The homepage of gpm can be found at - - http://unix.schottelius.org/gpm/ - -You can get the latest development tree of gpm via git: - - git-clone http://unix.schottelius.org/git/gpm - -There are three branches available: - - master: Contains the latest gpm1 code, may be broken. - gpm-1-stable: Contains the latest stable source code. - gpm-2-dev: Contains work that heads to gpm2. - -You can browse the git-tree via gitweb: - - http://unix.schottelius.org/cgi-bin/gitweb.cgi?p=gpm;a=summary - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.20.6/README.gpm2 b/software/gpm/browse_source/gpm-1.20.6/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.20.6/README.versions b/software/gpm/browse_source/gpm-1.20.6/README.versions deleted file mode 100644 index d4d5f0e4..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/README.versions +++ /dev/null @@ -1,29 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions: no new features. - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code. - includes new features. - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.6/TODO b/software/gpm/browse_source/gpm-1.20.6/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.20.6/acinclude.m4 b/software/gpm/browse_source/gpm-1.20.6/acinclude.m4 deleted file mode 100644 index 8e9d9192..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/acinclude.m4 +++ /dev/null @@ -1,75 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN([ITZ_SYS_ELF], -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN([ITZ_PATH_SITE_LISP], -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN([ITZ_CHECK_TYPE], -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) - -# -# Fix autoconf: They don't allow shell variables in AC_INIT -# So we have to define them via m4 to be accepted.... -# -# What I simply wanted todo is -# -# AC_INIT([gpm],["$revgit"],[http://unix.schottelius.org/gpm/]) -# -# As neither -# -# revgit="`cat $srcdir/.gitversion`" -# m4_define([AC_PACKAGE_VERSION], [$revgit]) -# -# nor -# -# m4_define([AC_PACKAGE_VERSION], include(.gitversion)) -# -# work, I generate an m4 define in .gitversion, which is called by -# autogen.sh: -# -# [13:59] denkbrett:gpm% cat .gitversion -# define([AC_PACKAGE_VERSION], [1.99.6-83-gd80571b 20080611 13:56:54 +0200]) -# -# This works in general, because if AC_PACKAGE_VERSION is set before running -# AC_INIT, it will not overwrite it, as seen in /usr/share/autoconf/autoconf/general.m4: -# -# m4_ifndef([AC_PACKAGE_VERSION], -# [m4_define([AC_PACKAGE_VERSION], [$2])]) -# -# -# So effectively, to change the version of gpm to something dynamically, it goes this way: -# -# autogen.sh -> .gitversion -> acinclude.m4 -> auto* -> configure.ac -> configure -# -# Perhaps someone could simply this a bit? -# - -m4_include(.gitversion.m4) diff --git a/software/gpm/browse_source/gpm-1.20.6/autogen.sh b/software/gpm/browse_source/gpm-1.20.6/autogen.sh deleted file mode 100644 index 9763ada2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/autogen.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -e - -set -x - -[ -d config ] || mkdir config - -# -# Generate version in m4 format, because the following two in acinclude.m4 -# do not work: -# -# revgit="`cat $srcdir/.gitversion`" -# m4_define([AC_PACKAGE_VERSION], [$revgit]) -# -# and -# m4_define([AC_PACKAGE_VERSION], include(.gitversion)) -# -version="$(git-describe)" -date="$(date +%Y%m%d\ %T\ %z)" -echo "define([AC_PACKAGE_VERSION], [${version} ${date}])" > .gitversion.m4 -echo "${version}" > .gitversion -echo "${date}" > .releasedate - -${ACLOCAL-aclocal} -I config -${LIBTOOLIZE-libtoolize} -n --install 2>/dev/null && LIBTOOL_FLAGS="--install" || LIBTOOL_FLAGS="" -${LIBTOOLIZE-libtoolize} --force --copy ${LIBTOOL_FLAGS} -${AUTOHEADER-autoheader} -${AUTOCONF-autoconf} diff --git a/software/gpm/browse_source/gpm-1.20.6/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.20.6/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/build-from-git.sh b/software/gpm/browse_source/gpm-1.20.6/build-from-git.sh deleted file mode 100644 index 7c40be9e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -./autogen.sh && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.20.6/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.20.6/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.20.6/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.20.6/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.20.6/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.20.6/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.20.6/configure.ac b/software/gpm/browse_source/gpm-1.20.6/configure.ac deleted file mode 100644 index 72458265..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/configure.ac +++ /dev/null @@ -1,152 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_PREREQ(2.61) - -AC_INIT([gpm],["version-set-in-.gitversion-via-acinclude.m4"],[http://unix.schottelius.org/gpm/]) - -AC_CONFIG_SRCDIR([src/daemon/main.c]) -AC_CONFIG_AUX_DIR([config]) -AC_CONFIG_HEADER([src/headers/config.h]) - -AC_CANONICAL_HOST - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -# -# Versioning stuff -# -abi_lev="2" -abi_age="1" -abi_rev="0" -abi_full="${abi_lev}.${abi_age}.${abi_rev}" - -AC_DEFINE_UNQUOTED([GPM_ABI_LEV], [$abi_lev], [Library level]) -AC_DEFINE_UNQUOTED([GPM_ABI_AGE], [$abi_age], [Library age]) -AC_DEFINE_UNQUOTED([GPM_ABI_REV], [$abi_rev], [Library revision]) -AC_DEFINE_UNQUOTED([GPM_ABI_FULL],["$abi_full"],[Full library version]) - -releasedate="`cat $srcdir/.releasedate`" -release="`cat $srcdir/.gitversion`" - - -# -# Find programs -# - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -# Header-checks -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -# Required headers -AC_CHECK_HEADERS(sys/socket.h,,[AC_MSG_ERROR([Required header file missing])]) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32, 1, [define if the __u32 type exists either in sys/types.h or in linux/types.h]) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) -AC_SUBST(release) -AC_SUBST(release_date) - -CPPFLAGS="$CPPFLAGS "'-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" -D_GNU_SOURCE' -LDFLAGS="$LDFLAGS "'-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.20.6/contrib/Makefile.in deleted file mode 100644 index af9a7ce4..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc Makefile diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.20.6/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.20.6/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.20.6/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/other/README b/software/gpm/browse_source/gpm-1.20.6/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.20.6/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/Announce b/software/gpm/browse_source/gpm-1.20.6/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/FAQ b/software/gpm/browse_source/gpm-1.20.6/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.20.6/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/Makefile.in b/software/gpm/browse_source/gpm-1.20.6/doc/Makefile.in deleted file mode 100644 index 709fa6d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/Makefile.in +++ /dev/null @@ -1,190 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -$(MANPAGES): gpm.man -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -## CLEANUP section -# normal cleanup -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# for creating distribution -distclean: clean - rm -f Makefile doc.gpm - -# to even remove things we leave for end-users -allclean: distclean - rm -f gpm.info - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -## DIST section -# when we cleaned it, we can securely copy us. -dist: distclean - # unneeded now: using pax + -s option and create tars in .. - #$(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.20.6/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/README.etouch b/software/gpm/browse_source/gpm-1.20.6/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/README.gunze b/software/gpm/browse_source/gpm-1.20.6/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/README.microtouch b/software/gpm/browse_source/gpm-1.20.6/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/README.synaptics b/software/gpm/browse_source/gpm-1.20.6/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/README.twiddler b/software/gpm/browse_source/gpm-1.20.6/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.4 b/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.4 deleted file mode 100644 index e3d96da0..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.4 +++ /dev/null @@ -1,4 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos - * Added automatic local build test - * Fixed SONAME (praise the Debian guys, Jonathan Nieder) diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.5 b/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.5 deleted file mode 100644 index 0f96524f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.5 +++ /dev/null @@ -1,13 +0,0 @@ -Released: 16th of June 2008 -Changes: - * Fix possible segfault (FD_SET/negative) (Guillem Jover) - * Move more messages to debug (Jonathan Nieder) - * Remove unecessary headers (Jonathan Nieder) - * Allow specifying ELISP variable on commandline (Ulrich Mueller) - * Fix broken code semantics (Mike Frysinger) - * Cleanup documentation (Nico Schottelius) - * Fix socklen_t issue: Require posix header (Mike Frysinger/Nico Schottelius) - * Fix building with glibc 2.8 (Mike Frysinger) - * Updated library to version 2.1.0 (Nico Schottelius) - Gpm_GetLibVersion behaves more consistent (all numbers are one or two digits) - * Including dynamically generated version from git (Nico Schottelius) diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.6 b/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.6 deleted file mode 100644 index 83642ba1..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.20.6 +++ /dev/null @@ -1,6 +0,0 @@ -Released: 9th of February 2009 -Changes: - * Some cleanups (Mike Frysinger/Nico Schottelius) - * Pull in fcntl.h rather than unistd.h for open() (Mike Frysinger) - * Fix gcc warning "control reaches end of non-void function" (Mike Frysinger) - * Fix building with libtool-2 (Mike Frysinger) diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.99.6 b/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.99.6 deleted file mode 100644 index afe22868..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/changes/1.99.6 +++ /dev/null @@ -1,11 +0,0 @@ -2008-04-29: Nico Schottelius - * Merge changes from 1.20.3pre6 and 1.20.3 - * Make it compile again on Linux/ppc (-Werror broke it) (acrux) - * Add initial evabs documentation (name missing) - * Update much autoconf stuff, do not use acconfig.h anymore - * Add bugfixes (possible segfault) and cleanups (Bernhard Fischer) - * Whitespace cleanup (Bernhard Fischer) - * Fix memory clobbering in synaptics code (Pavel Semerad) - * Makefile and documentation updates (Mike Frysinger) - * Include automatic generation of checksum - * Include release date and git version diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/changes/gpm-1-before-1.20.4 b/software/gpm/browse_source/gpm-1.20.6/doc/changes/gpm-1-before-1.20.4 deleted file mode 100644 index 2b2ece56..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/changes/gpm-1-before-1.20.4 +++ /dev/null @@ -1,66 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos - - pre1: - Possibly merge changes from 1.99.x to get tree up-to-date again - -* From 1.20.1 to 1.20.3: (bugfix/code cleanup) - o Applied many cleanups - o Added etouch support - o Added scripts/report_success.sh - o Updated README - - pre6: - Cleaned up "make dist" target - Added two debbugging programs: - src/prog/display-buttons.c: display pressed buttons - src/prog/display-coords.c: display mouse coordinates - Fixed Bug#474516: gpm: debug messages in syslog (Debian) - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/changes/gpm-2-before-1.99.6 b/software/gpm/browse_source/gpm-1.20.6/doc/changes/gpm-2-before-1.99.6 deleted file mode 100644 index ddfa4280..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/changes/gpm-2-before-1.99.6 +++ /dev/null @@ -1,13 +0,0 @@ -1.99.6: - * Merge changes from 1.20.3pre6 and 1.20.3 - * Make it compile again on Linux/ppc (-Werror broke it) - * Add initial evabs documentation - * Update autoconf stuff, do not use acconfig.h anymore - * Add bugfixes (possible segfault) and cleanups from Bernhard Fischer -1.99.5: Nico Schottelius, 20080401 - * Removed all compiling warnings: -Werror, -Wall, -Wextra are on! -1.99.4: Nico Schottelius, 20080330 - * Complete splitoff of mice.c! - * Renamed conf/ to example-configurations -1.99.3: Nico Schottelius, 20080326 - * Added evabs support diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.20.6/doc/doc.gpm.in deleted file mode 100644 index 0dafb316..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/doc.gpm.in +++ /dev/null @@ -1,2296 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001-2008 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). Text-mode (non-X) mouse library and server daemon. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001-2008 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for me to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/infofilter b/software/gpm/browse_source/gpm-1.20.6/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/manpager b/software/gpm/browse_source/gpm-1.20.6/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/mktxt b/software/gpm/browse_source/gpm-1.20.6/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/old/Changelog b/software/gpm/browse_source/gpm-1.20.6/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.20.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.20.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/support/README b/software/gpm/browse_source/gpm-1.20.6/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.20.6/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.20.6/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.20.6 deleted file mode 100644 index 30d7fbb9..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.20.6 +++ /dev/null @@ -1,8 +0,0 @@ -- fix Gpm_GetServerVersion -- remove all warnings -- use -Werror -W -Wall -- seperate "drivers" from the rest -- remove the unneeded typedefs -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c -- add report success diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.3 deleted file mode 100644 index d7630018..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.3 +++ /dev/null @@ -1,5 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c -- check for rmev (1.19.6 or 1.17.8) diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.4 deleted file mode 100644 index 16a89d5c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- cleanup autoconf stuff diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.7 deleted file mode 100644 index 66b67515..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.7 +++ /dev/null @@ -1,4 +0,0 @@ -- first vertical prototype: have on mouse input running -- Add buildtest for gpm1 and gpm2 - in ~/temp/gpm, based on the tar - -> fix release errors diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.20.6/install-sh b/software/gpm/browse_source/gpm-1.20.6/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.20.6/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.20.6/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.20.6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.20.6/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.20.6/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.20.6/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.20.6/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.20.6/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.20.6/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.20.6/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.20.6/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.20.6/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.20.6/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.20.6/scripts/gpm.release b/software/gpm/browse_source/gpm-1.20.6/scripts/gpm.release deleted file mode 100644 index 963e0c6d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/scripts/gpm.release +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(awk -F= '/^release=/ { print $2 }' configure.in )" -#VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo -n "=> Version: $VERSION; ok?" -read ok -#echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.20.6/scripts/report_success.sh b/software/gpm/browse_source/gpm-1.20.6/scripts/report_success.sh deleted file mode 100644 index ab66ae70..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/scripts/report_success.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-ccollect at schottelius.org) -# -# This file is part of ccollect. -# -# ccollect 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 3 of the License, or -# (at your option) any later version. -# -# ccollect 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 ccollect. If not, see . -# -# Sends feedback -# -# Adapted for gpm -# - -software="gpm" -author="Nico Schottelius" -subject="==> success: $software" -to="nico-gpm-success" -host="schottelius.org" -fullto="${to}@${host}" - -info="$(awk -F= '/^release=/ { print $2 }' configure.in; uname -s -v -r -m)" - - -echo "Reporting success for $software to ${author}" -echo "-----------------" -echo -n "Your name (leave free for anonymous): " -read name -echo -n "Your email (leave free for anonymous): " -read email -echo -n "Your normal gpm parameters (-m -t -o ...): " -read params -echo -n "Comment (leave free for no comment): " -read comment - -echo "" -echo "The following information will be send to ${author}:" -echo "" - -cat << eof -Name: $name (will be used to contact you and kept secret) -E-Mail: $email (will be used to contact you and kept secret) -Comment: $comment -Info: $info -Parameters: $params - -eof - -echo -n "Is it ok to send out that mail (press enter to send or ctrl-c to abort)? " -read yes - -cat << eof | mail -s "$subject" "$fullto" -Name: $name -E-Mail: $email -Comment: $comment -Info: $info -Parameters: $params -eof - -echo "Send. Thank you for your feedback." diff --git a/software/gpm/browse_source/gpm-1.20.6/src/Makefile.in b/software/gpm/browse_source/gpm-1.20.6/src/Makefile.in deleted file mode 100644 index da35a5de..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/Makefile.in +++ /dev/null @@ -1,189 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/header.c daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c \ - prog/display-buttons.c prog/display-coords.c prog/get-versions.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) -Iheaders @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/libgpm.so.@abi_lev@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ; \ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ ; \ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ; \ - echo "Or to update everything just type ldconfig" ; \ - fi -# The unversioned files seems to be not needed -> correct me, if I am wrong. -# && $(LN_S) -f libgpm.so.@abi_lev@ libgpm.so ; \ - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# Configure & unconfigure - -Makefile: Makefile.in - $(top_builddir)/config.status Makefile - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so.@abi_lev@ - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so.@abi_lev@ - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so.@abi_lev@ - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so.@abi_lev@: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so.@abi_lev@ -# unneeded, isn't it? -#lib/libgpm.so: lib/libgpm.so.@abi_full@ -# $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) - -## Release / Dist - - -## Cleanup -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so.* $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c prog/open_console.o - -distclean: clean - rm -f headers/config.h headers/drivers.h \ - Makefile $(DEPFILE) - -allclean: clean - rm -f headers/config.h.in diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/check_kill.c deleted file mode 100644 index 1aa622dd..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/cmdline.c deleted file mode 100644 index 66c8ecc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm.c deleted file mode 100644 index 771da5c5..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/header.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/main.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/main.c deleted file mode 100644 index b1ceda6e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - -#include "headers/daemon.h" -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/open_console.c deleted file mode 100644 index 27b62e21..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/processconn.c deleted file mode 100644 index a5839a3d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int processConn(int fd) -{ /* returns newfd or -1 */ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; - socklen_t len; - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *) &addr, sizeof(addr)); - addr.sun_family = AF_UNIX; - - len = sizeof(addr); - if((newfd = accept(fd, (struct sockaddr *) &addr, &len)) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_ACCEPT_FAILED, strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_CONECT_AT, newfd); - - info = malloc(sizeof(Gpm_Cinfo)); - if(!info) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - request = &(info->data); - - if(get_data(request, newfd) == -1) { - free(info); - close(newfd); - return -1; - } - - if((vc = request->vc) > MAX_VC) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } -#ifndef SO_PEERCRED - if(stat(addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR, GPM_MESS_ADDRES_NSOCKET, addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if(statbuf.st_atime < staletime - || statbuf.st_ctime < staletime || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR, GPM_MESS_SOCKET_OLD); - free(info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG, GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if(uid != 0) { - if((tty = - malloc(strlen(option.consolename) + Gpm_cnt_digits(vc) + - sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - - strncpy(tty, option.consolename, strlen(option.consolename) - 1); - sprintf(&tty[strlen(option.consolename) - 1], "%d", vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_STAT_FAILS, tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if(uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN, GPM_MESS_FAILED_CONNECT, uid, tty); /* SUSPECT! */ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* - * register the connection information in the right place - */ - info->next = next = cinfo[vc]; - info->fd = newfd; - cinfo[vc] = info; - gpm_report(GPM_PR_DEBUG, GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, - request->defaultMask, request->minMod, request->maxMod); - - /* - * if the client gets motions, give it the current position - */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event = { 0, 0, vc, 0, 0, statusX, statusY, GPM_MOVE, 0, 0 }; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/processmouse.c deleted file mode 100644 index b3f3994e..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/processmouse.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/processrequest.c deleted file mode 100644 index 309834c7..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/processspecial.c deleted file mode 100644 index 1da8dda1..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/processspecial.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/startup.c deleted file mode 100644 index 1d00255d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/startup.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* log to debug, who we are */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_VERSION); - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if (option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - if (daemon(0,0)) - gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - - option.run_status = GPM_RUN_DAEMON; /* child */ - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.20.6/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/drivers/README b/software/gpm/browse_source/gpm-1.20.6/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.20.6/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.20.6/src/generic/getsym.c deleted file mode 100644 index 5a667fa2..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/generic/getsym.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -extern int isodigit(const unsigned char c); - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.20.6/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.20.6/src/headers/daemon.h deleted file mode 100644 index a8936ad4..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/headers/daemon.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.6/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.20.6/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.20.6/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.20.6/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.20.6/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/headers/message.h b/software/gpm/browse_source/gpm-1.20.6/src/headers/message.h deleted file mode 100644 index a0fed0e4..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " PACKAGE_VERSION -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mice. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.20.6/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.20.6/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.20.6/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.20.6/src/lib/libcurses.c deleted file mode 100644 index e7ebf847..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/lib/libcurses.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.20.6/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.20.6/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.20.6/src/lib/liblow.c deleted file mode 100644 index e789d09c..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/lib/liblow.c +++ /dev/null @@ -1,676 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - int gpm_is_disabled = 0; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - if (errno == ENOENT) { - gpm_report(GPM_PR_DEBUG,"cannot find %s; ignoring (gpm disabled?)", - GPM_NODE_CTL); - gpm_is_disabled++; - } else { - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL, - strerror(errno)); - } - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - if (errno == ENOENT) { - gpm_report(GPM_PR_DEBUG,"Cannot find %s; ignoring (gpm disabled?)", - GPM_NODE_DEV); - gpm_is_disabled++; - } else { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - } - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - if (gpm_is_disabled < 2) /* be quiet if no gpmctl socket found */ - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.20.6/src/lib/libxtra.c deleted file mode 100644 index e6dd4aa7..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/lib/libxtra.c +++ /dev/null @@ -1,140 +0,0 @@ - -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -//static char *gpml_ver_s = GPM_ABI_FULL; -//static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - if(where) - *where = GPM_ABI_LEV * 10000 + GPM_ABI_AGE * 100 + GPM_ABI_REV; - return GPM_ABI_FULL; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i, j, k = 0; - - if(!gpm_ver_s[0]) { - f = popen(SBINDIR "/gpm -v", "r"); - if(!f) - return NULL; - fgets(line, 128, f); - if(pclose(f)) - return 0; - sscanf(line, "%*s %s", gpm_ver_s); /* "gpm-Linux 0.98, March 1995" - */ - gpm_ver_s[strlen(gpm_ver_s) - 1] = '\0'; /* cut the ',' */ - - sscanf(gpm_ver_s, "%d.%d.%d", &i, &j, &k); - gpm_ver_i = i * 10000 + j * 100 + k; - } - - if(where) - *where = gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ - -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event * ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to = { 0, 0 }; - int i; - - if(!gpm_ver_i) { - if(0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN, "can't get gpm server version"); - } /* if */ - gpm_report(GPM_PR_INFO, "libgpm: got server version as %i", gpm_ver_i); - } - if(gpm_ver_i < 9802) { - gpm_report(GPM_PR_INFO, - "gpm server version too old to obtain status info"); - return -1; /* error */ - } - if(gpm_fd <= 0) { - gpm_report(GPM_PR_INFO, - "gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid = 0; /* this signals a request */ - if(ePtr) - conn.vc = GPM_REQ_SNAPSHOT; - else { - conn.vc = GPM_REQ_BUTTONS; - ePtr = &event; - } - - if(gpm_fd == -1) - return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd, &sillySet); - if(select(gpm_fd + 1, &sillySet, NULL, NULL, &to) == 1) - return 0; - write(gpm_fd, &conn, sizeof(Gpm_Connect)); - - if((i = Gpm_GetEvent(ePtr)) != 1) - return -1; - - i = ePtr->type; - ePtr->type = 0; - return i; /* number of buttons */ -} - -/* Local Variables: */ - -/* c-indent-level: 2 */ - -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.20.6/src/lib/report-lib.c deleted file mode 100644 index c0ae0860..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/lib/report-lib.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - - if (stat == GPM_STAT_DEBUG) return; - - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/mice.c b/software/gpm/browse_source/gpm-1.20.6/src/mice.c deleted file mode 100644 index dacee347..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/mice.c +++ /dev/null @@ -1,2509 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.20.6/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/display-buttons.c b/software/gpm/browse_source/gpm-1.20.6/src/prog/display-buttons.c deleted file mode 100644 index de8e5b25..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/display-buttons.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-buttons -lgpm display-buttons.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * left/middle/right button - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": p=%d, l=%1d, m=%1d, r=%1d, clicks=%d\n", - event->type & GPM_DOWN, - event->buttons & GPM_B_LEFT, - event->buttons & GPM_B_MIDDLE, - event->buttons & GPM_B_RIGHT, - event->clicks); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_DRAG | GPM_DOWN | GPM_UP; - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - printf("\tp=pressed (0=release)\n\tl=left\n\tm=middle\n\tr=right\n"); - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/display-coords.c b/software/gpm/browse_source/gpm-1.20.6/src/prog/display-coords.c deleted file mode 100644 index ed15c8a7..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/display-coords.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-coords -lgpm display-coords.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * x/y coords on the screen - * dx, dy: deltas - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event, void *data) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%d] delta: %ds",now,delta); - - /* display mouse information */ - printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_MOVE; /* read only moves */ - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt, NULL); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/get-versions.c b/software/gpm/browse_source/gpm-1.20.6/src/prog/get-versions.c deleted file mode 100644 index 00f17536..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/get-versions.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Get gpm library and server version - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -lgpm - * - ********/ - -#include /* printf() */ -#include /* gpm information */ - -int main() -{ - char *ver; - int intver; - - ver = Gpm_GetLibVersion(&intver); - printf("lib: %s, %d\n",ver,intver); - - ver = Gpm_GetServerVersion(&intver); - printf("srv: %s, %d\n",ver,intver); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.20.6/src/prog/gpm-root.y deleted file mode 100644 index 069d8019..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/gpm-root.y +++ /dev/null @@ -1,1396 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.20.6/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/mev.c b/software/gpm/browse_source/gpm-1.20.6/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.20.6/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.20.6/src/prog/open_console.c deleted file mode 100644 index d41d25a6..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/prog/open_console.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/report.c b/software/gpm/browse_source/gpm-1.20.6/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.20.6/src/synaptics.c b/software/gpm/browse_source/gpm-1.20.6/src/synaptics.c deleted file mode 100644 index 2418c758..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/synaptics.c +++ /dev/null @@ -1,3322 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -#if DEBUG_REPORTS -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} -#endif - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - if (stick_pressure_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_stick_buttons; - if (tmp_buttons || last_stick_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - last_stick_buttons = tmp_buttons; - } - } - if (four_way_button_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_4_way_buttons; - if (tmp_buttons || last_4_way_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - last_4_way_buttons = tmp_buttons; - } - } - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/tools.c b/software/gpm/browse_source/gpm-1.20.6/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.20.6/src/twiddler.c b/software/gpm/browse_source/gpm-1.20.6/src/twiddler.c deleted file mode 100644 index 1d2bd502..00000000 --- a/software/gpm/browse_source/gpm-1.20.6/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ++ptr) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, *mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/.exclude b/software/gpm/browse_source/gpm-1.99.2.1/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.99.2.1/.gitignore b/software/gpm/browse_source/gpm-1.99.2.1/.gitignore deleted file mode 100644 index 8bf3b974..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -*.o -*.a -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in -src/gpm2/tmp -src/gpm2/out -.*.swp diff --git a/software/gpm/browse_source/gpm-1.99.2.1/BUGS b/software/gpm/browse_source/gpm-1.99.2.1/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/COPYING b/software/gpm/browse_source/gpm-1.99.2.1/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/Changelog b/software/gpm/browse_source/gpm-1.99.2.1/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/Changes b/software/gpm/browse_source/gpm-1.99.2.1/Changes deleted file mode 100644 index 1cc65649..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/Changes +++ /dev/null @@ -1,35 +0,0 @@ -* From 1.20.1 to 1.20.3: - o many cleanups - o etouch support -* From 1.20.1 to 1.20.2: -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.99.2.1/MANIFEST b/software/gpm/browse_source/gpm-1.99.2.1/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.99.2.1/Makefile.in b/software/gpm/browse_source/gpm-1.99.2.1/Makefile.in deleted file mode 100644 index 1cfaa7c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/Makefile.in +++ /dev/null @@ -1,123 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -f configure - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.99.2.1/Makefile.include.in b/software/gpm/browse_source/gpm-1.99.2.1/Makefile.include.in deleted file mode 100644 index fab5ac79..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/Makefile.include.in +++ /dev/null @@ -1,68 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/README b/software/gpm/browse_source/gpm-1.99.2.1/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/README.gpm2 b/software/gpm/browse_source/gpm-1.99.2.1/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.99.2.1/README.versions b/software/gpm/browse_source/gpm-1.99.2.1/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.2.1/TODO b/software/gpm/browse_source/gpm-1.99.2.1/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/acconfig.h b/software/gpm/browse_source/gpm-1.99.2.1/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/aclocal.m4 b/software/gpm/browse_source/gpm-1.99.2.1/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.99.2.1/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.99.2.1/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/build-from-git.sh b/software/gpm/browse_source/gpm-1.99.2.1/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.99.2.1/configure.in b/software/gpm/browse_source/gpm-1.99.2.1/configure.in deleted file mode 100644 index f5624b8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.20.3pre3 -release_date="Summer 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.99.2.1/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.99.2.1/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.99.2.1/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.99.2.1/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/other/README b/software/gpm/browse_source/gpm-1.99.2.1/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.99.2.1/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/Announce b/software/gpm/browse_source/gpm-1.99.2.1/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/FAQ b/software/gpm/browse_source/gpm-1.99.2.1/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.99.2.1/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/Makefile.in b/software/gpm/browse_source/gpm-1.99.2.1/doc/Makefile.in deleted file mode 100644 index d8b95c65..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/Makefile.in +++ /dev/null @@ -1,180 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.99.2.1/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.etouch b/software/gpm/browse_source/gpm-1.99.2.1/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.gunze b/software/gpm/browse_source/gpm-1.99.2.1/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.microtouch b/software/gpm/browse_source/gpm-1.99.2.1/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.synaptics b/software/gpm/browse_source/gpm-1.99.2.1/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.twiddler b/software/gpm/browse_source/gpm-1.99.2.1/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.99.2.1/doc/doc.gpm.in deleted file mode 100644 index bc800fa1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001,2002 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001,2002 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/infofilter b/software/gpm/browse_source/gpm-1.99.2.1/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/manpager b/software/gpm/browse_source/gpm-1.99.2.1/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/mktxt b/software/gpm/browse_source/gpm-1.99.2.1/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/README b/software/gpm/browse_source/gpm-1.99.2.1/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.99.2.1/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.99.2.1/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.4 deleted file mode 100644 index 7191a2eb..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.3 deleted file mode 100644 index 655965cc..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/doc/todo/1.99.3 +++ /dev/null @@ -1,4 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.99.2.1/install-sh b/software/gpm/browse_source/gpm-1.99.2.1/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.1/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.2.1/scripts/build-tar.sh b/software/gpm/browse_source/gpm-1.99.2.1/scripts/build-tar.sh deleted file mode 100644 index 2ddeedd8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/scripts/build-tar.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -version=1.20.3pre3 - -git archive --format=tar --prefix=gpm-${version}/ HEAD | \ - tee ../gpm-${version}.tar | bzip2 -9 > ../gpm-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.2.1/scripts/gpm.release b/software/gpm/browse_source/gpm-1.99.2.1/scripts/gpm.release deleted file mode 100644 index fbf03ef4..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/scripts/gpm.release +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/Makefile.in b/software/gpm/browse_source/gpm-1.99.2.1/src/Makefile.in deleted file mode 100644 index c5f7901b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/Makefile.in +++ /dev/null @@ -1,174 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/header.c daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# cleaning up section - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile $(DEPFILE) - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/cmdline.c deleted file mode 100644 index 14096b0f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm.c deleted file mode 100644 index 33a1b20a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/header.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/main.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/main.c deleted file mode 100644 index 724e4db8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processconn.c deleted file mode 100644 index 5212c0cd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processmouse.c deleted file mode 100644 index 13ef144c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processmouse.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -#define abs(value) ((value) < 0 ? -(value) : (value)) - -/*------------------------------------------------------------------- - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - *-------------------------------------------------------------------*/ -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, fine_dy; - static int i, j, m; - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - oldT=event->type; - - if (eventFlag) { - eventFlag=0; - - if ((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy=0; - event->wdx=event->wdy=0; - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do { /* cluster loop */ - if(((data=getMouseData(fd,(which_mouse->m_type),kd_mode))==NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - if (!i) return 0; - else break; - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB!=newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - if (!event->dx && !event->dy && (event->buttons==oldB)) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"M: %3i %3i (%3i %3i) - butt=%i vc=%i cl=%i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processrequest.c deleted file mode 100644 index 71e1140a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/startup.c deleted file mode 100644 index 166dab1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/startup.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/drivers/README b/software/gpm/browse_source/gpm-1.99.2.1/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.99.2.1/src/generic/getsym.c deleted file mode 100644 index b8f5bfcd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/generic/getsym.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.99.2.1/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.99.2.1/src/headers/daemon.h deleted file mode 100644 index a24b9ede..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/daemon.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpm.h deleted file mode 100644 index f4c0c2f4..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpm.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/message.h b/software/gpm/browse_source/gpm-1.99.2.1/src/headers/message.h deleted file mode 100644 index 31083cc6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE " (X-Mas), " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.99.2.1/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.99.2.1/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.99.2.1/src/lib/liblow.c deleted file mode 100644 index 1eb05480..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/liblow.c +++ /dev/null @@ -1,662 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - do { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } while(gpm_stack); - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.99.2.1/src/lib/report-lib.c deleted file mode 100644 index fd9d6080..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/lib/report-lib.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; - } - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/mice.c b/software/gpm/browse_source/gpm-1.99.2.1/src/mice.c deleted file mode 100644 index 68594066..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/mice.c +++ /dev/null @@ -1,2493 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - - -/*========================================================================*/ -/* Parsing argv: helper dats struct function (should they get elsewhere?) */ -/*========================================================================*/ - -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - -static int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -static volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -static int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - - - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -static int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} - - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -static int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} - -static int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -static int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - buffer[3] = - (state->buttons & GPM_B_UP ? -1 : 0) + - (state->buttons & GPM_B_DOWN ? 1 : 0); - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - /* old code: - - did it signed: - state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; - - and unsigned: - state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; - */ - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -static Gpm_Type *I_exps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write (fd, s1, sizeof (s1)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.99.2.1/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.99.2.1/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.99.2.1/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/mev.c b/software/gpm/browse_source/gpm-1.99.2.1/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.99.2.1/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.99.2.1/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/report.c b/software/gpm/browse_source/gpm-1.99.2.1/src/report.c deleted file mode 100644 index 80be4141..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/report.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/synaptics.c b/software/gpm/browse_source/gpm-1.99.2.1/src/synaptics.c deleted file mode 100644 index 54d4aa3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/synaptics.c +++ /dev/null @@ -1,3305 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/tools.c b/software/gpm/browse_source/gpm-1.99.2.1/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.1/src/twiddler.c b/software/gpm/browse_source/gpm-1.99.2.1/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.1/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/.exclude b/software/gpm/browse_source/gpm-1.99.2.2/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.99.2.2/.gitignore b/software/gpm/browse_source/gpm-1.99.2.2/.gitignore deleted file mode 100644 index 8bf3b974..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -*.o -*.a -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in -src/gpm2/tmp -src/gpm2/out -.*.swp diff --git a/software/gpm/browse_source/gpm-1.99.2.2/BUGS b/software/gpm/browse_source/gpm-1.99.2.2/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/COPYING b/software/gpm/browse_source/gpm-1.99.2.2/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/Changelog b/software/gpm/browse_source/gpm-1.99.2.2/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/Changes b/software/gpm/browse_source/gpm-1.99.2.2/Changes deleted file mode 100644 index 1cc65649..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/Changes +++ /dev/null @@ -1,35 +0,0 @@ -* From 1.20.1 to 1.20.3: - o many cleanups - o etouch support -* From 1.20.1 to 1.20.2: -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.99.2.2/MANIFEST b/software/gpm/browse_source/gpm-1.99.2.2/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.99.2.2/Makefile.in b/software/gpm/browse_source/gpm-1.99.2.2/Makefile.in deleted file mode 100644 index c89e6051..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/Makefile.in +++ /dev/null @@ -1,123 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf configure autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.99.2.2/Makefile.include.in b/software/gpm/browse_source/gpm-1.99.2.2/Makefile.include.in deleted file mode 100644 index fab5ac79..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/Makefile.include.in +++ /dev/null @@ -1,68 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/README b/software/gpm/browse_source/gpm-1.99.2.2/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/README.gpm2 b/software/gpm/browse_source/gpm-1.99.2.2/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.99.2.2/README.versions b/software/gpm/browse_source/gpm-1.99.2.2/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.2.2/TODO b/software/gpm/browse_source/gpm-1.99.2.2/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/acconfig.h b/software/gpm/browse_source/gpm-1.99.2.2/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/aclocal.m4 b/software/gpm/browse_source/gpm-1.99.2.2/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.99.2.2/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.99.2.2/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/build-from-git.sh b/software/gpm/browse_source/gpm-1.99.2.2/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.99.2.2/configure.in b/software/gpm/browse_source/gpm-1.99.2.2/configure.in deleted file mode 100644 index 53bd3344..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.20.3pre4 -release_date="A calm night, 13. March 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.99.2.2/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.99.2.2/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.99.2.2/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.99.2.2/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/other/README b/software/gpm/browse_source/gpm-1.99.2.2/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.99.2.2/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/Announce b/software/gpm/browse_source/gpm-1.99.2.2/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/FAQ b/software/gpm/browse_source/gpm-1.99.2.2/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.99.2.2/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/Makefile.in b/software/gpm/browse_source/gpm-1.99.2.2/doc/Makefile.in deleted file mode 100644 index d8b95c65..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/Makefile.in +++ /dev/null @@ -1,180 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.99.2.2/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.etouch b/software/gpm/browse_source/gpm-1.99.2.2/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.gunze b/software/gpm/browse_source/gpm-1.99.2.2/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.microtouch b/software/gpm/browse_source/gpm-1.99.2.2/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.synaptics b/software/gpm/browse_source/gpm-1.99.2.2/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.twiddler b/software/gpm/browse_source/gpm-1.99.2.2/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.99.2.2/doc/doc.gpm.in deleted file mode 100644 index bc800fa1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001,2002 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001,2002 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/infofilter b/software/gpm/browse_source/gpm-1.99.2.2/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/manpager b/software/gpm/browse_source/gpm-1.99.2.2/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/mktxt b/software/gpm/browse_source/gpm-1.99.2.2/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.99.2.2/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.99.2.2/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/README b/software/gpm/browse_source/gpm-1.99.2.2/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.99.2.2/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.99.2.2/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.3 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.3 deleted file mode 100644 index ff06dad5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.3 +++ /dev/null @@ -1,2 +0,0 @@ -- fixup major bugs in 1.20.1 -Codename: Eiche diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.4 deleted file mode 100644 index 5fdec17c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate add daemon and library stuff cleanly -x split off gpm.c and gpn.c diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.7 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.7 deleted file mode 100644 index 09ec71d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.20.7 +++ /dev/null @@ -1,2 +0,0 @@ -- cleanup protocol names -- cleanup autoconf diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.2 deleted file mode 100644 index e1b5ec13..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - => no, later diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.3 deleted file mode 100644 index 655965cc..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.3 +++ /dev/null @@ -1,4 +0,0 @@ -- Fixes: - Remove glibc-hacks, where possible and posix conform: - processConn -- begin splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.4 deleted file mode 100644 index 16a89d5c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- cleanup autoconf stuff diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.7 deleted file mode 100644 index c7e2e926..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.7 +++ /dev/null @@ -1 +0,0 @@ -- first vertical prototype: have on mouse input running diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/install-sh b/software/gpm/browse_source/gpm-1.99.2.2/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.2.2/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.2.2/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.99.2.2/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.2.2/scripts/gpm.release b/software/gpm/browse_source/gpm-1.99.2.2/scripts/gpm.release deleted file mode 100644 index fbf03ef4..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/scripts/gpm.release +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/Makefile.in b/software/gpm/browse_source/gpm-1.99.2.2/src/Makefile.in deleted file mode 100644 index 7816412e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/Makefile.in +++ /dev/null @@ -1,188 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GDRIVERS = drivers/ms/m_ms.c \ - drivers/geni/m_geni.c \ - drivers/brw/m_brw.c \ - drivers/exps2/i_exps2.c \ - drivers/ms3/m_ms3.c drivers/ms3/r_ms3.c - -# mouse-test and gpm -GCOMMON = generic/check_no_argv.c generic/parse_argv.c \ - generic/limit_delta.o - -GSRC += $(GDRIVERS) -GSRC += $(GCOMMON) - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# cleaning up section - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile $(DEPFILE) - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o \ - $(GCOMMON:.c=.o) $(GDRIVERS:.c=.o) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/cmdline.c deleted file mode 100644 index 14096b0f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/cmdline.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/getmousedata.c deleted file mode 100644 index b1c69d80..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_DATA_4,data[0],data[1],data[2],data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm.c deleted file mode 100644 index 33a1b20a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/header.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/main.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/main.c deleted file mode 100644 index 724e4db8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processconn.c deleted file mode 100644 index 5212c0cd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processmouse.c deleted file mode 100644 index b3f3994e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processmouse.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processrequest.c deleted file mode 100644 index 71e1140a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/startup.c deleted file mode 100644 index 166dab1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/startup.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/README b/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/brw/m_brw.c b/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/brw/m_brw.c deleted file mode 100644 index e9bd128c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/brw/m_brw.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/daemon.h" /* daemon internals */ -#include "headers/message.h" /* messaging */ - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/exps2/i_exps2.c b/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/exps2/i_exps2.c deleted file mode 100644 index 70ddba48..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/exps2/i_exps2.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* tcflush */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write(fd, s1, sizeof (s1)); - usleep(30000); - tcflush(fd, TCIFLUSH); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/geni/m_geni.c b/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/geni/m_geni.c deleted file mode 100644 index 64a0f6eb..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/geni/m_geni.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/daemon.h" /* daemon internals */ - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms/m_ms.c b/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms/m_ms.c deleted file mode 100644 index 3ad29105..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms/m_ms.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -//#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms3/m_ms3.c b/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms3/m_ms3.c deleted file mode 100644 index fbdd9b60..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms3/m_ms3.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/daemon.h" /* daemon internals */ - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms3/r_ms3.c b/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms3/r_ms3.c deleted file mode 100644 index 0176d433..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/drivers/ms3/r_ms3.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/daemon.h" /* daemon internals */ - -int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/check_no_argv.c b/software/gpm/browse_source/gpm-1.99.2.2/src/generic/check_no_argv.c deleted file mode 100644 index eda651f9..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/check_no_argv.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/daemon.h" /* daemon internals */ - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.99.2.2/src/generic/getsym.c deleted file mode 100644 index b8f5bfcd..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/getsym.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.99.2.2/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/limit_delta.c b/software/gpm/browse_source/gpm-1.99.2.2/src/generic/limit_delta.c deleted file mode 100644 index 28e4592b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/limit_delta.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/parse_argv.c b/software/gpm/browse_source/gpm-1.99.2.2/src/generic/parse_argv.c deleted file mode 100644 index 7cae5f47..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/generic/parse_argv.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isalnum */ -#include /* fprintf */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.99.2.2/src/headers/daemon.h deleted file mode 100644 index 4b8c9485..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/daemon.h +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/*======================================================================== - * Parsing argv: helper dats struct function - *========================================================================*/ -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); - -volatile int check_no_argv(int argc, char **argv); - -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int limit_delta(int delta, int min, int max); - -int open_console(const int mode); -int old_main(); - -int parse_argv(argv_helper *info, int argc, char **argv); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - -/************************************************************************* - * Drivers - */ - -Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); -int M_brw(Gpm_Event *state, unsigned char *data); - - -int M_ms(Gpm_Event *state, unsigned char *data); - -int M_ms3(Gpm_Event *state, unsigned char *data); -int R_ms3(Gpm_Event *state, int fd); - - -int M_geni(Gpm_Event *state, unsigned char *data); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpmCfg.h deleted file mode 100644 index 73f6db38..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpmCfg.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/message.h b/software/gpm/browse_source/gpm-1.99.2.2/src/headers/message.h deleted file mode 100644 index 31083cc6..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "O0o.oops(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE " (X-Mas), " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " -V verbosity increase number of logged messages\n\n\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.99.2.2/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.99.2.2/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.99.2.2/src/lib/liblow.c deleted file mode 100644 index 28236cf1..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/liblow.c +++ /dev/null @@ -1,660 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.99.2.2/src/lib/report-lib.c deleted file mode 100644 index 812fdb8e..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/lib/report-lib.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/mice.c b/software/gpm/browse_source/gpm-1.99.2.2/src/mice.c deleted file mode 100644 index ccb8ee90..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/mice.c +++ /dev/null @@ -1,2261 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.99.2.2/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.99.2.2/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.99.2.2/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/mev.c b/software/gpm/browse_source/gpm-1.99.2.2/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.99.2.2/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.99.2.2/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/report.c b/software/gpm/browse_source/gpm-1.99.2.2/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/synaptics.c b/software/gpm/browse_source/gpm-1.99.2.2/src/synaptics.c deleted file mode 100644 index 54d4aa3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/synaptics.c +++ /dev/null @@ -1,3305 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/tools.c b/software/gpm/browse_source/gpm-1.99.2.2/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.99.2.2/src/twiddler.c b/software/gpm/browse_source/gpm-1.99.2.2/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.99.2.2/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/.exclude b/software/gpm/browse_source/gpm-1.99.3/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.99.3/.gitignore b/software/gpm/browse_source/gpm-1.99.3/.gitignore deleted file mode 100644 index 8bf3b974..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -*.o -*.a -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in -src/gpm2/tmp -src/gpm2/out -.*.swp diff --git a/software/gpm/browse_source/gpm-1.99.3/BUGS b/software/gpm/browse_source/gpm-1.99.3/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.99.3/COPYING b/software/gpm/browse_source/gpm-1.99.3/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.99.3/Changelog b/software/gpm/browse_source/gpm-1.99.3/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.99.3/Changes b/software/gpm/browse_source/gpm-1.99.3/Changes deleted file mode 100644 index 951d08cb..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/Changes +++ /dev/null @@ -1,34 +0,0 @@ -* From 1.20.1 to 1.20.3: (bugfix/code cleanup) - o Many, many cleanups - o Added etouch support -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.99.3/MANIFEST b/software/gpm/browse_source/gpm-1.99.3/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.99.3/Makefile.in b/software/gpm/browse_source/gpm-1.99.3/Makefile.in deleted file mode 100644 index c89e6051..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/Makefile.in +++ /dev/null @@ -1,123 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -dep: - touch src/$(DEPFILE) # to prevent unecessary warnings - make -C src dep - -check: all - -uninstall: do-uninstall - -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - else \ - true; \ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf configure autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm -f src/$(DEPFILE) - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.99.3/Makefile.include.in b/software/gpm/browse_source/gpm-1.99.3/Makefile.include.in deleted file mode 100644 index fab5ac79..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/Makefile.include.in +++ /dev/null @@ -1,68 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -DEPFILE = .depend - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.99.3/README b/software/gpm/browse_source/gpm-1.99.3/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.99.3/README.gpm2 b/software/gpm/browse_source/gpm-1.99.3/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.99.3/README.versions b/software/gpm/browse_source/gpm-1.99.3/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.3/TODO b/software/gpm/browse_source/gpm-1.99.3/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.99.3/acconfig.h b/software/gpm/browse_source/gpm-1.99.3/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.99.3/aclocal.m4 b/software/gpm/browse_source/gpm-1.99.3/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.99.3/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.99.3/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/build-from-git.sh b/software/gpm/browse_source/gpm-1.99.3/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.99.3/conf/gpm-root.conf b/software/gpm/browse_source/gpm-1.99.3/conf/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/conf/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.99.3/conf/gpm-syn.conf b/software/gpm/browse_source/gpm-1.99.3/conf/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/conf/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.99.3/conf/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.99.3/conf/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/conf/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.99.3/configure.in b/software/gpm/browse_source/gpm-1.99.3/configure.in deleted file mode 100644 index cf4530a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.99.3 -release_date="Snow lies outside, 26. March 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.99.3/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.99.3/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.99.3/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.99.3/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/other/README b/software/gpm/browse_source/gpm-1.99.3/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.99.3/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/Announce b/software/gpm/browse_source/gpm-1.99.3/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/FAQ b/software/gpm/browse_source/gpm-1.99.3/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.99.3/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/Makefile.in b/software/gpm/browse_source/gpm-1.99.3/doc/Makefile.in deleted file mode 100644 index d8b95c65..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/Makefile.in +++ /dev/null @@ -1,180 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.99.3/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/README.etouch b/software/gpm/browse_source/gpm-1.99.3/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/README.gunze b/software/gpm/browse_source/gpm-1.99.3/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/README.microtouch b/software/gpm/browse_source/gpm-1.99.3/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/README.synaptics b/software/gpm/browse_source/gpm-1.99.3/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/README.twiddler b/software/gpm/browse_source/gpm-1.99.3/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.99.3/doc/doc.gpm.in deleted file mode 100644 index bc800fa1..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001,2002 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001,2002 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/infofilter b/software/gpm/browse_source/gpm-1.99.3/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/manpager b/software/gpm/browse_source/gpm-1.99.3/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/mktxt b/software/gpm/browse_source/gpm-1.99.3/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.99.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.99.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/support/README b/software/gpm/browse_source/gpm-1.99.3/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.99.3/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.99.3/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/tests/1.99.2.2 b/software/gpm/browse_source/gpm-1.99.3/doc/tests/1.99.2.2 deleted file mode 100644 index cf8eec8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/tests/1.99.2.2 +++ /dev/null @@ -1,2 +0,0 @@ -- gpm with mc test: - * click on items works: yes (using -m /dev/psaux -t ps2) diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.3 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.3 deleted file mode 100644 index ff06dad5..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.3 +++ /dev/null @@ -1,2 +0,0 @@ -- fixup major bugs in 1.20.1 -Codename: Eiche diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.4 deleted file mode 100644 index 5fdec17c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate add daemon and library stuff cleanly -x split off gpm.c and gpn.c diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.7 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.7 deleted file mode 100644 index 09ec71d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.20.7 +++ /dev/null @@ -1,2 +0,0 @@ -- cleanup protocol names -- cleanup autoconf diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.2 deleted file mode 100644 index 841c6162..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - -> begun diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.3 deleted file mode 100644 index 9ea392f7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.3 +++ /dev/null @@ -1 +0,0 @@ -- Apply Evabs-patch diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.4 deleted file mode 100644 index 028c5b77..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.4 +++ /dev/null @@ -1,5 +0,0 @@ -- cleanup autoconf stuff -- try to implement n mice by usage of add_mouse -- add help for calib file in English -- Fixes: Remove glibc-hacks, where possible and posix conform: processConn -- finish splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.5 deleted file mode 100644 index 818c04d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.5 +++ /dev/null @@ -1 +0,0 @@ -- finish gpm2/doc/DESIGN diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.7 deleted file mode 100644 index c7e2e926..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.7 +++ /dev/null @@ -1 +0,0 @@ -- first vertical prototype: have on mouse input running diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.8 deleted file mode 100644 index 577126da..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.8 +++ /dev/null @@ -1,2 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// diff --git a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.9 deleted file mode 100644 index 67effe4d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/doc/todo/1.99.9 +++ /dev/null @@ -1 +0,0 @@ -- cleanly design conf/ diff --git a/software/gpm/browse_source/gpm-1.99.3/install-sh b/software/gpm/browse_source/gpm-1.99.3/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i -To: spida //at\\ spida.net -Subject: gpm-calib.conf -Hi Timo! - -Das Dateiformat sieht wie folgt aus: - -ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max - -wobei alle e* die Reichweite der Koordinaten angeben, die aus dem -Event-Interface kommen und alle r* die Bilschirmkoordinaten sind, auf -die abgebildet wird. Alle Werte werden nur von Leerzeichen getrennt. -Das eGalax gibt über das Event-Interface ungefähr Werte zwischen 0 und -2000 für beide Achsen aus. Die Bildschirmkoordinaten sollten immer auf 0 -beim Minimum und auf der Bildschirmauflösung minus 1 beim Maximum -stehen. Für Textmodi entspricht die Auflösung der Textauflösung. Bei -Framebuffer-Konsolen kann ich es nicht mit Sicherheit sagen. - -Für 800x600 auf dem eGalax sollte die Datei also ungefähr so aussehen: - -50 1950 50 1950 0 799 0 599 - -Gruß, Micha. diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/1.99.3/gpm-evabs.patch b/software/gpm/browse_source/gpm-1.99.3/patches/1.99.3/gpm-evabs.patch deleted file mode 100644 index da23b490..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/1.99.3/gpm-evabs.patch +++ /dev/null @@ -1,327 +0,0 @@ -diff -ur gpm-1.99.2.2/src/daemon/cmdline.c gpm-1.99.2.2-patched/src/daemon/cmdline.c ---- gpm-1.99.2.2/src/daemon/cmdline.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/cmdline.c 2008-03-25 22:59:16.000000000 +0100 -@@ -32,7 +32,7 @@ - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -47,6 +47,7 @@ - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; -+ case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; -diff -ur gpm-1.99.2.2/src/daemon/gpm.c gpm-1.99.2.2-patched/src/daemon/gpm.c ---- gpm-1.99.2.2/src/daemon/gpm.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/gpm.c 2008-03-25 21:14:32.000000000 +0100 -@@ -73,9 +73,11 @@ - - struct mouse_features mouse_table[3] = { - { -- DEF_TYPE, DEF_DEV, DEF_SEQUENCE, -+ DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, -+ DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 -diff -ur gpm-1.99.2.2/src/daemon/processmouse.c gpm-1.99.2.2-patched/src/daemon/processmouse.c ---- gpm-1.99.2.2/src/daemon/processmouse.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/processmouse.c 2008-03-25 22:59:11.000000000 +0100 -@@ -55,6 +55,8 @@ - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; -+ int tempx, tempy; -+ static int oldx, oldy; - - oldT = event->type; - -@@ -77,6 +79,12 @@ - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - -+ /* use uncalibrated values as base values */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ nEvent.x = oldx; -+ nEvent.y = oldy; -+ } -+ - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { -@@ -123,6 +131,31 @@ - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - -+ /* apply calibration */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ /* save uncalibrated values for use next time around */ -+ oldx = nEvent.x; -+ oldy = nEvent.y; -+ -+ /* do calculations in a larger variable */ -+ tempx = nEvent.x; -+ tempy = nEvent.y; -+ tempx -= which_mouse->opt_dminx; -+ tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); -+ tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); -+ tempx += which_mouse->opt_ominx; -+ -+ tempy -= which_mouse->opt_dminy; -+ tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); -+ tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); -+ tempy += which_mouse->opt_ominy; -+ -+ nEvent.x = tempx; -+ nEvent.y = tempy; -+ -+ event->dx = (nEvent.x) - (event->x); -+ event->dy = (nEvent.y) - (event->y); -+ } - } /* if(eventFlag) */ - - /*....................................... update the button number */ -@@ -144,11 +177,63 @@ - } - rept1=rept2; - -- event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ /* if the values are calibrated, this is not necessary */ -+ if(which_mouse->opt_calib==NULL) -+ event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ - event->x=nEvent.x; - event->y=nEvent.y; - } -- repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ -+ -+ /* not all relative repeaters can handle big changes, -+ so repackage into several smaller updates */ -+ if (!repeated_type->absolute) { -+ int remx, remy; -+ remx = event->dx; -+ remy = event->dy; -+ -+ do { -+ if (remx<0) { -+ if (remx>=-127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = -127; -+ remx += 127; -+ } -+ } -+ if (remx>0) { -+ if (remx<=127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = 127; -+ remx -= 127; -+ } -+ } -+ if (remy<0) { -+ if (remy>=-127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = -127; -+ remy += 127; -+ } -+ } -+ if (remy>0) { -+ if (remy<=127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = 127; -+ remy -= 127; -+ } -+ } -+ repeated_type->repeat_fun(event, fifofd); -+ } while((remx!= 0)||(remy!=0)); -+ } -+ else -+ repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ -diff -ur gpm-1.99.2.2/src/daemon/startup.c gpm-1.99.2.2-patched/src/daemon/startup.c ---- gpm-1.99.2.2/src/daemon/startup.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/startup.c 2008-03-25 21:51:07.000000000 +0100 -@@ -36,6 +36,7 @@ - void startup(int argc, char **argv) - { - int i, opt; -+ FILE* calib_file; - - static struct { - char *in; -@@ -104,6 +105,21 @@ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); -+ if (which_mouse->opt_calib!=NULL) { -+ calib_file = fopen(which_mouse->opt_calib,"r"); -+ if (calib_file) { -+ if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", -+ &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, -+ &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) -+ which_mouse->opt_calib = NULL; -+ if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| -+ (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| -+ (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| -+ (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) -+ which_mouse->opt_calib = NULL; -+ } -+ fclose(calib_file); -+ } - } - - /* Check repeater status */ -diff -ur gpm-1.99.2.2/src/headers/daemon.h gpm-1.99.2.2-patched/src/headers/daemon.h ---- gpm-1.99.2.2/src/headers/daemon.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/daemon.h 2008-03-25 21:35:10.000000000 +0100 -@@ -82,7 +82,8 @@ - struct mouse_features { - char *opt_type, - *opt_dev, -- *opt_sequence; -+ *opt_sequence, -+ *opt_calib; - int opt_baud, - opt_sample, - opt_delta, -@@ -92,7 +93,15 @@ - opt_time, - opt_cluster, - opt_three, -- opt_glidepoint_tap; -+ opt_glidepoint_tap, -+ opt_dminx, -+ opt_dmaxx, -+ opt_dminy, -+ opt_dmaxy, -+ opt_ominx, -+ opt_omaxx, -+ opt_ominy, -+ opt_omaxy; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -142,6 +151,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -151,6 +161,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/gpmCfg.h gpm-1.99.2.2-patched/src/headers/gpmCfg.h ---- gpm-1.99.2.2/src/headers/gpmCfg.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/gpmCfg.h 2008-03-25 21:33:05.000000000 +0100 -@@ -48,6 +48,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -57,6 +58,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/message.h gpm-1.99.2.2-patched/src/headers/message.h ---- gpm-1.99.2.2/src/headers/message.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/message.h 2008-03-25 21:37:00.000000000 +0100 -@@ -75,6 +75,7 @@ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ -+ " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ -diff -ur gpm-1.99.2.2/src/mice.c gpm-1.99.2.2-patched/src/mice.c ---- gpm-1.99.2.2/src/mice.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/mice.c 2008-03-25 21:45:16.000000000 +0100 -@@ -140,6 +140,27 @@ - } - return 0; - } -+ -+static int M_evabs (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_ABS) { -+ if (thisevent.code == ABS_X) -+ state->x = thisevent.value; -+ else if (thisevent.code == ABS_Y) -+ state->y = thisevent.value; -+ } else if (thisevent.type == EV_KEY) { -+ switch(thisevent.code) { -+ case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; -+ case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; -+ case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; -+ } -+ } -+ return 0; -+} - #endif /* HAVE_LINUX_INPUT_H */ - - static int M_ms_plus(Gpm_Event *state, unsigned char *data) -@@ -2153,6 +2174,9 @@ - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -+ {"evabs", "Linux Event Device - absolute mode", -+ "", M_evabs, I_empty, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, - #endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz deleted file mode 100644 index bf630ad0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/MS3-PATCH-ANDREW.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/MS3-PATCH-ANDREW.gz deleted file mode 100644 index bf1a6d33..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/MS3-PATCH-ANDREW.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/OPEN_MAX.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/OPEN_MAX.gz deleted file mode 100644 index 98d577a9..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/OPEN_MAX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/VSXXX-AA-patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/VSXXX-AA-patch.gz deleted file mode 100644 index de76a90f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/VSXXX-AA-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_1.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_1.gz deleted file mode 100644 index 969a4294..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_2.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_2.gz deleted file mode 100644 index 03d782e1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_2.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_3.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_3.gz deleted file mode 100644 index 61655fbc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/andreas_mohr_3.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_12.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_12.gz deleted file mode 100644 index d27fb356..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_12.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_3rd-final?.tar.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_3rd-final?.tar.gz deleted file mode 100644 index 2317ced5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_3rd-final?.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_c_7.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_c_7.gz deleted file mode 100644 index 0c0e799b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/diff_synaptics_c_7.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/evdev.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/evdev.patch.gz deleted file mode 100644 index 11cfee16..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/evdev.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz deleted file mode 100644 index e09018f2..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz deleted file mode 100644 index 9c37a865..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz deleted file mode 100644 index ab2a7433..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz deleted file mode 100644 index 118b8572..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.20.0-wheel.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.20.0-wheel.patch.gz deleted file mode 100644 index ef7450ba..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.20.0-wheel.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz deleted file mode 100644 index e2c494a0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm06122002-cvs-tty.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm06122002-cvs-tty.patch.gz deleted file mode 100644 index fa16c22b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm06122002-cvs-tty.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm_synaptic_diff.gtar.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm_synaptic_diff.gtar.gz deleted file mode 100644 index 6872e2b8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm_synaptic_diff.gtar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm_unsigned_patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm_unsigned_patch.gz deleted file mode 100644 index 1f5b8862..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/gpm_unsigned_patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/repeater-patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/repeater-patch.gz deleted file mode 100644 index 4a590a94..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/repeater-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/repeater-patch.mail.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/repeater-patch.mail.gz deleted file mode 100644 index 8232d220..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/repeater-patch.mail.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/shlib-patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/shlib-patch.gz deleted file mode 100644 index 54a5cc01..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/applied/shlib-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch deleted file mode 100644 index 65a54431..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- gpm-1.19.3/gpm.c.serialconsole Fri Jan 5 14:10:46 2001 -+++ gpm-1.19.3/gpm.c Fri Jan 5 14:39:28 2001 -@@ -38,6 +38,7 @@ - #include /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.99.3/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.99.3/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.3/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.99.3/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.99.3/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.99.3/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.99.3/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.99.3/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.99.3/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.99.3/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.99.3/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.3/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.99.3/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.3/scripts/gpm.release b/software/gpm/browse_source/gpm-1.99.3/scripts/gpm.release deleted file mode 100644 index fbf03ef4..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/scripts/gpm.release +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.3/scripts/release-tar.sh b/software/gpm/browse_source/gpm-1.99.3/scripts/release-tar.sh deleted file mode 100644 index 8cce41b0..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/scripts/release-tar.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 20080313 - -version=$1 -hier=${0##*/} - -echo $hier - -[23:11] denkbrett:gpm% sha512sum gpm-1.20.3pre4.tar.bz2 > gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512suM -[23:12] denkbrett:gpm% chmod 0644 gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum home.schottelius.org:www/org/schottelius/unix/www/gpm/archives - - -[ "$version" ] || exit 3 - -git archive --format=tar --prefix=gpm-${version}/ HEAD | \ - tee ../gpm-${version}.tar | bzip2 -9 > ../gpm-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.3/src/Makefile.in b/software/gpm/browse_source/gpm-1.99.3/src/Makefile.in deleted file mode 100644 index 7816412e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/Makefile.in +++ /dev/null @@ -1,188 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -GDRIVERS = drivers/ms/m_ms.c \ - drivers/geni/m_geni.c \ - drivers/brw/m_brw.c \ - drivers/exps2/i_exps2.c \ - drivers/ms3/m_ms3.c drivers/ms3/r_ms3.c - -# mouse-test and gpm -GCOMMON = generic/check_no_argv.c generic/parse_argv.c \ - generic/limit_delta.o - -GSRC += $(GDRIVERS) -GSRC += $(GCOMMON) - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c - -DEFS = @DEFS@ - -STRIP = -s - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# old, unused, but good rule [dependings] -#%.d: $(srcdir)/%.c -# $(SHELL) -ec '$(CC) -M $(GPMCPPFLAGS) $(CPPFLAGS) $< \ -# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@' - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -# construct dependings of sourcefiles and link sourcefiles -$(DEPFILE) dep: prog/gpm-root.c - # make links in subdirectories - -@for cfiledirs in prog lib; do $(MKDIR) $$cfiledirs; \ - cd $$cfiledirs; for cfiles in `echo $(srcdir)/$$cfiledirs/*.c`; \ - do $(LN_S) $$cfiles 2>/dev/null; done; cd ..; done - - # make links in srcdir - -@for cfiles in `echo $(srcdir)/*.c`; do $(LN_S) $$cfiles 2>/dev/null; done - - # create dependencies - for DEPS in `echo *.c */*.c`; do \ - $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \ - $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# cleaning up section - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile $(DEPFILE) - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o \ - $(GCOMMON:.c=.o) $(GDRIVERS:.c=.o) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -include $(DEPFILE) diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/cmdline.c deleted file mode 100644 index ce1ead63..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/cmdline.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/getmousedata.c deleted file mode 100644 index c2ca26aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/getmousedata.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_DATA_4, data[0], data[1], data[2], data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm.c deleted file mode 100644 index 1436761e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, - DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/header.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/header.c deleted file mode 100644 index 28ad5431..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/header.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/main.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/main.c deleted file mode 100644 index 724e4db8..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "headers/gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/old_main.c deleted file mode 100644 index 9cd4e56b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/old_main.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/processconn.c deleted file mode 100644 index 5212c0cd..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/processmouse.c deleted file mode 100644 index 27e3e752..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/processmouse.c +++ /dev/null @@ -1,369 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - int tempx, tempy; - static int oldx, oldy; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - /* use uncalibrated values as base values */ - if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ - nEvent.x = oldx; - nEvent.y = oldy; - } - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - /* apply calibration */ - if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ - /* save uncalibrated values for use next time around */ - oldx = nEvent.x; - oldy = nEvent.y; - - /* do calculations in a larger variable */ - tempx = nEvent.x; - tempy = nEvent.y; - tempx -= which_mouse->opt_dminx; - tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); - tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); - tempx += which_mouse->opt_ominx; - - tempy -= which_mouse->opt_dminy; - tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); - tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); - tempy += which_mouse->opt_ominy; - - nEvent.x = tempx; - nEvent.y = tempy; - - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - /* if the values are calibrated, this is not necessary */ - if(which_mouse->opt_calib==NULL) - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - - event->x=nEvent.x; - event->y=nEvent.y; - } - - /* not all relative repeaters can handle big changes, - so repackage into several smaller updates */ - if (!repeated_type->absolute) { - int remx, remy; - remx = event->dx; - remy = event->dy; - - do { - if (remx<0) { - if (remx>=-127) { - event->dx = remx; - remx = 0; - } else { - event->dx = -127; - remx += 127; - } - } - if (remx>0) { - if (remx<=127) { - event->dx = remx; - remx = 0; - } else { - event->dx = 127; - remx -= 127; - } - } - if (remy<0) { - if (remy>=-127) { - event->dy = remy; - remy = 0; - } else { - event->dy = -127; - remy += 127; - } - } - if (remy>0) { - if (remy<=127) { - event->dy = remy; - remy = 0; - } else { - event->dy = 127; - remy -= 127; - } - } - repeated_type->repeat_fun(event, fifofd); - } while((remx!= 0)||(remy!=0)); - } - else - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/processrequest.c deleted file mode 100644 index 71e1140a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/startup.c deleted file mode 100644 index 16416e99..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/startup.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - FILE* calib_file; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - if (which_mouse->opt_calib!=NULL) { - calib_file = fopen(which_mouse->opt_calib,"r"); - if (calib_file) { - if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", - &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, - &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) - which_mouse->opt_calib = NULL; - if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| - (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| - (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| - (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) - which_mouse->opt_calib = NULL; - } - fclose(calib_file); - } - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.99.3/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/drivers/README b/software/gpm/browse_source/gpm-1.99.3/src/drivers/README deleted file mode 100644 index 666e0cf7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/drivers/README +++ /dev/null @@ -1,29 +0,0 @@ -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.99.3/src/drivers/brw/m_brw.c b/software/gpm/browse_source/gpm-1.99.3/src/drivers/brw/m_brw.c deleted file mode 100644 index e9bd128c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/drivers/brw/m_brw.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/daemon.h" /* daemon internals */ -#include "headers/message.h" /* messaging */ - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/drivers/exps2/i_exps2.c b/software/gpm/browse_source/gpm-1.99.3/src/drivers/exps2/i_exps2.c deleted file mode 100644 index 70ddba48..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/drivers/exps2/i_exps2.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* tcflush */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write(fd, s1, sizeof (s1)); - usleep(30000); - tcflush(fd, TCIFLUSH); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/drivers/geni/m_geni.c b/software/gpm/browse_source/gpm-1.99.3/src/drivers/geni/m_geni.c deleted file mode 100644 index 64a0f6eb..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/drivers/geni/m_geni.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/daemon.h" /* daemon internals */ - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms/m_ms.c b/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms/m_ms.c deleted file mode 100644 index 3ad29105..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms/m_ms.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -//#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms3/m_ms3.c b/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms3/m_ms3.c deleted file mode 100644 index fbdd9b60..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms3/m_ms3.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/daemon.h" /* daemon internals */ - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms3/r_ms3.c b/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms3/r_ms3.c deleted file mode 100644 index 0176d433..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/drivers/ms3/r_ms3.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/daemon.h" /* daemon internals */ - -int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/generic/check_no_argv.c b/software/gpm/browse_source/gpm-1.99.3/src/generic/check_no_argv.c deleted file mode 100644 index eda651f9..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/generic/check_no_argv.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/daemon.h" /* daemon internals */ - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.99.3/src/generic/getsym.c deleted file mode 100644 index b8f5bfcd..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/generic/getsym.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.99.3/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/generic/limit_delta.c b/software/gpm/browse_source/gpm-1.99.3/src/generic/limit_delta.c deleted file mode 100644 index 28e4592b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/generic/limit_delta.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/generic/parse_argv.c b/software/gpm/browse_source/gpm-1.99.3/src/generic/parse_argv.c deleted file mode 100644 index 7cae5f47..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/generic/parse_argv.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isalnum */ -#include /* fprintf */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.99.3/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.99.3/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.99.3/src/headers/daemon.h deleted file mode 100644 index 941af95e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/headers/daemon.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include /* fd_set */ - -/************************************************************************* - * Types / structures - */ - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence, - *opt_calib; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap, - opt_dminx, - opt_dmaxx, - opt_dminy, - opt_dmaxy, - opt_ominx, - opt_omaxx, - opt_ominy, - opt_omaxy; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/*======================================================================== - * Parsing argv: helper dats struct function - *========================================================================*/ -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); - -volatile int check_no_argv(int argc, char **argv); - -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int limit_delta(int delta, int min, int max); - -int open_console(const int mode); -int old_main(); - -int parse_argv(argv_helper *info, int argc, char **argv); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - -/************************************************************************* - * Drivers - */ - -Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); -int M_brw(Gpm_Event *state, unsigned char *data); - - -int M_ms(Gpm_Event *state, unsigned char *data); - -int M_ms3(Gpm_Event *state, unsigned char *data); -int R_ms3(Gpm_Event *state, int fd); - - -int M_geni(Gpm_Event *state, unsigned char *data); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.3/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.99.3/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.99.3/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.99.3/src/headers/gpmCfg.h deleted file mode 100644 index 5d96a8f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/headers/gpmCfg.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.99.3/src/headers/gpmInt.h deleted file mode 100644 index 397d9962..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/headers/gpmInt.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*** mouse commands ***/ - -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ - -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - - -/*....................................... Structures */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/headers/message.h b/software/gpm/browse_source/gpm-1.99.3/src/headers/message.h deleted file mode 100644 index 80ddcbe3..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "Ooo.ps(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE ", " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.99.3/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.3/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.99.3/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.99.3/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.99.3/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.99.3/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.99.3/src/lib/liblow.c deleted file mode 100644 index 25a1d5c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/lib/liblow.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.99.3/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.99.3/src/lib/report-lib.c deleted file mode 100644 index 812fdb8e..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/lib/report-lib.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/mice.c b/software/gpm/browse_source/gpm-1.99.3/src/mice.c deleted file mode 100644 index 7b0221eb..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/mice.c +++ /dev/null @@ -1,2285 +0,0 @@ -/* - * mice.c - mouse definitions for gpm-Linux - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -/* - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' - * fields of the Gpm_Event structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must - * be accessed. The global variable "win" is available for that use. - * - * The `data' parameter points to a byte-array with event data, as read - * by the mouse device. The mouse device should return a fixed number of - * bytes to signal an event, and that exact number is read by the server - * before calling one of these functions. - * - * The conversion function defined here should return 0 on success and -1 - * on failure. - * - * Refer to the definition of Gpm_Type to probe further. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include /* stat() */ -#include /* select() */ - -#include /* MAJOR */ -#include - -/* JOYSTICK */ -#ifdef HAVE_LINUX_JOYSTICK_H -#include -#endif - -/* EV DEVICE */ -#ifdef HAVE_LINUX_INPUT_H -#include -#endif /* HAVE_LINUX_INPUT_H */ - - -#include "headers/gpmInt.h" -#include "headers/daemon.h" -#include "headers/twiddler.h" -#include "headers/synaptics.h" -#include "headers/message.h" - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -static int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - -/*========================================================================*/ -/* real absolute coordinates for absolute devices, not very clean */ -/*========================================================================*/ - -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -int realposx=-1, realposy=-1; - -/*========================================================================*/ -/* - * Ok, here we are: first, provide the functions; initialization is later. - * The return value is the number of unprocessed bytes - */ -/*========================================================================*/ - -#ifdef HAVE_LINUX_INPUT_H -static int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} - -static int M_evabs (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_ABS) { - if (thisevent.code == ABS_X) - state->x = thisevent.value; - else if (thisevent.code == ABS_Y) - state->y = thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - -static int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - -static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100; -int summamaxx,summamaxy; -char summaid=-1; -static int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - -/* ps2 */ -static int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -static int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - -static int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - -static int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - -static int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - -static int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -/* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ -/* (processMouse) */ - -static int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - -static int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - -static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - -static int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - -static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - -static int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -static int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - -static int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - -/* standard ps2 */ -static Gpm_Type *I_ps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - -static Gpm_Type *I_netmouse(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -static int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL{ - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -} wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - -static int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -static int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - -static int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -static int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - -static int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ - -static int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - -static int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - * However, this one uses argv, which should be ported above as well. - * These variables are used for option passing - */ -static int gunze_avg = 9; /* the bigger the smoother */ -static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -static int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - -/* - * This decoder is copied and adapted from the above mtouch. - */ -static int elo_click_ontouch = 0; /* the bigger the smoother */ -static int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -static int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static int wizardpad_width = -1; -static int wizardpad_height = -1; -static int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} - -/*========================================================================*/ -/* Then, mice should be initialized */ - -static Gpm_Type* I_empty(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} - -static int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} - - - -static struct { - int sample; char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, }; - -static Gpm_Type* I_serial(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - -static Gpm_Type* I_logi(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - -static Gpm_Type *I_wacom(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} - -static Gpm_Type *I_pnp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -static int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -static int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - -static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - -static Gpm_Type *I_calus(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - -/* synaptics touchpad, ps2 version: Henry Davies */ -static Gpm_Type *I_synps2(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - -static Gpm_Type *I_summa(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} - -static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - -/* simple initialization for the gunze touchscreen */ -static Gpm_Type *I_gunze(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - - -/* simple initialization for the elo touchscreen */ -static Gpm_Type *I_etouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - -/*========================================================================*/ -/* Finally, the table */ -#define STD_FLG (CREAD|CLOCAL|HUPCL) - -/* - * Note that mman must be the first, and ms the second (I use this info - * in mouse-test.c, as a quick and dirty hack - * - * We should clean up mouse-test and sort the table alphabeticly! --nico - */ - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to gpmInt.h and gpm.c - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * Finally, a pointer to a repeater function, if any. - */ - -Gpm_Type mice[]={ - - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, - {"evabs", "Linux Event Device - absolute mode", - "", M_evabs, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; - -/*------------------------------------------------------------------------*/ -/* and the help */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - -/* indent: use three spaces. no tab. not two or four. three */ - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.99.3/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.99.3/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.99.3/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/prog/mev.c b/software/gpm/browse_source/gpm-1.99.3/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.99.3/src/prog/mouse-test.c deleted file mode 100644 index 0bb19822..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/prog/mouse-test.c +++ /dev/null @@ -1,740 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - -Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.99.3/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/report.c b/software/gpm/browse_source/gpm-1.99.3/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.99.3/src/synaptics.c b/software/gpm/browse_source/gpm-1.99.3/src/synaptics.c deleted file mode 100644 index 54d4aa3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/synaptics.c +++ /dev/null @@ -1,3305 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/tools.c b/software/gpm/browse_source/gpm-1.99.3/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.99.3/src/twiddler.c b/software/gpm/browse_source/gpm-1.99.3/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.99.3/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/.exclude b/software/gpm/browse_source/gpm-1.99.4/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.99.4/.gitignore b/software/gpm/browse_source/gpm-1.99.4/.gitignore deleted file mode 100644 index a7e802f2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -*.o -*.a -*.d -*.P -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in -src/gpm2/tmp -src/gpm2/out -.*.swp -doc/gpm.info -src/headers/drivers.h diff --git a/software/gpm/browse_source/gpm-1.99.4/BUGS b/software/gpm/browse_source/gpm-1.99.4/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.99.4/COPYING b/software/gpm/browse_source/gpm-1.99.4/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.99.4/Changes b/software/gpm/browse_source/gpm-1.99.4/Changes deleted file mode 100644 index fbc0a2a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/Changes +++ /dev/null @@ -1,51 +0,0 @@ -* From 1.20.1 to 1.20.3: (bugfix/code cleanup) - o Applied many cleanups - o Added etouch support - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.99.4/Changes.gpm2 b/software/gpm/browse_source/gpm-1.99.4/Changes.gpm2 deleted file mode 100644 index e2e5e24f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/Changes.gpm2 +++ /dev/null @@ -1,5 +0,0 @@ -1.99.4: - * Complete splitoff of mice.c! - * Renamed conf/ to example-configurations -1.99.3: Nico Schottelius, 20080326 - * Added evabs support diff --git a/software/gpm/browse_source/gpm-1.99.4/MANIFEST b/software/gpm/browse_source/gpm-1.99.4/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.99.4/Makefile.in b/software/gpm/browse_source/gpm-1.99.4/Makefile.in deleted file mode 100644 index 7ad54a19..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/Makefile.in +++ /dev/null @@ -1,115 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -check: all - -uninstall: do-uninstall -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf configure autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.99.4/Makefile.include.in b/software/gpm/browse_source/gpm-1.99.4/Makefile.include.in deleted file mode 100644 index 38fb0fb9..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/Makefile.include.in +++ /dev/null @@ -1,68 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001-2008 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -CFLAGS = -Iheaders @CFLAGS@ -MAKEDEPEND = $(CC) -M $(CPPFLAGS) -o $*.d $< -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.99.4/README b/software/gpm/browse_source/gpm-1.99.4/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.99.4/README.gpm2 b/software/gpm/browse_source/gpm-1.99.4/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.99.4/README.versions b/software/gpm/browse_source/gpm-1.99.4/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.4/TODO b/software/gpm/browse_source/gpm-1.99.4/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.99.4/acconfig.h b/software/gpm/browse_source/gpm-1.99.4/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.99.4/aclocal.m4 b/software/gpm/browse_source/gpm-1.99.4/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.99.4/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.99.4/build-from-git-and-run.sh deleted file mode 100644 index 7a609f63..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/build-from-git.sh" && sudo ./src/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/build-from-git.sh b/software/gpm/browse_source/gpm-1.99.4/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.99.4/configure.in b/software/gpm/browse_source/gpm-1.99.4/configure.in deleted file mode 100644 index c712fe1d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.99.4 -release_date="The summertime day, 30. March 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.99.4/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.99.4/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.99.4/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.99.4/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/other/README b/software/gpm/browse_source/gpm-1.99.4/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.99.4/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/Announce b/software/gpm/browse_source/gpm-1.99.4/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/FAQ b/software/gpm/browse_source/gpm-1.99.4/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.99.4/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/Makefile.in b/software/gpm/browse_source/gpm-1.99.4/doc/Makefile.in deleted file mode 100644 index d8b95c65..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/Makefile.in +++ /dev/null @@ -1,180 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.99.4/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/README.etouch b/software/gpm/browse_source/gpm-1.99.4/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/README.gunze b/software/gpm/browse_source/gpm-1.99.4/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/README.microtouch b/software/gpm/browse_source/gpm-1.99.4/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/README.synaptics b/software/gpm/browse_source/gpm-1.99.4/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/README.twiddler b/software/gpm/browse_source/gpm-1.99.4/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.99.4/doc/doc.gpm.in deleted file mode 100644 index bc800fa1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001,2002 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001,2002 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/infofilter b/software/gpm/browse_source/gpm-1.99.4/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/manpager b/software/gpm/browse_source/gpm-1.99.4/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/mktxt b/software/gpm/browse_source/gpm-1.99.4/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/old/Changelog b/software/gpm/browse_source/gpm-1.99.4/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/old/README b/software/gpm/browse_source/gpm-1.99.4/doc/old/README deleted file mode 100644 index 8429b4d4..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/old/README +++ /dev/null @@ -1,5 +0,0 @@ -These documents are here for historical reason. - -They are not maintained anymore. - -They may or may not contain false / outdated information. diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.99.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.99.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/support/README b/software/gpm/browse_source/gpm-1.99.4/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.99.4/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.99.4/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/tests/1.99.2.2 b/software/gpm/browse_source/gpm-1.99.4/doc/tests/1.99.2.2 deleted file mode 100644 index cf8eec8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/tests/1.99.2.2 +++ /dev/null @@ -1,2 +0,0 @@ -- gpm with mc test: - * click on items works: yes (using -m /dev/psaux -t ps2) diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.3 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.3 deleted file mode 100644 index ff06dad5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.3 +++ /dev/null @@ -1,2 +0,0 @@ -- fixup major bugs in 1.20.1 -Codename: Eiche diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.4 deleted file mode 100644 index 5fdec17c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate add daemon and library stuff cleanly -x split off gpm.c and gpn.c diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.7 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.7 deleted file mode 100644 index 09ec71d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.20.7 +++ /dev/null @@ -1,2 +0,0 @@ -- cleanup protocol names -- cleanup autoconf diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.10 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.10 deleted file mode 100644 index 0e99632f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.10 +++ /dev/null @@ -1,4 +0,0 @@ -- mice driver: - * load them dynamically - * do not require senseless header (all functions have the same type) - * add option to include some statically diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.11 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.11 deleted file mode 100644 index a89986c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.11 +++ /dev/null @@ -1,3 +0,0 @@ -- Double check multimouse support / begin gpm2 model - * Make sure, drivers do not reference parts from other drivers - Like etouch / gunze diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.2 deleted file mode 100644 index 841c6162..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - -> begun diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.3 deleted file mode 100644 index 9ea392f7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.3 +++ /dev/null @@ -1 +0,0 @@ -- Apply Evabs-patch diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.4 deleted file mode 100644 index 06e5b6a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- finish splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.5 deleted file mode 100644 index 3a94c0a9..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.5 +++ /dev/null @@ -1,14 +0,0 @@ -- finish gpm2/doc/DESIGN -- check for rmev (1.19.6 or 1.17.8) -- add commit to version, if git version is exiting: - git-show --abbrev-commit - -x git - -d .git -- use -Werror -W -Wall - -pipe, too? - -- cleanup autoconf stuff -- try to implement n mice by usage of add_mouse -- add help for calib file in English -- Fixes: Remove glibc-hacks, where possible and posix conform: processConn -- add document, that describes on howto add a new driver diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.6 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.6 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.7 deleted file mode 100644 index 809c0ad3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.7 +++ /dev/null @@ -1,2 +0,0 @@ -- first vertical prototype: have one mouse input running -- check for senseful use of global variables (gunze_calib, etouch diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.8 deleted file mode 100644 index 0f6211a5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.8 +++ /dev/null @@ -1,4 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd -- double check that the os speficih code is in gpm2/os// - prefix os specific drivers with OS-name? - like linux event and joystick diff --git a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.9 deleted file mode 100644 index c8a1cb4b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/doc/todo/1.99.9 +++ /dev/null @@ -1,2 +0,0 @@ -- cleanly design conf/ -- splitoff twiddler.c diff --git a/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-root.conf b/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-syn.conf b/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/example-configurations/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.99.4/install-sh b/software/gpm/browse_source/gpm-1.99.4/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i -To: spida //at\\ spida.net -Subject: gpm-calib.conf -Hi Timo! - -Das Dateiformat sieht wie folgt aus: - -ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max - -wobei alle e* die Reichweite der Koordinaten angeben, die aus dem -Event-Interface kommen und alle r* die Bilschirmkoordinaten sind, auf -die abgebildet wird. Alle Werte werden nur von Leerzeichen getrennt. -Das eGalax gibt über das Event-Interface ungefähr Werte zwischen 0 und -2000 für beide Achsen aus. Die Bildschirmkoordinaten sollten immer auf 0 -beim Minimum und auf der Bildschirmauflösung minus 1 beim Maximum -stehen. Für Textmodi entspricht die Auflösung der Textauflösung. Bei -Framebuffer-Konsolen kann ich es nicht mit Sicherheit sagen. - -Für 800x600 auf dem eGalax sollte die Datei also ungefähr so aussehen: - -50 1950 50 1950 0 799 0 599 - -Gruß, Micha. diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/1.99.3/gpm-evabs.patch b/software/gpm/browse_source/gpm-1.99.4/patches/1.99.3/gpm-evabs.patch deleted file mode 100644 index da23b490..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/1.99.3/gpm-evabs.patch +++ /dev/null @@ -1,327 +0,0 @@ -diff -ur gpm-1.99.2.2/src/daemon/cmdline.c gpm-1.99.2.2-patched/src/daemon/cmdline.c ---- gpm-1.99.2.2/src/daemon/cmdline.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/cmdline.c 2008-03-25 22:59:16.000000000 +0100 -@@ -32,7 +32,7 @@ - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -47,6 +47,7 @@ - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; -+ case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; -diff -ur gpm-1.99.2.2/src/daemon/gpm.c gpm-1.99.2.2-patched/src/daemon/gpm.c ---- gpm-1.99.2.2/src/daemon/gpm.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/gpm.c 2008-03-25 21:14:32.000000000 +0100 -@@ -73,9 +73,11 @@ - - struct mouse_features mouse_table[3] = { - { -- DEF_TYPE, DEF_DEV, DEF_SEQUENCE, -+ DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, -+ DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 -diff -ur gpm-1.99.2.2/src/daemon/processmouse.c gpm-1.99.2.2-patched/src/daemon/processmouse.c ---- gpm-1.99.2.2/src/daemon/processmouse.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/processmouse.c 2008-03-25 22:59:11.000000000 +0100 -@@ -55,6 +55,8 @@ - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; -+ int tempx, tempy; -+ static int oldx, oldy; - - oldT = event->type; - -@@ -77,6 +79,12 @@ - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - -+ /* use uncalibrated values as base values */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ nEvent.x = oldx; -+ nEvent.y = oldy; -+ } -+ - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { -@@ -123,6 +131,31 @@ - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - -+ /* apply calibration */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ /* save uncalibrated values for use next time around */ -+ oldx = nEvent.x; -+ oldy = nEvent.y; -+ -+ /* do calculations in a larger variable */ -+ tempx = nEvent.x; -+ tempy = nEvent.y; -+ tempx -= which_mouse->opt_dminx; -+ tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); -+ tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); -+ tempx += which_mouse->opt_ominx; -+ -+ tempy -= which_mouse->opt_dminy; -+ tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); -+ tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); -+ tempy += which_mouse->opt_ominy; -+ -+ nEvent.x = tempx; -+ nEvent.y = tempy; -+ -+ event->dx = (nEvent.x) - (event->x); -+ event->dy = (nEvent.y) - (event->y); -+ } - } /* if(eventFlag) */ - - /*....................................... update the button number */ -@@ -144,11 +177,63 @@ - } - rept1=rept2; - -- event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ /* if the values are calibrated, this is not necessary */ -+ if(which_mouse->opt_calib==NULL) -+ event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ - event->x=nEvent.x; - event->y=nEvent.y; - } -- repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ -+ -+ /* not all relative repeaters can handle big changes, -+ so repackage into several smaller updates */ -+ if (!repeated_type->absolute) { -+ int remx, remy; -+ remx = event->dx; -+ remy = event->dy; -+ -+ do { -+ if (remx<0) { -+ if (remx>=-127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = -127; -+ remx += 127; -+ } -+ } -+ if (remx>0) { -+ if (remx<=127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = 127; -+ remx -= 127; -+ } -+ } -+ if (remy<0) { -+ if (remy>=-127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = -127; -+ remy += 127; -+ } -+ } -+ if (remy>0) { -+ if (remy<=127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = 127; -+ remy -= 127; -+ } -+ } -+ repeated_type->repeat_fun(event, fifofd); -+ } while((remx!= 0)||(remy!=0)); -+ } -+ else -+ repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ -diff -ur gpm-1.99.2.2/src/daemon/startup.c gpm-1.99.2.2-patched/src/daemon/startup.c ---- gpm-1.99.2.2/src/daemon/startup.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/startup.c 2008-03-25 21:51:07.000000000 +0100 -@@ -36,6 +36,7 @@ - void startup(int argc, char **argv) - { - int i, opt; -+ FILE* calib_file; - - static struct { - char *in; -@@ -104,6 +105,21 @@ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); -+ if (which_mouse->opt_calib!=NULL) { -+ calib_file = fopen(which_mouse->opt_calib,"r"); -+ if (calib_file) { -+ if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", -+ &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, -+ &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) -+ which_mouse->opt_calib = NULL; -+ if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| -+ (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| -+ (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| -+ (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) -+ which_mouse->opt_calib = NULL; -+ } -+ fclose(calib_file); -+ } - } - - /* Check repeater status */ -diff -ur gpm-1.99.2.2/src/headers/daemon.h gpm-1.99.2.2-patched/src/headers/daemon.h ---- gpm-1.99.2.2/src/headers/daemon.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/daemon.h 2008-03-25 21:35:10.000000000 +0100 -@@ -82,7 +82,8 @@ - struct mouse_features { - char *opt_type, - *opt_dev, -- *opt_sequence; -+ *opt_sequence, -+ *opt_calib; - int opt_baud, - opt_sample, - opt_delta, -@@ -92,7 +93,15 @@ - opt_time, - opt_cluster, - opt_three, -- opt_glidepoint_tap; -+ opt_glidepoint_tap, -+ opt_dminx, -+ opt_dmaxx, -+ opt_dminy, -+ opt_dmaxy, -+ opt_ominx, -+ opt_omaxx, -+ opt_ominy, -+ opt_omaxy; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -142,6 +151,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -151,6 +161,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/gpmCfg.h gpm-1.99.2.2-patched/src/headers/gpmCfg.h ---- gpm-1.99.2.2/src/headers/gpmCfg.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/gpmCfg.h 2008-03-25 21:33:05.000000000 +0100 -@@ -48,6 +48,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -57,6 +58,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/message.h gpm-1.99.2.2-patched/src/headers/message.h ---- gpm-1.99.2.2/src/headers/message.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/message.h 2008-03-25 21:37:00.000000000 +0100 -@@ -75,6 +75,7 @@ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ -+ " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ -diff -ur gpm-1.99.2.2/src/mice.c gpm-1.99.2.2-patched/src/mice.c ---- gpm-1.99.2.2/src/mice.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/mice.c 2008-03-25 21:45:16.000000000 +0100 -@@ -140,6 +140,27 @@ - } - return 0; - } -+ -+static int M_evabs (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_ABS) { -+ if (thisevent.code == ABS_X) -+ state->x = thisevent.value; -+ else if (thisevent.code == ABS_Y) -+ state->y = thisevent.value; -+ } else if (thisevent.type == EV_KEY) { -+ switch(thisevent.code) { -+ case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; -+ case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; -+ case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; -+ } -+ } -+ return 0; -+} - #endif /* HAVE_LINUX_INPUT_H */ - - static int M_ms_plus(Gpm_Event *state, unsigned char *data) -@@ -2153,6 +2174,9 @@ - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -+ {"evabs", "Linux Event Device - absolute mode", -+ "", M_evabs, I_empty, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, - #endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz deleted file mode 100644 index bf630ad0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/MS3-PATCH-ANDREW.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/MS3-PATCH-ANDREW.gz deleted file mode 100644 index bf1a6d33..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/MS3-PATCH-ANDREW.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/OPEN_MAX.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/OPEN_MAX.gz deleted file mode 100644 index 98d577a9..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/OPEN_MAX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/VSXXX-AA-patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/VSXXX-AA-patch.gz deleted file mode 100644 index de76a90f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/VSXXX-AA-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_1.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_1.gz deleted file mode 100644 index 969a4294..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_2.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_2.gz deleted file mode 100644 index 03d782e1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_2.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_3.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_3.gz deleted file mode 100644 index 61655fbc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/andreas_mohr_3.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_12.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_12.gz deleted file mode 100644 index d27fb356..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_12.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_3rd-final?.tar.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_3rd-final?.tar.gz deleted file mode 100644 index 2317ced5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_3rd-final?.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_c_7.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_c_7.gz deleted file mode 100644 index 0c0e799b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/diff_synaptics_c_7.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/evdev.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/evdev.patch.gz deleted file mode 100644 index 11cfee16..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/evdev.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz deleted file mode 100644 index e09018f2..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz deleted file mode 100644 index 9c37a865..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz deleted file mode 100644 index ab2a7433..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz deleted file mode 100644 index 118b8572..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.20.0-wheel.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.20.0-wheel.patch.gz deleted file mode 100644 index ef7450ba..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.20.0-wheel.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz deleted file mode 100644 index e2c494a0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm06122002-cvs-tty.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm06122002-cvs-tty.patch.gz deleted file mode 100644 index fa16c22b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm06122002-cvs-tty.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm_synaptic_diff.gtar.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm_synaptic_diff.gtar.gz deleted file mode 100644 index 6872e2b8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm_synaptic_diff.gtar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm_unsigned_patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm_unsigned_patch.gz deleted file mode 100644 index 1f5b8862..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/gpm_unsigned_patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/repeater-patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/repeater-patch.gz deleted file mode 100644 index 4a590a94..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/repeater-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/repeater-patch.mail.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/repeater-patch.mail.gz deleted file mode 100644 index 8232d220..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/repeater-patch.mail.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/shlib-patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/shlib-patch.gz deleted file mode 100644 index 54a5cc01..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/applied/shlib-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch deleted file mode 100644 index 65a54431..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- gpm-1.19.3/gpm.c.serialconsole Fri Jan 5 14:10:46 2001 -+++ gpm-1.19.3/gpm.c Fri Jan 5 14:39:28 2001 -@@ -38,6 +38,7 @@ - #include /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.99.4/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.99.4/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.4/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.99.4/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.99.4/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.99.4/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.99.4/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.99.4/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.99.4/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.99.4/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.99.4/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.4/scripts/generate_drivers_header.sh b/software/gpm/browse_source/gpm-1.99.4/scripts/generate_drivers_header.sh deleted file mode 100644 index 670e7638..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/scripts/generate_drivers_header.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-gpm2008 at schottelius.org) -# -# This file is part of gpm. -# -# gpm 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. -# -# gpm 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 gpm. If not, see . -# - -cat << eof -/* - * Warning: This file is autogenerated by $0. - * - * DO NOT EDIT IT, ALL CHANGES WILL BE LOST IN ANY CASE. - * - */ - -#ifndef __GPM__DRIVER_H -#define __GPM__DRIVER_H - -eof - -( - grep -h "^int M_" src/drivers/*/m.c - grep -h "^Gpm_Type" src/drivers/*/i.c - grep -h "^int R_" src/drivers/*/r.c -) | sed 's/$/;/' - -echo "#endif" diff --git a/software/gpm/browse_source/gpm-1.99.4/scripts/generate_drivers_makefile.sh b/software/gpm/browse_source/gpm-1.99.4/scripts/generate_drivers_makefile.sh deleted file mode 100644 index 3646b2f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/scripts/generate_drivers_makefile.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-gpm2008 at schottelius.org) -# -# This file is part of gpm. -# -# gpm 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. -# -# gpm 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 gpm. If not, see . -# - -cat << eof -# -# Warning: This file is autogenerated by $0. -# -# DO NOT EDIT IT, ALL CHANGES WILL BE LOST IN ANY CASE. -# -# - -GDRIVERS = \\ -eof - -( - cd src - ls drivers/*/*.c -) | sed 's/$/ \\/' - -# append an empty line -echo "" diff --git a/software/gpm/browse_source/gpm-1.99.4/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.99.4/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.4/scripts/gpm.release b/software/gpm/browse_source/gpm-1.99.4/scripts/gpm.release deleted file mode 100644 index fbf03ef4..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/scripts/gpm.release +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.4/scripts/gpm2.release b/software/gpm/browse_source/gpm-1.99.4/scripts/gpm2.release deleted file mode 100644 index c675a0e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/scripts/gpm2.release +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -if [ $# -ne 1 ]; then - echo "This is a maintainer-only script to release cinit" - echo $(basename $0): version - exit 1 -fi - -if [ ! -d .git ]; then - echo "Missing .git" - exit 1 -fi - -set -e -version_1="$1" -version_conf="$(awk -F= '/^release=/ { print $2 }' configure.in)" - -hier=${0%/*} - -echo "=> Version you want: $version_1" -echo "=> Version conf: $version_conf" - -if [ "$version_1" = "$version_conf" ]; then - echo "=> Version confirmed." -else - echo "That is not ok" - exit 1 -fi - -TAR_NAME="gpm-${version_1}.tar.bz2" -OUT_NAME="../$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "Release version $version_1 and copy to ${D_HOST}?" -echo -n "=> Continue? " -read yes - -echo "Creating bzip2 compressed tar" -#tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -"${hier}/git-archiv-tarbz2.sh" "${version_1}" - -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" - -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$TAR_NAME -C $D_SOURCE" - -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.4/scripts/release-tar.sh b/software/gpm/browse_source/gpm-1.99.4/scripts/release-tar.sh deleted file mode 100644 index 8cce41b0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/scripts/release-tar.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 20080313 - -version=$1 -hier=${0##*/} - -echo $hier - -[23:11] denkbrett:gpm% sha512sum gpm-1.20.3pre4.tar.bz2 > gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512suM -[23:12] denkbrett:gpm% chmod 0644 gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum home.schottelius.org:www/org/schottelius/unix/www/gpm/archives - - -[ "$version" ] || exit 3 - -git archive --format=tar --prefix=gpm-${version}/ HEAD | \ - tee ../gpm-${version}.tar | bzip2 -9 > ../gpm-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.4/src/Makefile.in b/software/gpm/browse_source/gpm-1.99.4/src/Makefile.in deleted file mode 100644 index 23661e0c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/Makefile.in +++ /dev/null @@ -1,182 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. -include $(top_builddir)/Makefile.include - -# Main portion: regular build rules - -GSRC = mice.c twiddler.c synaptics.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - generic/isodigit.c generic/getsym.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -# mouse-test and gpm -GCOMMON = generic/check_no_argv.c generic/parse_argv.c \ - generic/limit_delta.c generic/option_modem_lines.c \ - generic/setspeed.c generic/read_mouse_id.c \ - generic/m_listtypes.c generic/write_to_mouse.c - - -GSRC += $(GDRIVERS) -GSRC += $(GCOMMON) - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c -SRCSP= $(SRCS:.c=.P) - -DEFS = @DEFS@ - -STRIP = -s - -### GENERATED INCLUDES - --include Makefile.drivers.generated -$(GDRIVERS): headers/drivers.h -headers/drivers.h: - ../scripts/generate_drivers_header.sh > $@ - --include $(SRCSP) - -Makefile.drivers.generated: - ../scripts/generate_drivers_makefile.sh > $@ - - - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) -MD @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - @cp $*.d $*.P; \ - sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ - -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ - #rm -f $*.d - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -# Do it all! -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# cleaning up section - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ $(RDEPS) - rm -f core *~ $(GOBJ) $(LOBJ) $(POBJ) $(PICS) gpm-root.c $(DEPFILE) - rm -f $(PROG) $(POBJ) prog/gpm-root.c - rm -f $(SRCSP) - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile $(DEPFILE) - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o prog/open_console.o \ - $(GCOMMON:.c=.o) $(GDRIVERS:.c=.o) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/add_mouse.c deleted file mode 100644 index 5507246c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/build_argv.c deleted file mode 100644 index 82a5d0f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "headers/message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/check_kill.c deleted file mode 100644 index 10891d9a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/check_uniqueness.c deleted file mode 100644 index 4972413f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/cmdline.c deleted file mode 100644 index 7cbebc86..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/cmdline.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/disable_paste.c deleted file mode 100644 index c0d90a3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/do_client.c deleted file mode 100644 index 587fa46d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/do_selection.c deleted file mode 100644 index 0589c273..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 64d016a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/get_console_size.c deleted file mode 100644 index 021aa64e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/get_data.c deleted file mode 100644 index a4fb03c5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/getmousedata.c deleted file mode 100644 index d32f4cba..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/getmousedata.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ -#include "mice.h" /* GPM MAGIC */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_DATA_4, data[0], data[1], data[2], data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm-killed.c deleted file mode 100644 index 1293cf14..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm.c deleted file mode 100644 index 1436761e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" /* old daemon header */ -#include "headers/message.h" - -#include "headers/daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, - DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm_exited.c deleted file mode 100644 index 77683f50..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/init_mice.c deleted file mode 100644 index fad530d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/loadlut.c deleted file mode 100644 index 8dbc72ee..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym(charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym(charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/main.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/main.c deleted file mode 100644 index a37cd410..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "gpmInt.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/old_main.c deleted file mode 100644 index 8d667046..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/old_main.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -int realposx=-1; -int realposy=-1; - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, (which_mouse->m_type), kd_mode)) - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ - /* can't we please rewrite the following a bit nicer?*/ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/open_console.c deleted file mode 100644 index fa277e22..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/open_console.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; - struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - if (si.line > 0) { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - } - } - } - return fd; - } else - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/processconn.c deleted file mode 100644 index 5212c0cd..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/processconn.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/processmouse.c deleted file mode 100644 index 27e3e752..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/processmouse.c +++ /dev/null @@ -1,369 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode) -{ - char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - int tempx, tempy; - static int oldx, oldy; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - /* use uncalibrated values as base values */ - if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ - nEvent.x = oldx; - nEvent.y = oldy; - } - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - /* apply calibration */ - if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ - /* save uncalibrated values for use next time around */ - oldx = nEvent.x; - oldy = nEvent.y; - - /* do calculations in a larger variable */ - tempx = nEvent.x; - tempy = nEvent.y; - tempx -= which_mouse->opt_dminx; - tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); - tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); - tempx += which_mouse->opt_ominx; - - tempy -= which_mouse->opt_dminy; - tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); - tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); - tempy += which_mouse->opt_ominy; - - nEvent.x = tempx; - nEvent.y = tempy; - - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - /* if the values are calibrated, this is not necessary */ - if(which_mouse->opt_calib==NULL) - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - - event->x=nEvent.x; - event->y=nEvent.y; - } - - /* not all relative repeaters can handle big changes, - so repackage into several smaller updates */ - if (!repeated_type->absolute) { - int remx, remy; - remx = event->dx; - remy = event->dy; - - do { - if (remx<0) { - if (remx>=-127) { - event->dx = remx; - remx = 0; - } else { - event->dx = -127; - remx += 127; - } - } - if (remx>0) { - if (remx<=127) { - event->dx = remx; - remx = 0; - } else { - event->dx = 127; - remx -= 127; - } - } - if (remy<0) { - if (remy>=-127) { - event->dy = remy; - remy = 0; - } else { - event->dy = -127; - remy += 127; - } - } - if (remy>0) { - if (remy<=127) { - event->dy = remy; - remy = 0; - } else { - event->dy = 127; - remy -= 127; - } - } - repeated_type->repeat_fun(event, fifofd); - } while((remx!= 0)||(remy!=0)); - } - else - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/processrequest.c deleted file mode 100644 index 71e1140a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/processspecial.c deleted file mode 100644 index fce86efd..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/selection_copy.c deleted file mode 100644 index 124c6136..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (headers/message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/selection_paste.c deleted file mode 100644 index 6a9086e7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/startup.c deleted file mode 100644 index 16416e99..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/startup.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - FILE* calib_file; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - if (which_mouse->opt_calib!=NULL) { - calib_file = fopen(which_mouse->opt_calib,"r"); - if (calib_file) { - if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", - &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, - &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) - which_mouse->opt_calib = NULL; - if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| - (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| - (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| - (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) - which_mouse->opt_calib = NULL; - } - fclose(calib_file); - } - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/usage.c deleted file mode 100644 index db587b7d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.99.4/src/daemon/wait_text.c deleted file mode 100644 index 0213adbc..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ -#include "headers/gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/README b/software/gpm/browse_source/gpm-1.99.4/src/drivers/README deleted file mode 100644 index 957c5b56..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/README +++ /dev/null @@ -1,32 +0,0 @@ -Write definiton of I_*, M_* and R_* in one line (needed by ./scripts/generate_drivers_header.sh). - - -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/bare/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/bare/m.c deleted file mode 100644 index 6bd336b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/bare/m.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/bm/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/bm/m.c deleted file mode 100644 index a3ade9cf..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/bm/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/brw/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/brw/m.c deleted file mode 100644 index 9a85b3c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/brw/m.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "mice.h" /* Gpm_type */ -#include "message.h" /* messaging */ - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus/i.c deleted file mode 100644 index 36439e61..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus/i.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice stuff */ -#include "daemon.h" /* which_mouse */ -#include "drivers.h" /* I_serial */ - - -Gpm_Type *I_calus(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus/m.c deleted file mode 100644 index 68e84dd3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus/m.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* win */ -#include "mice.h" /* realposy */ - - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus_rel/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus_rel/m.c deleted file mode 100644 index e35e5b4e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/calus_rel/m.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* abs */ - - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/empty/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/empty/i.c deleted file mode 100644 index eb136a63..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/empty/i.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ - - -Gpm_Type* I_empty(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/etouch.h b/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/etouch.h deleted file mode 100644 index da4a235c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/etouch.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_DRV_ETOUCH -#define _GPM_DRV_ETOUCH - -extern int elo_click_ontouch; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/i.c deleted file mode 100644 index 9dd66ddf..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/i.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ - -#include "types.h" /* Gpm_type */ -#include "etouch.h" /* etouch specs */ -#include "message.h" /* reporting */ -#include "mice.h" /* parse_argv */ -#include "daemon.h" /* options */ - -extern int gunze_calib[4]; /* FIXME: do not depend on other drivers! */ - -/* simple initialization for the elo touchscreen */ -Gpm_Type *I_etouch(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, - calibok = 0; - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/m.c deleted file mode 100644 index 59020f0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/etouch/m.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "etouch.h" /* etouch specs */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse */ - -int elo_click_ontouch = 0; /* the bigger the smoother */ - -extern int gunze_calib[4]; /* FIXME: do not depend on other drivers! */ - -int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/evabs/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/evabs/m.c deleted file mode 100644 index 7d0c46e8..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/evabs/m.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -#include /* FIXME: Linux specific: thisevent */ -#include /* memcpy */ - - -#ifdef HAVE_LINUX_INPUT_H -int M_evabs (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_ABS) { - if (thisevent.code == ABS_X) - state->x = thisevent.value; - else if (thisevent.code == ABS_Y) - state->y = thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/evdev/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/evdev/m.c deleted file mode 100644 index 1a52c45b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/evdev/m.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* FIXME: Linux specific: thisevent */ -#include /* memcpy */ - -#include "types.h" /* Gpm_type */ - - -#ifdef HAVE_LINUX_INPUT_H - -int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/exps2/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/exps2/i.c deleted file mode 100644 index 76fd6ab1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/exps2/i.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - - -#include /* usleep, write */ -#include /* tcflush */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - if (check_no_argv(argc, argv)) return NULL; - - write(fd, s1, sizeof (s1)); - usleep(30000); - tcflush(fd, TCIFLUSH); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/geni/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/geni/m.c deleted file mode 100644 index 64256b0f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/geni/m.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -#include "headers/daemon.h" /* daemon internals */ - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/gunze/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/gunze/i.c deleted file mode 100644 index 71d0d66d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/gunze/i.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include "types.h" /* Gpm_type */ -#include "mice.h" /* ‘parse_argv’ */ -#include "daemon.h" /* ‘which_mouse’ */ -#include "message.h" /* gpm_report */ - -/* from m.c */ -extern int gunze_avg; -extern int gunze_calib[4]; -extern int gunze_debounce; - - -/* simple initialization for the gunze touchscreen */ -Gpm_Type *I_gunze(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/gunze/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/gunze/m.c deleted file mode 100644 index 5456dd2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/gunze/m.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "message.h" /* gpm_report */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse */ - - -int gunze_avg = 9; /* the bigger the smoother */ -int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf(data+1, "%d,%d", &x, &y)!= 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/header.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/header.c deleted file mode 100644 index e11a8ad3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/header.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/i.c deleted file mode 100644 index 2979c8c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/i.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* GPM_AUX_ENABLE_DEV */ -#include "message.h" /* messaging */ -#include "daemon.h" /* mice */ - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/m.c deleted file mode 100644 index 123e65c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/m.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ - - -int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/r.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/r.c deleted file mode 100644 index 117727c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/imps2/r.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/js/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/js/m.c deleted file mode 100644 index 10374b00..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/js/m.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ -int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/logi/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/logi/i.c deleted file mode 100644 index c3470757..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/logi/i.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* fstat */ -#include /* termios */ -#include /* usleep, write */ -#include /* FIXME: Linux specific: MAJOR */ - - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ -#include "daemon.h" /* which_mouse */ - -struct { - int sample; - char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, - }; - - -Gpm_Type* I_logi(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse=(i != MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/logi/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/logi/m.c deleted file mode 100644 index 424163c5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/logi/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/logimsc/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/logimsc/m.c deleted file mode 100644 index bb5440d9..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/logimsc/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/mm/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/mm/m.c deleted file mode 100644 index b6b0f120..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/mm/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/mman/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/mman/m.c deleted file mode 100644 index 80b1ee8f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/mman/m.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice */ -#include "daemon.h" /* which_mouse */ - - -int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms/m.c deleted file mode 100644 index c8642d74..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms/m.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "headers/daemon.h" /* daemon internals */ - -int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms3/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms3/m.c deleted file mode 100644 index 641eb1a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms3/m.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "headers/daemon.h" /* daemon internals */ - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms3/r.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms3/r.c deleted file mode 100644 index 2fb82239..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms3/r.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "headers/daemon.h" /* daemon internals */ - -int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms_plus/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms_plus/m.c deleted file mode 100644 index d4c16ada..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms_plus/m.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "headers/daemon.h" /* daemon internals */ - -int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms_plus_lr/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms_plus_lr/m.c deleted file mode 100644 index efd21da0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ms_plus_lr/m.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/msc/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/msc/m.c deleted file mode 100644 index c1c12e64..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/msc/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/msc/r.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/msc/r.c deleted file mode 100644 index 4187b2dc..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/msc/r.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/mtouch/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/mtouch/i.c deleted file mode 100644 index ea228f80..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/mtouch/i.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* termios */ - -#include "types.h" /* Gpm_type */ - - -Gpm_Type *I_mtouch(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/mtouch/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/mtouch/m.c deleted file mode 100644 index ff4e97e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/mtouch/m.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice */ -#include "daemon.h" /* which_mouse */ - -int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ncr/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ncr/m.c deleted file mode 100644 index 3637a87a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ncr/m.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - - - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* win */ - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/netmouse/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/netmouse/i.c deleted file mode 100644 index 12a4c5c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/netmouse/i.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ - - -Gpm_Type *I_netmouse(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/netmouse/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/netmouse/m.c deleted file mode 100644 index afe0ec46..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/netmouse/m.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/pnp/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/pnp/i.c deleted file mode 100644 index ba031db8..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/pnp/i.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* option_modem_lines */ - - -Gpm_Type *I_pnp(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/i.c deleted file mode 100644 index 0a674d0f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/i.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* termios */ - -#include "types.h" /* Gpm_type */ - -/* standard ps2 */ -Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/m.c deleted file mode 100644 index 937b6f89..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/m.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ - - -int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/r.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/r.c deleted file mode 100644 index d99078a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/ps2/r.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -/* ps2 */ -int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/serial/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/serial/i.c deleted file mode 100644 index cc75bb32..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/serial/i.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* select */ -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ -#include "drivers.h" /* other drivers */ -#include "daemon.h" /* which_mouse */ - - - -Gpm_Type* I_serial(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int i; - unsigned char c; - fd_set set; - struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/i.c deleted file mode 100644 index 0f1de6c3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/i.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* select */ -#include /* termios */ -#include /* string */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* setspeed */ - -extern int SUMMA_BORDER; -extern int summamaxx; -extern int summamaxy; -extern char summaid; - - -Gpm_Type *I_summa(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/m.c deleted file mode 100644 index 9ac99c08..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/m.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse / win */ - - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100, - summamaxx, - summamaxy; -char summaid=-1; - - -int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/r.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/r.c deleted file mode 100644 index a4664d1a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/summa/r.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/sun/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/sun/m.c deleted file mode 100644 index a1373aab..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/sun/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/sun/r.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/sun/r.c deleted file mode 100644 index 29ef451e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/sun/r.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/synaptics_ps2/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/synaptics_ps2/m.c deleted file mode 100644 index 6487f60b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/synaptics_ps2/m.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/synaptics_serial/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/synaptics_serial/m.c deleted file mode 100644 index 175de551..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/synaptics_serial/m.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/synps2/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/synps2/i.c deleted file mode 100644 index 64e8a8b1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/synps2/i.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -/* synaptics touchpad, ps2 version: Henry Davies */ -Gpm_Type *I_synps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - syn_ps2_init (fd); - return type; -} - - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/twid/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/twid/i.c deleted file mode 100644 index cc1351cd..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/twid/i.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "daemon.h" /* which_mouse */ -#include "drivers.h" - - - -Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/twid/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/twid/m.c deleted file mode 100644 index 6217fb91..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/twid/m.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* KG_SHIFT */ - -#include "types.h" /* Gpm_type */ -#include "twiddler.h" /* twiddler */ - -int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/vsxxx_aa/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/vsxxx_aa/m.c deleted file mode 100644 index 550b7b25..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/vsxxx_aa/m.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/i.c deleted file mode 100644 index 2e4cd6d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/i.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ -#include -#include /* select */ - -#include "mice.h" /* check_no_argv */ -#include "types.h" /* Gpm_type */ -#include "message.h" /* gpm_report */ -#include "wacom.h" /* wacom */ - - -Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 && err && (p-buffer)<(sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell< (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/m.c deleted file mode 100644 index fda01e6e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/m.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* strcmp */ - -#include "types.h" /* Gpm_type */ -#include "wacom.h" /* wacom */ -#include "daemon.h" /* which_mouse */ -#include "mice.h" /* REALPOS */ - - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL wcmodell[3] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - - -int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/wacom.h b/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/wacom.h deleted file mode 100644 index a82b4e90..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wacom/wacom.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_WACOM_H -#define _GPM_WACOM_H - -struct WC_MODELL { - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -}; - -extern int WacomModell; -extern int WacomAbsoluteWanted; -extern int wmaxx; -extern int wmaxy; -extern char upmbuf[25]; - -extern struct WC_MODELL wcmodell[3]; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wp/i.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/wp/i.c deleted file mode 100644 index 83c22fa7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wp/i.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ - -extern int wizardpad_width; -extern int wizardpad_height; - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -Gpm_Type *I_wp(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wp/m.c b/software/gpm/browse_source/gpm-1.99.4/src/drivers/wp/m.c deleted file mode 100644 index de0ad664..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/drivers/wp/m.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ -#include "mice.h" /* REALPOS */ - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -int wizardpad_width = -1; -int wizardpad_height = -1; -int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/check_no_argv.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/check_no_argv.c deleted file mode 100644 index 419798d7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/check_no_argv.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "mice.h" /* daemon internals */ - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -volatile int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END} - }; - return parse_argv(optioninfo, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/getsym.c deleted file mode 100644 index b8f5bfcd..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/getsym.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/limit_delta.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/limit_delta.c deleted file mode 100644 index 28e4592b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/limit_delta.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/m_listtypes.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/m_listtypes.c deleted file mode 100644 index 4ef02a0d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/m_listtypes.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ -#include "message.h" /* texts */ -#include "daemon.h" /* mice */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/option_modem_lines.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/option_modem_lines.c deleted file mode 100644 index 744c7aa1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/option_modem_lines.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "message.h" /* messaging in gpm */ -#include "mice.h" /* daemon internals */ -#include "daemon.h" /* option */ - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -int option_modem_lines(int fd, int argc, char **argv) -{ - static unsigned int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/parse_argv.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/parse_argv.c deleted file mode 100644 index 7cae5f47..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/parse_argv.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isalnum */ -#include /* fprintf */ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/read_mouse_id.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/read_mouse_id.c deleted file mode 100644 index 783b4d6b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/read_mouse_id.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read/write */ -#include "mice.h" /* Gpm_type */ - - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/setspeed.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/setspeed.c deleted file mode 100644 index d499de8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/setspeed.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ - - -int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/generic/write_to_mouse.c b/software/gpm/browse_source/gpm-1.99.4/src/generic/write_to_mouse.c deleted file mode 100644 index f5be023a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/generic/write_to_mouse.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep */ -#include /* tcflush */ - -#include "mice.h" /* ‘GPM_AUX_ACK’ */ - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.99.4/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/daemon.h deleted file mode 100644 index 7a15b570..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/daemon.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include "types.h" /* Internal types */ -#include /* fd_set */ - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); - -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int limit_delta(int delta, int min, int max); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/gpm.h deleted file mode 100644 index 57dc618c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/gpm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/gpmCfg.h deleted file mode 100644 index 5d96a8f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/gpmCfg.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/gpmInt.h deleted file mode 100644 index 170ad2c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/gpmInt.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*....................................... Structures */ - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/message.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/message.h deleted file mode 100644 index 80ddcbe3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "Ooo.ps(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE ", " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/mice.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/mice.h deleted file mode 100644 index 650cdaca..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/mice.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Mice related - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_MICE_H -#define _GPM_MICE_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include "types.h" /* Gpm_Type */ - - -/************************************************************************* - * Macros - */ - -#define STD_FLG (CREAD|CLOCAL|HUPCL) -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ - -/*** mouse commands ***/ -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -#define abs(value) ((value) < 0 ? -(value) : (value)) - -/************************************************************************* - * Global variables - */ -extern int realposx; -extern int realposy; - - -/************************************************************************* - * Mice functions - */ - -int check_no_argv(int argc, char **argv); -int option_modem_lines(int fd, int argc, char **argv); -int parse_argv(argv_helper *info, int argc, char **argv); -int read_mouse_id(int fd); -int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags); -int write_to_mouse(int fd, unsigned char *data, size_t len); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/twiddler.h deleted file mode 100644 index 5f8bc00c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/twiddler.h +++ /dev/null @@ -1,52 +0,0 @@ -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/headers/types.h b/software/gpm/browse_source/gpm-1.99.4/src/headers/types.h deleted file mode 100644 index b7db32fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/headers/types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Types used by gpm internally only - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_TYPE_H -#define _GPM_TYPE_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Connect */ - -/************************************************************************* - * Types / structures - */ - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence, - *opt_calib; - int opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap, - opt_dminx, - opt_dmaxx, - opt_dminy, - opt_dmaxy, - opt_ominx, - opt_omaxx, - opt_ominy, - opt_omaxy; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -}; - -/*======================================================================== - * Parsing argv: helper dats struct function - *========================================================================*/ -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.4/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.99.4/src/lib/libcurses.c deleted file mode 100644 index f31e3412..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "headers/gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.99.4/src/lib/libhigh.c deleted file mode 100644 index ace50c8c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/lib/libhigh.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "headers/gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ -static Gpm_Event backEvent; -Gpm_Roi *roi=gpm_current_roi; - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.99.4/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.99.4/src/lib/liblow.c deleted file mode 100644 index 25a1d5c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/lib/liblow.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "headers/gpmInt.h" -#include "headers/message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int signum) -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - int success; - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.99.4/src/lib/libxtra.c deleted file mode 100644 index af602bd2..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "headers/gpmInt.h" -#include "headers/message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.99.4/src/lib/report-lib.c deleted file mode 100644 index 812fdb8e..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/lib/report-lib.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "headers/message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/mice.c b/software/gpm/browse_source/gpm-1.99.4/src/mice.c deleted file mode 100644 index 53b6a55c..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/mice.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * mice.c - table of mice for gpm - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* for FLAGS */ - - -#include "mice.h" -#include "drivers.h" - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to mice.h and drivers/ - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * - * Finally, a pointer to a repeater function, if any. - * - */ - -Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, - {"evabs", "Linux Event Device - absolute mode", - "", M_evabs, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; diff --git a/software/gpm/browse_source/gpm-1.99.4/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.99.4/src/prog/disable-paste.c deleted file mode 100644 index caed59fe..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/prog/disable-paste.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "headers/gpm.h" -#include "headers/gpmInt.h" - -int -main(int argc, char** argv) -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.99.4/src/prog/gpm-root.y deleted file mode 100644 index 7910ce68..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/prog/gpm-root.y +++ /dev/null @@ -1,1397 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "headers/message.h" -#include "headers/gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > strlen(item->name) ? wid : strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS(draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS(item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.99.4/src/prog/hltest.c deleted file mode 100644 index cce0abc5..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/prog/mev.c b/software/gpm/browse_source/gpm-1.99.4/src/prog/mev.c deleted file mode 100644 index 97622d42..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/prog/mev.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.99.4/src/prog/mouse-test.c deleted file mode 100644 index 1b2f52b1..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/prog/mouse-test.c +++ /dev/null @@ -1,744 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/message.h" /* to print */ -#include "headers/gpmInt.h" /* to get mouse types */ -#include "headers/daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ -#include "drivers.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -Gpm_Type *(*mt_I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - -int realposx=-1; -int realposy=-1; - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 /* fd */ -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*mt_I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -#define CHECKFAIL(count) ((count)==0 && noneofthem()) - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*mt_I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - CHECKFAIL(typecount); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - CHECKFAIL(typecount); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.99.4/src/prog/open_console.c deleted file mode 100644 index 6321a06f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/prog/open_console.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "headers/message.h" /* messaging in gpm */ -#include "headers/daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/report.c b/software/gpm/browse_source/gpm-1.99.4/src/report.c deleted file mode 100644 index 6c7c2ee3..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.99.4/src/synaptics.c b/software/gpm/browse_source/gpm-1.99.4/src/synaptics.c deleted file mode 100644 index 54d4aa3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/synaptics.c +++ /dev/null @@ -1,3305 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/daemon.h" /* which_mouse */ -#include "headers/synaptics.h" -#include "headers/message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf (bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen (cmd)); - tp_serial_read (fd, junk, strlen (cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf (bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/tools.c b/software/gpm/browse_source/gpm-1.99.4/src/tools.c deleted file mode 100644 index 83126f66..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "headers/gpmInt.h" /* only used for some defines */ -#include "headers/message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.99.4/src/twiddler.c b/software/gpm/browse_source/gpm-1.99.4/src/twiddler.c deleted file mode 100644 index 91fb891f..00000000 --- a/software/gpm/browse_source/gpm-1.99.4/src/twiddler.c +++ /dev/null @@ -1,531 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "headers/gpm.h" -#include "headers/gpmInt.h" -#include "headers/message.h" -#include "headers/twiddler.h" - -#include "headers/daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static int last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr = ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, mod ? " " : "", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/.exclude b/software/gpm/browse_source/gpm-1.99.5/.exclude deleted file mode 100644 index 6b8710a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/.exclude +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/software/gpm/browse_source/gpm-1.99.5/.gitignore b/software/gpm/browse_source/gpm-1.99.5/.gitignore deleted file mode 100644 index a7e802f2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -*.o -*.a -*.d -*.P -configure -Makefile -Makefile.include -autom4te.cache -contrib/Makefile -config.log -config.status -doc/doc.gpm -src/headers/config.h -src/prog/gpm-root.c -src/subdirs-exist -src/headers/config.h.in -src/gpm2/tmp -src/gpm2/out -.*.swp -doc/gpm.info -src/headers/drivers.h diff --git a/software/gpm/browse_source/gpm-1.99.5/BUGS b/software/gpm/browse_source/gpm-1.99.5/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.99.5/COPYING b/software/gpm/browse_source/gpm-1.99.5/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.99.5/Changes b/software/gpm/browse_source/gpm-1.99.5/Changes deleted file mode 100644 index fbc0a2a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/Changes +++ /dev/null @@ -1,51 +0,0 @@ -* From 1.20.1 to 1.20.3: (bugfix/code cleanup) - o Applied many cleanups - o Added etouch support - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.99.5/Changes.gpm2 b/software/gpm/browse_source/gpm-1.99.5/Changes.gpm2 deleted file mode 100644 index a2cea792..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/Changes.gpm2 +++ /dev/null @@ -1,7 +0,0 @@ -1.99.5: Nico Schottelius, 20080401 - * Removed all compiling warnings: -Werror, -Wall, -Wextra are on! -1.99.4: Nico Schottelius, 20080330 - * Complete splitoff of mice.c! - * Renamed conf/ to example-configurations -1.99.3: Nico Schottelius, 20080326 - * Added evabs support diff --git a/software/gpm/browse_source/gpm-1.99.5/MANIFEST b/software/gpm/browse_source/gpm-1.99.5/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.99.5/Makefile.in b/software/gpm/browse_source/gpm-1.99.5/Makefile.in deleted file mode 100644 index 7ad54a19..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/Makefile.in +++ /dev/null @@ -1,115 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib - -### simple, but effective rules - -all: do-all - -check: all - -uninstall: do-uninstall -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - $(MKDIR) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -# Do the the next release - -# 1. Cleanup the tree, remove all generated files and so on -distclean: barf clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf configure autom4te.cache - rm -rf gpm-$(release) gpm-$(release).tar.bz2 gpm-$(release).tar.gz - -# STOPPPED HERE -gpm-$(release): distclean do-distclean - mkdir -p gpm-$(release) - for file in $(srcdir)/*; do \ - if [ "`basename $$file`" != "$@" ]; then \ - cp $$file gpm-$(release) -r; \ - fi; \ - done - -# 2. configure headers, produce new configure script -distconf: configure.in aclocal.m4 - autoheader && autoconf - -# make this clean... -gpm-$(release).tar: gpm-$(release) - $(TAR) cf - gpm-$(release) > $@ - -gpm-$(release).tar.gz: gpm-$(release).tar - gzip -9 -c gpm-$(release).tar > $@ - -gpm-$(release).tar.bz2: gpm-$(release).tar - bzip2 -k gpm-$(release).tar - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: distclean distconf gpm-$(release).tar.bz2 gpm-$(release).tar.gz - rm gpm-$(release).tar - rm -r gpm-$(release) diff --git a/software/gpm/browse_source/gpm-1.99.5/Makefile.include.in b/software/gpm/browse_source/gpm-1.99.5/Makefile.include.in deleted file mode 100644 index 9e8733c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/Makefile.include.in +++ /dev/null @@ -1,68 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001-2008 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -CFLAGS = -Wall -Wextra -Werror @CFLAGS@ -MAKEDEPEND = $(CC) -M $(CPPFLAGS) -o $*.d $< -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -TAR = tar -AWK = awk -CP = cp -a -MKDIR = mkdir -p # linux specific, but who cares ? - # gpm is linux specific, too. -RM = rm - - -# general -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.99.5/README b/software/gpm/browse_source/gpm-1.99.5/README deleted file mode 100644 index 39cf44f6..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/README +++ /dev/null @@ -1,305 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001,2002 nico-gpm@schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit -http://www.linux.it/mailman/listinfo/gpm or send a message -with "subscribe" in its body to gpm-request@lists.linux.it . For example: - - echo subscribe | mail gpm-request@lists.linux.it - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following places: - - ftp://arcana.linux.it/pub/gpm - ftp://ftp.linux.it/pub/People/rubini/gpm/ - http:// or ftp://ftp.schottelius.org/pub/linux/gpm - -Currently there is no homepage for gpm available. - -You can get the latest cvs tree of gpm: - -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs login -(Logging in to cvs@ar.linux.it) -CVS password: (type "cvs" here) -$ cvs -d :pserver:cvs@ar.linux.it:/data/cvs checkout gpm - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.99.5/README.gpm2 b/software/gpm/browse_source/gpm-1.99.5/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.99.5/README.versions b/software/gpm/browse_source/gpm-1.99.5/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.5/TODO b/software/gpm/browse_source/gpm-1.99.5/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.99.5/acconfig.h b/software/gpm/browse_source/gpm-1.99.5/acconfig.h deleted file mode 100644 index 674e4b10..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/acconfig.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 1998 Ian Zimmerman */ -/* Copyright (C) 2002 Nico Schottelius */ - -@TOP@ - -/* GPM release number as a string. */ -#define GPM_RELEASE "" - -/* release date as a string. */ -#define GPM_RELEASE_DATE "" - -/* define if the __u32 type exists either in sys/types.h or in linux/types.h */ -#undef HAVE___U32 diff --git a/software/gpm/browse_source/gpm-1.99.5/aclocal.m4 b/software/gpm/browse_source/gpm-1.99.5/aclocal.m4 deleted file mode 100644 index c83a5a81..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/aclocal.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN(ITZ_SYS_ELF, -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN(ITZ_PATH_SITE_LISP, -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN(ITZ_CHECK_TYPE, -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.99.5/build-from-git.sh b/software/gpm/browse_source/gpm-1.99.5/build-from-git.sh deleted file mode 100644 index 361fd420..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -autoheader && autoconf && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.99.5/configure.in b/software/gpm/browse_source/gpm-1.99.5/configure.in deleted file mode 100644 index a2980ad9..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/configure.in +++ /dev/null @@ -1,135 +0,0 @@ -AC_REVISION(configure.in,v 1.7 2008/02/16 nico) - -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_INIT(src/daemon/main.c) -AC_PREREQ(2.12) -AC_CONFIG_HEADER(src/headers/config.h) - -release=1.99.5 -release_date="First of April, 1. April 2008" -AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release") -AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date") - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=20 -abi_age=19 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir)/headers $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.99.5/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.99.5/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.99.5/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.99.5/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/other/README b/software/gpm/browse_source/gpm-1.99.5/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.99.5/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/Announce b/software/gpm/browse_source/gpm-1.99.5/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/FAQ b/software/gpm/browse_source/gpm-1.99.5/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.99.5/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/Makefile.in b/software/gpm/browse_source/gpm-1.99.5/doc/Makefile.in deleted file mode 100644 index d8b95c65..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/Makefile.in +++ /dev/null @@ -1,180 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -distclean: clean - rm -f Makefile doc.gpm - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -# when we cleaned it, we can securely copy us. -dist: distclean - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.99.5/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/README.etouch b/software/gpm/browse_source/gpm-1.99.5/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/README.gunze b/software/gpm/browse_source/gpm-1.99.5/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/README.microtouch b/software/gpm/browse_source/gpm-1.99.5/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/README.synaptics b/software/gpm/browse_source/gpm-1.99.5/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/README.twiddler b/software/gpm/browse_source/gpm-1.99.5/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.99.5/doc/doc.gpm.in deleted file mode 100644 index bc800fa1..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/doc.gpm.in +++ /dev/null @@ -1,2305 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001,2002 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). A server wich hands mouse events to non-X programs. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001,2002 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -V[@var{verbosity increment}] - Raise or decrease the maximum level of messages that will be - logged. Thus a positive argument has the effect of making the - program more verbose. One can also give a negative argument to - hush the program; due to @b{getopt(3)} rules, any optional - argument needs to be passed without a space in between! - When omitting the argument, the increment defaults to 1. - Default verbosity level is 5 (@code{LOG_NOTICE}). - @xref{Program Arguments,,,libc}. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for him to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/infofilter b/software/gpm/browse_source/gpm-1.99.5/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/manpager b/software/gpm/browse_source/gpm-1.99.5/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/mktxt b/software/gpm/browse_source/gpm-1.99.5/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/old/Changelog b/software/gpm/browse_source/gpm-1.99.5/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/old/README b/software/gpm/browse_source/gpm-1.99.5/doc/old/README deleted file mode 100644 index 8429b4d4..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/old/README +++ /dev/null @@ -1,5 +0,0 @@ -These documents are here for historical reason. - -They are not maintained anymore. - -They may or may not contain false / outdated information. diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.99.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.99.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/support/README b/software/gpm/browse_source/gpm-1.99.5/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.99.5/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.99.5/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/tests/1.99.2.2 b/software/gpm/browse_source/gpm-1.99.5/doc/tests/1.99.2.2 deleted file mode 100644 index cf8eec8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/tests/1.99.2.2 +++ /dev/null @@ -1,2 +0,0 @@ -- gpm with mc test: - * click on items works: yes (using -m /dev/psaux -t ps2) diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.3 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.3 deleted file mode 100644 index e9230255..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.3 +++ /dev/null @@ -1,3 +0,0 @@ -- fixup major bugs in 1.20.1 -- add / fix release script to include configure again! -Codename: Eiche diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.4 deleted file mode 100644 index 5fdec17c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate add daemon and library stuff cleanly -x split off gpm.c and gpn.c diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.7 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.7 deleted file mode 100644 index 09ec71d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.20.7 +++ /dev/null @@ -1,2 +0,0 @@ -- cleanup protocol names -- cleanup autoconf diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.10 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.10 deleted file mode 100644 index 0e99632f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.10 +++ /dev/null @@ -1,4 +0,0 @@ -- mice driver: - * load them dynamically - * do not require senseless header (all functions have the same type) - * add option to include some statically diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.11 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.11 deleted file mode 100644 index a89986c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.11 +++ /dev/null @@ -1,3 +0,0 @@ -- Double check multimouse support / begin gpm2 model - * Make sure, drivers do not reference parts from other drivers - Like etouch / gunze diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.12 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.12 deleted file mode 100644 index 1b2b7c62..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.12 +++ /dev/null @@ -1 +0,0 @@ -- remove all old FIXME entries diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.13 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.13 deleted file mode 100644 index 6c1b75d3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.13 +++ /dev/null @@ -1,4 +0,0 @@ -- Remove Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) - and create - Gpm2_Type *I_exps2(struct gpm2_init *g2i); - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.14 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.14 deleted file mode 100644 index 016b4cb7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.14 +++ /dev/null @@ -1 +0,0 @@ -- Synaptics-cleaunp: splitoff the whole stuff and integrate it cleanly into gpm diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.15 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.15 deleted file mode 100644 index 9bcc75c3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.15 +++ /dev/null @@ -1 +0,0 @@ -- we cleaned up synaptics, now comes twiddler diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.2 deleted file mode 100644 index 841c6162..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - -> begun diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.20 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.20 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.20 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.21 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.21 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.21 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.23 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.23 deleted file mode 100644 index 47be48f2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.23 +++ /dev/null @@ -1 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.3 deleted file mode 100644 index 9ea392f7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.3 +++ /dev/null @@ -1 +0,0 @@ -- Apply Evabs-patch diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.4 deleted file mode 100644 index 06e5b6a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- finish splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.5 deleted file mode 100644 index da6505ad..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.5 +++ /dev/null @@ -1,15 +0,0 @@ -- finish gpm2/doc/DESIGN -- fix dependencies...: *.d, *.P! -- check for rmev (1.19.6 or 1.17.8) -- add commit to version, if git version is exiting: - git-show --abbrev-commit - -x git - -d .git -- use -Werror -W -Wall - -pipe, too? - -- cleanup autoconf stuff -- try to implement n mice by usage of add_mouse -- add help for calib file in English -- Fixes: Remove glibc-hacks, where possible and posix conform: processConn -- add document, that describes on howto add a new driver diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.6 deleted file mode 100644 index f1398f37..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.6 +++ /dev/null @@ -1,5 +0,0 @@ -- Fix open_console: serial check is missing -- write / find indent script to fixup source files -- have a look at make dist: - - make release - - make test - always (build) diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.7 deleted file mode 100644 index 359e98b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.7 +++ /dev/null @@ -1,3 +0,0 @@ -- check for senseful use of global variables (gunze_calib, etouch - -> also in the library code - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.8 deleted file mode 100644 index 26d46c24..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.8 +++ /dev/null @@ -1,4 +0,0 @@ -- double check that the os speficih code is in gpm2/os// - prefix os specific drivers with OS-name? - like linux event and joystick - diff --git a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.9 deleted file mode 100644 index 9787b875..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/doc/todo/1.99.9 +++ /dev/null @@ -1,4 +0,0 @@ -- cleanly design conf/ - add cc, ld, ..., create temporary files for cc/ld (like in cinit) -- splitoff twiddler.c -- remove most FIXME entries diff --git a/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-root.conf b/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-syn.conf b/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/example-configurations/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.99.5/install-sh b/software/gpm/browse_source/gpm-1.99.5/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i -To: spida //at\\ spida.net -Subject: gpm-calib.conf -Hi Timo! - -Das Dateiformat sieht wie folgt aus: - -ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max - -wobei alle e* die Reichweite der Koordinaten angeben, die aus dem -Event-Interface kommen und alle r* die Bilschirmkoordinaten sind, auf -die abgebildet wird. Alle Werte werden nur von Leerzeichen getrennt. -Das eGalax gibt über das Event-Interface ungefähr Werte zwischen 0 und -2000 für beide Achsen aus. Die Bildschirmkoordinaten sollten immer auf 0 -beim Minimum und auf der Bildschirmauflösung minus 1 beim Maximum -stehen. Für Textmodi entspricht die Auflösung der Textauflösung. Bei -Framebuffer-Konsolen kann ich es nicht mit Sicherheit sagen. - -Für 800x600 auf dem eGalax sollte die Datei also ungefähr so aussehen: - -50 1950 50 1950 0 799 0 599 - -Gruß, Micha. diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/1.99.3/gpm-evabs.patch b/software/gpm/browse_source/gpm-1.99.5/patches/1.99.3/gpm-evabs.patch deleted file mode 100644 index da23b490..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/1.99.3/gpm-evabs.patch +++ /dev/null @@ -1,327 +0,0 @@ -diff -ur gpm-1.99.2.2/src/daemon/cmdline.c gpm-1.99.2.2-patched/src/daemon/cmdline.c ---- gpm-1.99.2.2/src/daemon/cmdline.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/cmdline.c 2008-03-25 22:59:16.000000000 +0100 -@@ -32,7 +32,7 @@ - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -47,6 +47,7 @@ - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; -+ case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; -diff -ur gpm-1.99.2.2/src/daemon/gpm.c gpm-1.99.2.2-patched/src/daemon/gpm.c ---- gpm-1.99.2.2/src/daemon/gpm.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/gpm.c 2008-03-25 21:14:32.000000000 +0100 -@@ -73,9 +73,11 @@ - - struct mouse_features mouse_table[3] = { - { -- DEF_TYPE, DEF_DEV, DEF_SEQUENCE, -+ DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, -+ DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 -diff -ur gpm-1.99.2.2/src/daemon/processmouse.c gpm-1.99.2.2-patched/src/daemon/processmouse.c ---- gpm-1.99.2.2/src/daemon/processmouse.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/processmouse.c 2008-03-25 22:59:11.000000000 +0100 -@@ -55,6 +55,8 @@ - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; -+ int tempx, tempy; -+ static int oldx, oldy; - - oldT = event->type; - -@@ -77,6 +79,12 @@ - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - -+ /* use uncalibrated values as base values */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ nEvent.x = oldx; -+ nEvent.y = oldy; -+ } -+ - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { -@@ -123,6 +131,31 @@ - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - -+ /* apply calibration */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ /* save uncalibrated values for use next time around */ -+ oldx = nEvent.x; -+ oldy = nEvent.y; -+ -+ /* do calculations in a larger variable */ -+ tempx = nEvent.x; -+ tempy = nEvent.y; -+ tempx -= which_mouse->opt_dminx; -+ tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); -+ tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); -+ tempx += which_mouse->opt_ominx; -+ -+ tempy -= which_mouse->opt_dminy; -+ tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); -+ tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); -+ tempy += which_mouse->opt_ominy; -+ -+ nEvent.x = tempx; -+ nEvent.y = tempy; -+ -+ event->dx = (nEvent.x) - (event->x); -+ event->dy = (nEvent.y) - (event->y); -+ } - } /* if(eventFlag) */ - - /*....................................... update the button number */ -@@ -144,11 +177,63 @@ - } - rept1=rept2; - -- event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ /* if the values are calibrated, this is not necessary */ -+ if(which_mouse->opt_calib==NULL) -+ event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ - event->x=nEvent.x; - event->y=nEvent.y; - } -- repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ -+ -+ /* not all relative repeaters can handle big changes, -+ so repackage into several smaller updates */ -+ if (!repeated_type->absolute) { -+ int remx, remy; -+ remx = event->dx; -+ remy = event->dy; -+ -+ do { -+ if (remx<0) { -+ if (remx>=-127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = -127; -+ remx += 127; -+ } -+ } -+ if (remx>0) { -+ if (remx<=127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = 127; -+ remx -= 127; -+ } -+ } -+ if (remy<0) { -+ if (remy>=-127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = -127; -+ remy += 127; -+ } -+ } -+ if (remy>0) { -+ if (remy<=127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = 127; -+ remy -= 127; -+ } -+ } -+ repeated_type->repeat_fun(event, fifofd); -+ } while((remx!= 0)||(remy!=0)); -+ } -+ else -+ repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ -diff -ur gpm-1.99.2.2/src/daemon/startup.c gpm-1.99.2.2-patched/src/daemon/startup.c ---- gpm-1.99.2.2/src/daemon/startup.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/startup.c 2008-03-25 21:51:07.000000000 +0100 -@@ -36,6 +36,7 @@ - void startup(int argc, char **argv) - { - int i, opt; -+ FILE* calib_file; - - static struct { - char *in; -@@ -104,6 +105,21 @@ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); -+ if (which_mouse->opt_calib!=NULL) { -+ calib_file = fopen(which_mouse->opt_calib,"r"); -+ if (calib_file) { -+ if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", -+ &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, -+ &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) -+ which_mouse->opt_calib = NULL; -+ if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| -+ (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| -+ (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| -+ (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) -+ which_mouse->opt_calib = NULL; -+ } -+ fclose(calib_file); -+ } - } - - /* Check repeater status */ -diff -ur gpm-1.99.2.2/src/headers/daemon.h gpm-1.99.2.2-patched/src/headers/daemon.h ---- gpm-1.99.2.2/src/headers/daemon.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/daemon.h 2008-03-25 21:35:10.000000000 +0100 -@@ -82,7 +82,8 @@ - struct mouse_features { - char *opt_type, - *opt_dev, -- *opt_sequence; -+ *opt_sequence, -+ *opt_calib; - int opt_baud, - opt_sample, - opt_delta, -@@ -92,7 +93,15 @@ - opt_time, - opt_cluster, - opt_three, -- opt_glidepoint_tap; -+ opt_glidepoint_tap, -+ opt_dminx, -+ opt_dmaxx, -+ opt_dminy, -+ opt_dmaxy, -+ opt_ominx, -+ opt_omaxx, -+ opt_ominy, -+ opt_omaxy; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -142,6 +151,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -151,6 +161,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/gpmCfg.h gpm-1.99.2.2-patched/src/headers/gpmCfg.h ---- gpm-1.99.2.2/src/headers/gpmCfg.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/gpmCfg.h 2008-03-25 21:33:05.000000000 +0100 -@@ -48,6 +48,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -57,6 +58,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/message.h gpm-1.99.2.2-patched/src/headers/message.h ---- gpm-1.99.2.2/src/headers/message.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/message.h 2008-03-25 21:37:00.000000000 +0100 -@@ -75,6 +75,7 @@ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ -+ " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ -diff -ur gpm-1.99.2.2/src/mice.c gpm-1.99.2.2-patched/src/mice.c ---- gpm-1.99.2.2/src/mice.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/mice.c 2008-03-25 21:45:16.000000000 +0100 -@@ -140,6 +140,27 @@ - } - return 0; - } -+ -+static int M_evabs (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_ABS) { -+ if (thisevent.code == ABS_X) -+ state->x = thisevent.value; -+ else if (thisevent.code == ABS_Y) -+ state->y = thisevent.value; -+ } else if (thisevent.type == EV_KEY) { -+ switch(thisevent.code) { -+ case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; -+ case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; -+ case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; -+ } -+ } -+ return 0; -+} - #endif /* HAVE_LINUX_INPUT_H */ - - static int M_ms_plus(Gpm_Event *state, unsigned char *data) -@@ -2153,6 +2174,9 @@ - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -+ {"evabs", "Linux Event Device - absolute mode", -+ "", M_evabs, I_empty, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, - #endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz deleted file mode 100644 index bf630ad0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/MS3-PATCH-ANDREW.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/MS3-PATCH-ANDREW.gz deleted file mode 100644 index bf1a6d33..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/MS3-PATCH-ANDREW.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/OPEN_MAX.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/OPEN_MAX.gz deleted file mode 100644 index 98d577a9..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/OPEN_MAX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/VSXXX-AA-patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/VSXXX-AA-patch.gz deleted file mode 100644 index de76a90f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/VSXXX-AA-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_1.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_1.gz deleted file mode 100644 index 969a4294..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_2.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_2.gz deleted file mode 100644 index 03d782e1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_2.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_3.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_3.gz deleted file mode 100644 index 61655fbc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/andreas_mohr_3.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_12.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_12.gz deleted file mode 100644 index d27fb356..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_12.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_3rd-final?.tar.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_3rd-final?.tar.gz deleted file mode 100644 index 2317ced5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_3rd-final?.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_c_7.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_c_7.gz deleted file mode 100644 index 0c0e799b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/diff_synaptics_c_7.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/evdev.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/evdev.patch.gz deleted file mode 100644 index 11cfee16..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/evdev.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz deleted file mode 100644 index e09018f2..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz deleted file mode 100644 index 9c37a865..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz deleted file mode 100644 index ab2a7433..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz deleted file mode 100644 index 118b8572..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.20.0-wheel.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.20.0-wheel.patch.gz deleted file mode 100644 index ef7450ba..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.20.0-wheel.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz deleted file mode 100644 index e2c494a0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm06122002-cvs-tty.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm06122002-cvs-tty.patch.gz deleted file mode 100644 index fa16c22b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm06122002-cvs-tty.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm_synaptic_diff.gtar.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm_synaptic_diff.gtar.gz deleted file mode 100644 index 6872e2b8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm_synaptic_diff.gtar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm_unsigned_patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm_unsigned_patch.gz deleted file mode 100644 index 1f5b8862..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/gpm_unsigned_patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/repeater-patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/repeater-patch.gz deleted file mode 100644 index 4a590a94..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/repeater-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/repeater-patch.mail.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/repeater-patch.mail.gz deleted file mode 100644 index 8232d220..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/repeater-patch.mail.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/shlib-patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/shlib-patch.gz deleted file mode 100644 index 54a5cc01..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/applied/shlib-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch deleted file mode 100644 index 65a54431..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- gpm-1.19.3/gpm.c.serialconsole Fri Jan 5 14:10:46 2001 -+++ gpm-1.19.3/gpm.c Fri Jan 5 14:39:28 2001 -@@ -38,6 +38,7 @@ - #include /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.99.5/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.99.5/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.5/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.99.5/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.99.5/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.99.5/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.99.5/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.99.5/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.99.5/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.99.5/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.99.5/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.5/scripts/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.99.5/scripts/build-from-git-and-run.sh deleted file mode 100644 index 0bfe08c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/scripts/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/../build-from-git.sh" && sudo ../src/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.5/scripts/generate_drivers_header.sh b/software/gpm/browse_source/gpm-1.99.5/scripts/generate_drivers_header.sh deleted file mode 100644 index d35d941e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/scripts/generate_drivers_header.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-gpm2008 at schottelius.org) -# -# This file is part of gpm. -# -# gpm 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. -# -# gpm 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 gpm. If not, see . -# - -cd "$1" - -cat << eof -/* - * Warning: This file is autogenerated by $0. - * - * DO NOT EDIT IT, ALL CHANGES WILL BE LOST IN ANY CASE. - * - */ - -#ifndef __GPM_DRIVER_H -#define __GPM_DRIVER_H - -eof - -( - grep -h "^int M_" drivers/*/m.c - grep -h "^Gpm_Type" drivers/*/i.c - grep -h "^int R_" drivers/*/r.c -) | sed 's/$/;/' - -echo "#endif" diff --git a/software/gpm/browse_source/gpm-1.99.5/scripts/generate_drivers_makefile.sh b/software/gpm/browse_source/gpm-1.99.5/scripts/generate_drivers_makefile.sh deleted file mode 100644 index a6d03364..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/scripts/generate_drivers_makefile.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-gpm2008 at schottelius.org) -# -# This file is part of gpm. -# -# gpm 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. -# -# gpm 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 gpm. If not, see . -# - -dir="$1" - -cat << eof -# -# Warning: This file is autogenerated by $0. -# -# DO NOT EDIT IT, ALL CHANGES WILL BE LOST IN ANY CASE. -# -# - -GDRIVERS = \\ -eof - -( - cd $1 - ls drivers/*/*.c -) | sed 's/$/ \\/' - -# append an empty line -echo "" diff --git a/software/gpm/browse_source/gpm-1.99.5/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.99.5/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.5/scripts/gpm.release b/software/gpm/browse_source/gpm-1.99.5/scripts/gpm.release deleted file mode 100644 index fbf03ef4..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/scripts/gpm.release +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.5/scripts/gpm2.release b/software/gpm/browse_source/gpm-1.99.5/scripts/gpm2.release deleted file mode 100644 index c675a0e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/scripts/gpm2.release +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -if [ $# -ne 1 ]; then - echo "This is a maintainer-only script to release cinit" - echo $(basename $0): version - exit 1 -fi - -if [ ! -d .git ]; then - echo "Missing .git" - exit 1 -fi - -set -e -version_1="$1" -version_conf="$(awk -F= '/^release=/ { print $2 }' configure.in)" - -hier=${0%/*} - -echo "=> Version you want: $version_1" -echo "=> Version conf: $version_conf" - -if [ "$version_1" = "$version_conf" ]; then - echo "=> Version confirmed." -else - echo "That is not ok" - exit 1 -fi - -TAR_NAME="gpm-${version_1}.tar.bz2" -OUT_NAME="../$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "Release version $version_1 and copy to ${D_HOST}?" -echo -n "=> Continue? " -read yes - -echo "Creating bzip2 compressed tar" -#tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -"${hier}/git-archiv-tarbz2.sh" "${version_1}" - -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" - -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$TAR_NAME -C $D_SOURCE" - -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.5/scripts/release-tar.sh b/software/gpm/browse_source/gpm-1.99.5/scripts/release-tar.sh deleted file mode 100644 index 8cce41b0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/scripts/release-tar.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 20080313 - -version=$1 -hier=${0##*/} - -echo $hier - -[23:11] denkbrett:gpm% sha512sum gpm-1.20.3pre4.tar.bz2 > gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512suM -[23:12] denkbrett:gpm% chmod 0644 gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum home.schottelius.org:www/org/schottelius/unix/www/gpm/archives - - -[ "$version" ] || exit 3 - -git archive --format=tar --prefix=gpm-${version}/ HEAD | \ - tee ../gpm-${version}.tar | bzip2 -9 > ../gpm-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.5/src/Makefile.in b/software/gpm/browse_source/gpm-1.99.5/src/Makefile.in deleted file mode 100644 index f599b343..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/Makefile.in +++ /dev/null @@ -1,192 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -## INCLUDES --include Makefile.drivers.generated -include $(top_builddir)/Makefile.include - - -## SOURCE FILES - -GSRC = mice.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - daemon/startup.c daemon/wait_text.c - -# mouse-test and gpm -GCOMMON = generic/check_no_argv.c generic/parse_argv.c \ - generic/limit_delta.c generic/option_modem_lines.c \ - generic/setspeed.c generic/read_mouse_id.c \ - generic/m_listtypes.c generic/write_to_mouse.c \ - generic/isodigit.c generic/getsym.c \ - -GSRC += $(GDRIVERS) -GSRC += $(GCOMMON) - -GOBJ = $(GSRC:.c=.o) report.o tools.o - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c - -LOBJ = $(LSRC:.c=.o) tools.o @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) report.c -SRCSP= $(SRCS:.c=.P) -OBJECTS = $(SRCS:.c=.o) - -DEFS = @DEFS@ - -STRIP = -s - -### REAL TARGETS -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - echo go: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) -MD @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - @cp $*.d $*.P; \ - sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ - -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ - #rm -f $*.d - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -### GENERATED INCLUDES - -# FIXME: add absolute path of source files below -$(OBJECTS): headers/drivers.h - -headers/drivers.h: $(GDRIVERS) - ../scripts/generate_drivers_header.sh . > $@ - -#-include $(SRCSP) - -Makefile.drivers.generated: - ../scripts/generate_drivers_makefile.sh . > $@ - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o prog/open_console.o \ - $(GCOMMON:.c=.o) $(GDRIVERS:.c=.o) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -## CLEANUP -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ \ - $(GOBJ) \ - $(LOBJ) \ - $(PICS) \ - $(POBJ) \ - $(PROG) \ - $(RDEPS) \ - $(SRCSP) \ - core *~ prog/gpm-root.c Makefile.drivers.generated - find . -name \*.d -exec rm {} \; - -distclean: clean - rm -f headers/config.h headers/config.h.in Makefile - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/add_mouse.c deleted file mode 100644 index 1699e022..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/build_argv.c deleted file mode 100644 index 3b1ae941..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/check_kill.c deleted file mode 100644 index 167da635..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/check_uniqueness.c deleted file mode 100644 index d9ab23ef..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/cmdline.c deleted file mode 100644 index 6580571f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/cmdline.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/disable_paste.c deleted file mode 100644 index 5caf9de5..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/do_client.c deleted file mode 100644 index fb1fa37a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/do_selection.c deleted file mode 100644 index 189fc078..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/find_mouse_by_name.c deleted file mode 100644 index cbd71a13..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/get_console_size.c deleted file mode 100644 index 126ea3f4..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/get_data.c deleted file mode 100644 index 16f504d3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/getmousedata.c deleted file mode 100644 index 1869020c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/getmousedata.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ -#include "mice.h" /* GPM MAGIC */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -unsigned char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - unsigned char *edata = data + type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_DATA_4, data[0], data[1], data[2], data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm-killed.c deleted file mode 100644 index 7ee35f66..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm.c deleted file mode 100644 index bdb30c3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "gpmInt.h" /* old daemon header */ -#include "message.h" - -#include "daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - (char *)NULL /* extra */, - -1, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, - DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (Gpm_Type *)NULL - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm_exited.c deleted file mode 100644 index 5005c924..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/init_mice.c deleted file mode 100644 index d1c076d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/loadlut.c deleted file mode 100644 index 528b1a2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym((unsigned char *)charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym((unsigned char *)charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/main.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/main.c deleted file mode 100644 index 93c78b41..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "daemon.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/old_main.c deleted file mode 100644 index da2b939d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/old_main.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -int realposx=-1; -int realposy=-1; - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - bzero((char *)&ctladdr,sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, kd_mode)) - - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ - if(cinfo[event.vc]) - if(!do_client(cinfo[event.vc], &event)) - if(cinfo[0]) - if(!do_client(cinfo[0], &event)) - do_selection(&event); - - - /* Same idea as above, just here for documentation - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - */ - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/open_console.c deleted file mode 100644 index a8b74e36..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/open_console.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; -// struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - /* FIXME: si.line is not initialized, but used! */ - //if (si.line > 0) { - // gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - // } - } - } - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/processconn.c deleted file mode 100644 index cbea1c9a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/processconn.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_INFO,GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_WARN,GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - //Gpm_Event event={0, 0, vc, 0, 0, statusX, statusY, GPM_MOVE, 0, 0}; - - Gpm_Event event; - event.buttons = 0; - event.modifiers = 0; - event.vc = vc; - event.dx = 0; - event.dy = 0; - event.x = statusX; - event.y = statusY; - event.type = GPM_MOVE; - event.clicks = 0; - event.margin = 0; - event.wdx = 0; - event.wdy = 0; - - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/processmouse.c deleted file mode 100644 index c06836b1..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/processmouse.c +++ /dev/null @@ -1,369 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, int kd_mode) -{ - unsigned char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - int tempx, tempy; - static int oldx, oldy; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - /* use uncalibrated values as base values */ - if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ - nEvent.x = oldx; - nEvent.y = oldy; - } - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - /* apply calibration */ - if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ - /* save uncalibrated values for use next time around */ - oldx = nEvent.x; - oldy = nEvent.y; - - /* do calculations in a larger variable */ - tempx = nEvent.x; - tempy = nEvent.y; - tempx -= which_mouse->opt_dminx; - tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); - tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); - tempx += which_mouse->opt_ominx; - - tempy -= which_mouse->opt_dminy; - tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); - tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); - tempy += which_mouse->opt_ominy; - - nEvent.x = tempx; - nEvent.y = tempy; - - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !(which_mouse->opt_three)) (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - /* if the values are calibrated, this is not necessary */ - if(which_mouse->opt_calib==NULL) - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - - event->x=nEvent.x; - event->y=nEvent.y; - } - - /* not all relative repeaters can handle big changes, - so repackage into several smaller updates */ - if (!repeated_type->absolute) { - int remx, remy; - remx = event->dx; - remy = event->dy; - - do { - if (remx<0) { - if (remx>=-127) { - event->dx = remx; - remx = 0; - } else { - event->dx = -127; - remx += 127; - } - } - if (remx>0) { - if (remx<=127) { - event->dx = remx; - remx = 0; - } else { - event->dx = 127; - remx -= 127; - } - } - if (remy<0) { - if (remy>=-127) { - event->dy = remy; - remy = 0; - } else { - event->dy = -127; - remy += 127; - } - } - if (remy>0) { - if (remy<=127) { - event->dy = remy; - remy = 0; - } else { - event->dy = 127; - remy -= 127; - } - } - repeated_type->repeat_fun(event, fifofd); - } while((remx!= 0)||(remy!=0)); - } - else - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) /* check first click */ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/processrequest.c deleted file mode 100644 index 438b5406..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_INFO, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/processspecial.c deleted file mode 100644 index 9159a8a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpmInt.h" -#include "daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/selection_copy.c deleted file mode 100644 index 53f7af31..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/selection_paste.c deleted file mode 100644 index 31dfd52a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/startup.c deleted file mode 100644 index dcfe7935..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/startup.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -void startup(int argc, char **argv) -{ - int i, opt; - FILE* calib_file; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - if (which_mouse->opt_calib!=NULL) { - calib_file = fopen(which_mouse->opt_calib,"r"); - if (calib_file) { - if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", - &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, - &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) - which_mouse->opt_calib = NULL; - if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| - (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| - (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| - (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) - which_mouse->opt_calib = NULL; - } - fclose(calib_file); - } - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - /* goto background and become a session leader (Stefan Giessler) */ - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ - case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); - } - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - /* is changing to root needed, because of relative paths ? or can we just - * remove and ignore it ?? FIXME */ - if (chdir("/") < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_CHDIR_FAILED); - - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/usage.c deleted file mode 100644 index d6b8f65a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.99.5/src/daemon/wait_text.c deleted file mode 100644 index f5fa3cdd..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/README b/software/gpm/browse_source/gpm-1.99.5/src/drivers/README deleted file mode 100644 index 957c5b56..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/README +++ /dev/null @@ -1,32 +0,0 @@ -Write definiton of I_*, M_* and R_* in one line (needed by ./scripts/generate_drivers_header.sh). - - -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/bare/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/bare/m.c deleted file mode 100644 index 6bd336b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/bare/m.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/bm/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/bm/m.c deleted file mode 100644 index a3ade9cf..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/bm/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/brw/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/brw/m.c deleted file mode 100644 index 9a85b3c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/brw/m.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "mice.h" /* Gpm_type */ -#include "message.h" /* messaging */ - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus/i.c deleted file mode 100644 index 36439e61..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus/i.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice stuff */ -#include "daemon.h" /* which_mouse */ -#include "drivers.h" /* I_serial */ - - -Gpm_Type *I_calus(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus/m.c deleted file mode 100644 index 68e84dd3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus/m.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* win */ -#include "mice.h" /* realposy */ - - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus_rel/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus_rel/m.c deleted file mode 100644 index e35e5b4e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/calus_rel/m.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* abs */ - - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/empty/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/empty/i.c deleted file mode 100644 index d7608d40..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/empty/i.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ - - -Gpm_Type* I_empty(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - /* FIXME: remove unecessary init, but make gcc happy: warning: unused parameter ‘fd’ */ - fd = 0; - flags = 0; - if(check_no_argv(argc, argv)) return NULL; - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/etouch.h b/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/etouch.h deleted file mode 100644 index da4a235c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/etouch.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_DRV_ETOUCH -#define _GPM_DRV_ETOUCH - -extern int elo_click_ontouch; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/i.c deleted file mode 100644 index 940a54b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/i.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ - -#include "types.h" /* Gpm_type */ -#include "etouch.h" /* etouch specs */ -#include "message.h" /* reporting */ -#include "mice.h" /* parse_argv */ -#include "daemon.h" /* options */ - -extern int gunze_calib[4]; /* FIXME: do not depend on other drivers! */ - -/* simple initialization for the elo touchscreen */ -Gpm_Type *I_etouch(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, - calibok = 0; - - flags = 0; /* FIXME: unused */ - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END, u: {iptr: &elo_click_ontouch}, value:0 } - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[4]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/m.c deleted file mode 100644 index 59020f0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/etouch/m.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "etouch.h" /* etouch specs */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse */ - -int elo_click_ontouch = 0; /* the bigger the smoother */ - -extern int gunze_calib[4]; /* FIXME: do not depend on other drivers! */ - -int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/evabs/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/evabs/m.c deleted file mode 100644 index 7d0c46e8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/evabs/m.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -#include /* FIXME: Linux specific: thisevent */ -#include /* memcpy */ - - -#ifdef HAVE_LINUX_INPUT_H -int M_evabs (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_ABS) { - if (thisevent.code == ABS_X) - state->x = thisevent.value; - else if (thisevent.code == ABS_Y) - state->y = thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/evdev/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/evdev/m.c deleted file mode 100644 index 1a52c45b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/evdev/m.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* FIXME: Linux specific: thisevent */ -#include /* memcpy */ - -#include "types.h" /* Gpm_type */ - - -#ifdef HAVE_LINUX_INPUT_H - -int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/exps2/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/exps2/i.c deleted file mode 100644 index 92e7ddb8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/exps2/i.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - - -#include /* usleep, write */ -#include /* tcflush */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - flags = 0; /* FIXME: 1.99.13 */ - - if (check_no_argv(argc, argv)) return NULL; - - write(fd, s1, sizeof (s1)); - usleep(30000); - tcflush(fd, TCIFLUSH); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/geni/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/geni/m.c deleted file mode 100644 index 6daeb2e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/geni/m.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -#include "daemon.h" /* daemon internals */ - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/gunze/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/gunze/i.c deleted file mode 100644 index b1412a50..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/gunze/i.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include "types.h" /* Gpm_type */ -#include "mice.h" /* ‘parse_argv’ */ -#include "daemon.h" /* ‘which_mouse’ */ -#include "message.h" /* gpm_report */ - -/* from m.c */ -extern int gunze_avg; -extern int gunze_calib[4]; -extern int gunze_debounce; - - -/* simple initialization for the gunze touchscreen */ -Gpm_Type *I_gunze(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - flags = 0; /* FIXME: 1.99.13 */ - - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END, u: {iptr: &gunze_avg}} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/gunze/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/gunze/m.c deleted file mode 100644 index 58054095..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/gunze/m.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "message.h" /* gpm_report */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse */ - - -int gunze_avg = 9; /* the bigger the smoother */ -int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf((char *)data+1, "%d, %d", &x, &y) != 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/header.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/header.c deleted file mode 100644 index e11a8ad3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/header.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/i.c deleted file mode 100644 index a0eb1590..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/i.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include -#include /* NULL */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* GPM_AUX_ENABLE_DEV */ -#include "message.h" /* messaging */ -#include "daemon.h" /* mice */ - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/m.c deleted file mode 100644 index 123e65c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/m.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ - - -int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/r.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/r.c deleted file mode 100644 index 2403b7ca..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/imps2/r.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - -int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/js/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/js/m.c deleted file mode 100644 index 10374b00..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/js/m.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ -int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/logi/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/logi/i.c deleted file mode 100644 index f1aeda27..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/logi/i.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* fstat */ -#include /* termios */ -#include /* usleep, write */ -#include /* FIXME: Linux specific: MAJOR */ - - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ -#include "daemon.h" /* which_mouse */ - -struct { - int sample; - char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, - }; - - -Gpm_Type* I_logi(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse = (i != (int) MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/logi/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/logi/m.c deleted file mode 100644 index 424163c5..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/logi/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/logimsc/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/logimsc/m.c deleted file mode 100644 index bb5440d9..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/logimsc/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/mm/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/mm/m.c deleted file mode 100644 index b6b0f120..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/mm/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/mman/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/mman/m.c deleted file mode 100644 index 80b1ee8f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/mman/m.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice */ -#include "daemon.h" /* which_mouse */ - - -int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms/m.c deleted file mode 100644 index 04a8e42d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms/m.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms3/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms3/m.c deleted file mode 100644 index a2b32d18..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms3/m.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms3/r.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms3/r.c deleted file mode 100644 index 9c8f64c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms3/r.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms_plus/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms_plus/m.c deleted file mode 100644 index 91cc7aaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms_plus/m.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms_plus_lr/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms_plus_lr/m.c deleted file mode 100644 index efd21da0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ms_plus_lr/m.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/msc/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/msc/m.c deleted file mode 100644 index c1c12e64..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/msc/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/msc/r.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/msc/r.c deleted file mode 100644 index 1071951c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/msc/r.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - -int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/mtouch/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/mtouch/i.c deleted file mode 100644 index 340789a9..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/mtouch/i.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* NULL */ - -#include /* usleep, write */ -#include /* termios */ - -#include "types.h" /* Gpm_type */ - - -Gpm_Type *I_mtouch(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/mtouch/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/mtouch/m.c deleted file mode 100644 index ff4e97e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/mtouch/m.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice */ -#include "daemon.h" /* which_mouse */ - -int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ncr/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ncr/m.c deleted file mode 100644 index 3637a87a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ncr/m.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - - - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* win */ - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/netmouse/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/netmouse/i.c deleted file mode 100644 index 82b07f54..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/netmouse/i.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ - - -Gpm_Type *I_netmouse(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - flags = 0; /* FIXME: 1.99.13 */ - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/netmouse/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/netmouse/m.c deleted file mode 100644 index afe0ec46..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/netmouse/m.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/pnp/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/pnp/i.c deleted file mode 100644 index ba031db8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/pnp/i.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* option_modem_lines */ - - -Gpm_Type *I_pnp(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/i.c deleted file mode 100644 index 03a65ff3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/i.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* termios */ - -#include "types.h" /* Gpm_type */ - -/* standard ps2 */ -Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/m.c deleted file mode 100644 index 937b6f89..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/m.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ - - -int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/r.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/r.c deleted file mode 100644 index 9f2590c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/ps2/r.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - - -/* ps2 */ -int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/serial/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/serial/i.c deleted file mode 100644 index 2f4c38a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/serial/i.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* select */ -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ -#include "drivers.h" /* other drivers */ -#include "daemon.h" /* which_mouse */ -#include "synaptics.h" /* synaptics support */ - - - -Gpm_Type* I_serial(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int i; - unsigned char c; - fd_set set; - struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/i.c deleted file mode 100644 index e3288db3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/i.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* select */ -#include /* termios */ -#include /* string */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* setspeed */ - -extern int SUMMA_BORDER; -extern int summamaxx; -extern int summamaxy; -extern char summaid; - - -Gpm_Type *I_summa(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/m.c deleted file mode 100644 index 9ac99c08..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/m.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse / win */ - - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100, - summamaxx, - summamaxy; -char summaid=-1; - - -int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/r.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/r.c deleted file mode 100644 index 6d65eb57..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/summa/r.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/sun/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/sun/m.c deleted file mode 100644 index a1373aab..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/sun/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/sun/r.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/sun/r.c deleted file mode 100644 index fc39f84c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/sun/r.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ - - -int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics/synaptics.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics/synaptics.c deleted file mode 100644 index 4dd4084c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics/synaptics.c +++ /dev/null @@ -1,3309 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "gpm.h" -#include "daemon.h" /* which_mouse */ -#include "synaptics.h" -#include "message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[3] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[4] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -#if DEBUG_REPORTS -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} -#endif - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - state->buttons |= last_4_way_buttons | last_stick_buttons; - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - state = NULL; /* FIXME: gpm 1.99.13 */ - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (index ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (index ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf ((char *) bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < (int) count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < (int) count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen ((char *) cmd)); - tp_serial_read (fd, junk, strlen ((char *) cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf ((char *) bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, (unsigned char *) "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, (unsigned char *) "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, (unsigned char *) "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics_ps2/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics_ps2/m.c deleted file mode 100644 index 49eb8d1c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics_ps2/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* synaptics support */ - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics_serial/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics_serial/m.c deleted file mode 100644 index 02af1c2d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/synaptics_serial/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* synaptics support */ - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/synps2/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/synps2/i.c deleted file mode 100644 index 85db5203..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/synps2/i.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* Gpm_type */ - -/* synaptics touchpad, ps2 version: Henry Davies */ -Gpm_Type *I_synps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - syn_ps2_init (fd); - return type; -} - - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/i.c deleted file mode 100644 index 590f00f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/i.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "daemon.h" /* which_mouse */ -#include "drivers.h" - -int twiddler_key_init(void); /* FIXME: from twiddler */ - -Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/m.c deleted file mode 100644 index 1372da6f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/m.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* KG_SHIFT */ - -#include "types.h" /* Gpm_type */ -#include "twiddler.h" /* twiddler */ - -int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != (unsigned long ) lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/twiddler.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/twiddler.c deleted file mode 100644 index 8676641a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/twid/twiddler.c +++ /dev/null @@ -1,532 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpm.h" -#include "gpmInt.h" -#include "message.h" -#include "twiddler.h" - -#include "daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static unsigned long last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static unsigned int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, " ", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/vsxxx_aa/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/vsxxx_aa/m.c deleted file mode 100644 index 550b7b25..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/vsxxx_aa/m.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/i.c deleted file mode 100644 index dd046f1d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/i.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ -#include -#include /* select */ - -#include "mice.h" /* check_no_argv */ -#include "types.h" /* Gpm_type */ -#include "message.h" /* gpm_report */ -#include "wacom.h" /* wacom */ - - -Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - flags = 0; /* FIXME: 1.99.13 */ - - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 - && err - && (p-buffer) < (int) (sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END, u: {iptr: &WacomAbsoluteWanted}, value: 0} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell < (int) (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (int) (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/m.c deleted file mode 100644 index fda01e6e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/m.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* strcmp */ - -#include "types.h" /* Gpm_type */ -#include "wacom.h" /* wacom */ -#include "daemon.h" /* which_mouse */ -#include "mice.h" /* REALPOS */ - - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL wcmodell[3] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - - -int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/wacom.h b/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/wacom.h deleted file mode 100644 index a82b4e90..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wacom/wacom.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_WACOM_H -#define _GPM_WACOM_H - -struct WC_MODELL { - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -}; - -extern int WacomModell; -extern int WacomAbsoluteWanted; -extern int wmaxx; -extern int wmaxy; -extern char upmbuf[25]; - -extern struct WC_MODELL wcmodell[3]; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wp/i.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/wp/i.c deleted file mode 100644 index 060ef412..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wp/i.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ - -extern int wizardpad_width; -extern int wizardpad_height; - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -Gpm_Type *I_wp(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wp/m.c b/software/gpm/browse_source/gpm-1.99.5/src/drivers/wp/m.c deleted file mode 100644 index de0ad664..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/drivers/wp/m.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ -#include "mice.h" /* REALPOS */ - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -int wizardpad_width = -1; -int wizardpad_height = -1; -int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/check_no_argv.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/check_no_argv.c deleted file mode 100644 index b711bf90..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/check_no_argv.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* NULL */ -#include "mice.h" /* daemon internals */ - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END, {NULL}, 0} - }; - return parse_argv(optioninfo, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/getsym.c deleted file mode 100644 index d152c405..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/getsym.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "daemon.h" - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/limit_delta.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/limit_delta.c deleted file mode 100644 index 28e4592b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/limit_delta.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/m_listtypes.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/m_listtypes.c deleted file mode 100644 index 4ef02a0d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/m_listtypes.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ -#include "message.h" /* texts */ -#include "daemon.h" /* mice */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/option_modem_lines.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/option_modem_lines.c deleted file mode 100644 index c3142923..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/option_modem_lines.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "message.h" /* messaging in gpm */ -#include "mice.h" /* daemon internals */ -#include "daemon.h" /* option */ - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -int option_modem_lines(int fd, int argc, char **argv) -{ - static int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END, u: {iptr: &lines}, 0} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/parse_argv.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/parse_argv.c deleted file mode 100644 index fb50dcfa..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/parse_argv.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isalnum */ -#include /* fprintf */ -#include /* strtol */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/read_mouse_id.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/read_mouse_id.c deleted file mode 100644 index 783b4d6b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/read_mouse_id.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read/write */ -#include "mice.h" /* Gpm_type */ - - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/setspeed.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/setspeed.c deleted file mode 100644 index d499de8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/setspeed.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ - - -int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/generic/write_to_mouse.c b/software/gpm/browse_source/gpm-1.99.5/src/generic/write_to_mouse.c deleted file mode 100644 index 0b253d98..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/generic/write_to_mouse.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep */ -#include /* tcflush */ - -#include "mice.h" /* ‘GPM_AUX_ACK’ */ - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - unsigned int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/TODO b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/client/README b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/README b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/doc/DESIGN deleted file mode 100644 index 732f9d3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/doc/DESIGN +++ /dev/null @@ -1,65 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 3521ad3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/README b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/mice_handler.c deleted file mode 100644 index 4d39b446..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - gpm2_open_ps2(ps2test); - gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.99.5/src/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/daemon.h deleted file mode 100644 index 0e803a2d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/daemon.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include "types.h" /* Internal types */ -#include /* fd_set */ - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); - -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -unsigned char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int isodigit(const unsigned char c); - -int limit_delta(int delta, int min, int max); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/gpm-proto.h deleted file mode 100644 index 32f61ba6..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/gpm.h deleted file mode 100644 index b7d57cd9..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/gpm.h +++ /dev/null @@ -1,301 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - - /* displacement x,y for this event, and absolute x,y */ - short dx, dy, x, y; - enum Gpm_Etype type; - - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - - - /* FIXME: this seems to be unused. if so, remove it */ - enum Gpm_Margin margin; - - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/gpmCfg.h deleted file mode 100644 index 5d96a8f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/gpmCfg.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/gpmInt.h deleted file mode 100644 index b7ea2660..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/gpmInt.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*....................................... Structures */ - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/message.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/message.h deleted file mode 100644 index 80ddcbe3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "Ooo.ps(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " GPM_RELEASE ", " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mouse. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/mice.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/mice.h deleted file mode 100644 index 650cdaca..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/mice.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Mice related - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_MICE_H -#define _GPM_MICE_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include "types.h" /* Gpm_Type */ - - -/************************************************************************* - * Macros - */ - -#define STD_FLG (CREAD|CLOCAL|HUPCL) -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ - -/*** mouse commands ***/ -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -#define abs(value) ((value) < 0 ? -(value) : (value)) - -/************************************************************************* - * Global variables - */ -extern int realposx; -extern int realposy; - - -/************************************************************************* - * Mice functions - */ - -int check_no_argv(int argc, char **argv); -int option_modem_lines(int fd, int argc, char **argv); -int parse_argv(argv_helper *info, int argc, char **argv); -int read_mouse_id(int fd); -int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags); -int write_to_mouse(int fd, unsigned char *data, size_t len); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/synaptics.h deleted file mode 100644 index 77fa972f..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/twiddler.h deleted file mode 100644 index 642651de..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/twiddler.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_TWIDDLER_H -#define _GPM_TWIDDLER_H - -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/headers/types.h b/software/gpm/browse_source/gpm-1.99.5/src/headers/types.h deleted file mode 100644 index 45e76d70..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/headers/types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Types used by gpm internally only - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_TYPE_H -#define _GPM_TYPE_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Connect */ - -/************************************************************************* - * Types / structures - */ - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence, - *opt_calib, - *opt_options; /* extra textual configuration */ - int fd, - opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap, - opt_dminx, - opt_dmaxx, - opt_dminy, - opt_dmaxy, - opt_ominx, - opt_omaxx, - opt_ominy, - opt_omaxy; - Gpm_Type *m_type; -}; - -/*======================================================================== - * Parsing argv: helper dats struct function - *========================================================================*/ -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.5/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.99.5/src/lib/libcurses.c deleted file mode 100644 index a2f30c7e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/lib/libcurses.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "gpmInt.h" - -#ifdef HAVE_NCURSES_H -#include -#else -#ifdef HAVE_NCURSES_CURSES_H -#include -#else -#ifdef HAVE_CURSES_H -#include -#endif /* HAVE_CURSES_H */ -#endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW *win) -{ -fd_set selSet; -int max, flag, result; -int fd=STDIN_FILENO; -static Gpm_Event ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - -/*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (FD_ISSET(fd,&selSet)) - return GET(win); - - if (flag==-1) - continue; - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else -/*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; -/* if ungetc() didn't suffice... */ -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=GET(win))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=GET(win))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - /* {ungetc(c,stdin); return 0x1B;} */ - - if ((c=GET(win))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - /* {ungetc(c,stdin);prevchar='['; return 0x1B;} */ - - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=GET(win); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.99.5/src/lib/libhigh.c deleted file mode 100644 index c17ae92e..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/lib/libhigh.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ - static Gpm_Event backEvent; - Gpm_Roi *roi=gpm_current_roi; - - clientdata = NULL; /* FIXME: gpm 1.99.13 */ - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.99.5/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.99.5/src/lib/liblow.c deleted file mode 100644 index a115b5bc..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/lib/liblow.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "gpmInt.h" -#include "message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int success) /* misuse the parameter */ -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - bzero((char *)&addr,sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.99.5/src/lib/libxtra.c deleted file mode 100644 index 78b51231..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "gpmInt.h" -#include "message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=GPM_RELEASE; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.99.5/src/lib/report-lib.c deleted file mode 100644 index b4ec783b..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/lib/report-lib.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level = LOG_DEBUG; - va_list ap; - - line = 0; /* FIXME: gpm 1.99.13 */ - file = NULL; - - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/mice.c b/software/gpm/browse_source/gpm-1.99.5/src/mice.c deleted file mode 100644 index 53b6a55c..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/mice.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * mice.c - table of mice for gpm - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* for FLAGS */ - - -#include "mice.h" -#include "drivers.h" - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to mice.h and drivers/ - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * - * Finally, a pointer to a repeater function, if any. - * - */ - -Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, - {"evabs", "Linux Event Device - absolute mode", - "", M_evabs, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; diff --git a/software/gpm/browse_source/gpm-1.99.5/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.99.5/src/prog/disable-paste.c deleted file mode 100644 index f81a2fd2..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/prog/disable-paste.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "gpm.h" -#include "gpmInt.h" - -int main() -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.99.5/src/prog/gpm-root.y deleted file mode 100644 index e30a5d42..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/prog/gpm-root.y +++ /dev/null @@ -1,1416 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "message.h" -#include "gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -static int f_debug_one(FILE *f, Draw *draw) -{ - DrawItem *ip; - static int tc=0; - int i; - -#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); - LINE((f,"UID %i\n",draw->uid)); - LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); - LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); - LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); - for (ip=draw->menu; ip; ip=ip->next) { - LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); - if (ip->fun == f_menu) { - tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; - } - } -#undef LINE - return 0; -} - -int f_debug(int mode, DrawItem *self, int uid) -{ - - mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ -#if 0 /* Disabled on account of security concerns; the way - * "/tmp/root-debug" is used is gratuitously - * open to symlink abuse */ - - FILE *f; - Draw *dp; - - switch (mode) { - case F_POST: - if (!(f=fopen("/tmp/root-debug","a"))) return 1; - for(dp=drawList; dp; dp=dp->next) - f_debug_one(f,dp); - fprintf(f,"\n\n"); - fclose(f); - - case F_CREATE: - case F_INVOKE: - break; - } -#endif /* 0 */ - return 0; -} - - -/*---------------------------------------------------------------------*/ -int f_fgcmd(int mode, DrawItem *self, int uid) -{ - self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: ; /* MISS */ - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ - return 0; /* just a placeholder, recursion is performed in main() */ -} - -/*---------------------------------------------------------------------*/ -int f_lock(int mode, DrawItem *self, int uid) -{ - mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ -#if 0 /* some kind of interesting ...: if never */ - int all; - static DrawItem msg = { - 0, - 10, - "Enter your password to unlock", - NULL, NULL, NULL, NULL - }; - static Draw - - - switch (mode) { - case F_CREATE: /* either "one" or anything else */ - if (strcmp(self->arg,"one")) self->arg[0]='a'; - case F_POST: break; - case F_INVOKE: /* the biggest of all... */ - } - -#endif - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - uid = 0; /* FIXME: gpm 1.99.13 */ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > (int) strlen(item->name) ? wid : (int) strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - f = NULL; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - f = NULL; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS((unsigned char *)draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS((unsigned char *)item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - signo = 0; /* FIXME in 1.99.13 */ - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.99.5/src/prog/hltest.c deleted file mode 100644 index dde8afc4..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/prog/mev.c b/software/gpm/browse_source/gpm-1.99.5/src/prog/mev.c deleted file mode 100644 index ad2c39a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/prog/mev.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - data = NULL; /* FIXME: unused */ - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.99.5/src/prog/mouse-test.c deleted file mode 100644 index 32c94d86..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/prog/mouse-test.c +++ /dev/null @@ -1,744 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "message.h" /* to print */ -#include "gpmInt.h" /* to get mouse types */ -#include "daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ -#include "drivers.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -Gpm_Type *(*mt_I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - -int realposx=-1; -int realposy=-1; - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - (char *)NULL /* extra */, - -1 /* fd */, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, - DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (Gpm_Type *)NULL -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*mt_I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, unsigned char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - unsigned char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*mt_I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - if(typecount == 0) noneofthem(); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - if(typecount == 0) noneofthem(); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - if(typecount == 0) noneofthem(); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.99.5/src/prog/open_console.c deleted file mode 100644 index 3fc09227..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/prog/open_console.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.5/src/report.c b/software/gpm/browse_source/gpm-1.99.5/src/report.c deleted file mode 100644 index f41ac55d..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.99.5/src/tools.c b/software/gpm/browse_source/gpm-1.99.5/src/tools.c deleted file mode 100644 index 985c7396..00000000 --- a/software/gpm/browse_source/gpm-1.99.5/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "gpmInt.h" /* only used for some defines */ -#include "message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/.gitignore b/software/gpm/browse_source/gpm-1.99.6/.gitignore deleted file mode 100644 index 89002178..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/.gitignore +++ /dev/null @@ -1,52 +0,0 @@ -.depend -*.o -*.lo -*.a -*.d -*.P -.*.swp - -Makefile -Makefile.include -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/config - -/contrib/Makefile - -/src/headers/config.h -/src/headers/config.h.in -/src/headers/drivers.h -/src/gpm2/tmp -/src/gpm2/out -/src/lib/libgpm.so -/src/lib/libgpm.so.1.20.0 -/src/prog/disable-paste -/src/prog/display-buttons -/src/prog/display-coords -/src/prog/gpm-root.c -/src/prog/gpm-root -/src/prog/hltest -/src/prog/mev -/src/prog/mouse-test -/src/Makefile.drivers.generated -/src/subdirs-exist - -/doc/doc.gpm -/doc/gpm-root.1 -/doc/gpm-types.7 -/doc/gpm.8 -/doc/gpm.info -/doc/gpm.man -/doc/mev.1 -/doc/mouse-test.1 - -/.releasedate -/.gitversion - -# gpm2 -/gpm2/out/* -src/gpm2/* diff --git a/software/gpm/browse_source/gpm-1.99.6/BUGS b/software/gpm/browse_source/gpm-1.99.6/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.99.6/COPYING b/software/gpm/browse_source/gpm-1.99.6/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.99.6/Changes b/software/gpm/browse_source/gpm-1.99.6/Changes deleted file mode 100644 index f98835f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/Changes +++ /dev/null @@ -1 +0,0 @@ -Can now be found in doc/changes/* diff --git a/software/gpm/browse_source/gpm-1.99.6/MANIFEST b/software/gpm/browse_source/gpm-1.99.6/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.99.6/Makefile.in b/software/gpm/browse_source/gpm-1.99.6/Makefile.in deleted file mode 100644 index 61d5ef41..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/Makefile.in +++ /dev/null @@ -1,136 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib gpm2 - -### simple, but effective rules - -all: do-all - -check: all - -uninstall: do-uninstall -clean: do-clean - -Makefile: $(srcdir)/Makefile.in config.status - ./config.status - -config.status: $(srcdir)/configure - if [ -f config.status ]; then $(SHELL) config.status --recheck; \ - else ./configure; fi - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -install-exec: installdirs - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install - -installdirs: - @MKDIR_P@ $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ - @MKDIR_P@ $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -### RELEASE STUFF -TARS :=../gpm-$(release).tar.gz -TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma -CHKSUMS := $(TARS:=.sha512sum) -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=$(D_BASE)/archives/ -D_SOURCE=$(D_BASE)/browse_source/ - -# configure headers, produce new configure script -distconf: configure.ac aclocal.m4 - autoheader && autoconf - -../gpm-$(release).tar: $(srcdir) - # no exclude possible of .git with pax it seems - #pax -w -x ustar -s '/^\./gpm-$(release)/' -w . -f $@ - pax -w -x ustar -s ';^;gpm-$(release)/;' -f $@ -w .gitignore .gitversion .releasedate * - -../gpm-$(release).tar.gz: ../gpm-$(release).tar - gzip -9 -c $^ > $@ - -../gpm-$(release).tar.bz2: ../gpm-$(release).tar - bzip2 -9 -c $^ > $@ - -../gpm-$(release).tar.lzma: ../gpm-$(release).tar - lzma -9 -c $^ > $@ - -$(CHKSUMS): $(TARS) - for file in $^; do sha512sum $$file > $${file}.sha512sum; done - -# 3. Put package together into .tar.gz and .tar.bz2 -dist: disttest distclean distconf $(CHKSUMS) - -distcopy: dist - chmod 0644 $(TARS) $(CHKSUMS) - scp $(TARS) $(CHKSUMS) $(D_HOST):$(D_DIR) - ssh "$(D_HOST)" "tar xvfz $(D_DIR)/gpm-$(release).tar.gz -C $(D_SOURCE)" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type f -exec chmod 0644 {} \\;" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type d -exec chmod 0755 {} \\;" - - -# create / update configure, delete other parts from earlier build -disttest: distconf clean - ./configure - make all - -### CLEANUP -distclean: clean do-clean do-distclean - rm -f config.log config.status config.cache Makefile Makefile.include - rm -rf autom4te.cache - -allclean: do-allclean distclean - rm -f configure diff --git a/software/gpm/browse_source/gpm-1.99.6/Makefile.include.in b/software/gpm/browse_source/gpm-1.99.6/Makefile.include.in deleted file mode 100644 index ef095e89..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/Makefile.include.in +++ /dev/null @@ -1,65 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001-2008 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -CC = @CC@ -CFLAGS = -Wall -Wextra -Werror -pipe @CFLAGS@ -MAKEDEPEND = $(CC) -M $(CPPFLAGS) -o $*.d $< -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -AWK = awk -CP = cp -a -RM = rm - - -# general -release = @PACKAGE_VERSION@ diff --git a/software/gpm/browse_source/gpm-1.99.6/README b/software/gpm/browse_source/gpm-1.99.6/README deleted file mode 100644 index d593e631..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/README +++ /dev/null @@ -1,340 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001-2008 nico-gpm2008 at schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== REPORT SUCCESS - -As it is always nice to see as an author of FOSS that the software is -used and alive und which options are used, you can send a success -report to me via ./scripts/report_success.sh. - - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit - http://lists.linux.it/listinfo/gpm - -or send a message with "subscribe" in its body to - gpm-request@lists.linux.it. - -For example: - echo subscribe | mail gpm-request@lists.linux.it - - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following place: - - http://unix.schottelius.org/gpm/archives/ - http://unix.schottelius.org/gpm/browse_source/ - -The homepage of gpm can be found at - - http://unix.schottelius.org/gpm/ - -You can get the latest development tree of gpm via git: - - git-clone http://unix.schottelius.org/git/gpm - -There are three branches available: - - master: - Contains the latest gpm1 code, may be broken. - This is were untested code for gpm1 should go to. - gpm-1-stable: - Contains the latest stable source code of gpm1. - Always compiles and runs, code is tested. - Contents of this branch should always be merged - from the master branch. - gpm-2-dev: - Contains work that heads to gpm2. - It is not stable, does not need to compile. - gpm-2-stable: - Same as gpm-1-stable for gpm2 and mergebase is - gpm-2-dev. - -You can browse the git-tree via gitweb: - - http://unix.schottelius.org/cgi-bin/gitweb.cgi?p=gpm;a=summary - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.99.6/README.gpm2 b/software/gpm/browse_source/gpm-1.99.6/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.99.6/README.versions b/software/gpm/browse_source/gpm-1.99.6/README.versions deleted file mode 100644 index 22757f37..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/README.versions +++ /dev/null @@ -1,28 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.6/TODO b/software/gpm/browse_source/gpm-1.99.6/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.99.6/acinclude.m4 b/software/gpm/browse_source/gpm-1.99.6/acinclude.m4 deleted file mode 100644 index a932e3ae..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/acinclude.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN([ITZ_SYS_ELF], -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN([ITZ_PATH_SITE_LISP], -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN([ITZ_CHECK_TYPE], -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) diff --git a/software/gpm/browse_source/gpm-1.99.6/autogen.sh b/software/gpm/browse_source/gpm-1.99.6/autogen.sh deleted file mode 100644 index 268cb141..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/autogen.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -e - -[ -d config ] || mkdir config -git-rev-parse --short HEAD > .gitversion -date +%Y%m%d\ %T\ %z > .releasedate -${ACLOCAL-aclocal} -I config -${LIBTOOLIZE-libtoolize} --force --copy -${AUTOHEADER-autoheader} -${AUTOMAKE-automake} --add-missing --copy 2> /dev/null || true -${AUTOCONF-autoconf} - diff --git a/software/gpm/browse_source/gpm-1.99.6/build-from-git.sh b/software/gpm/browse_source/gpm-1.99.6/build-from-git.sh deleted file mode 100644 index 7c40be9e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -./autogen.sh && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.99.6/configure.ac b/software/gpm/browse_source/gpm-1.99.6/configure.ac deleted file mode 100644 index 3ecf063e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/configure.ac +++ /dev/null @@ -1,140 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_PREREQ(2.61) - -AC_INIT([gpm],[1.99.6],[http://unix.schottelius.org/gpm/]) -AC_CONFIG_SRCDIR([src/daemon/main.c]) -AC_CONFIG_AUX_DIR([config]) -AC_CONFIG_HEADER([src/headers/config.h]) - -AC_CANONICAL_HOST - -revgit="`cat .gitversion`" -releasedate="`cat .releasedate`" -AC_DEFINE_UNQUOTED([GPM_RELEASE_GIT],["$revgit"],[git short revision]) -AC_DEFINE_UNQUOTED([GPM_RELEASE_DATE],["$releasedate"],[release date]) - -dnl These are chosen so that we can switch to the libtool scheme -dnl transparently. -abi=21 -abi_age=20 -abi_rev=0 - -abi_lev=`expr $abi - $abi_age` -abi_full=$abi_lev.$abi_age.$abi_rev - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_MKDIR_P -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32,[],"have u32") -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(release) -AC_SUBST(release_date) -AC_SUBST(revgit) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) - -CPPFLAGS='-I$(srcdir)/headers -I$(srcdir)/../gpm2/include $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -LDFLAGS='-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.99.6/contrib/Makefile.in deleted file mode 100644 index fc0bab62..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.99.6/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.99.6/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.99.6/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/other/README b/software/gpm/browse_source/gpm-1.99.6/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.99.6/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/Announce b/software/gpm/browse_source/gpm-1.99.6/doc/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/FAQ b/software/gpm/browse_source/gpm-1.99.6/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/HACK_GPM b/software/gpm/browse_source/gpm-1.99.6/doc/HACK_GPM deleted file mode 100644 index 41939445..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest cvs sources (see README) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * if the patch is not big, use one file - * if you have to use more files, tar them - * include directory structure (src/mice.c and not mice.c) - * everything fine ? So send the patch. - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/Makefile.in b/software/gpm/browse_source/gpm-1.99.6/doc/Makefile.in deleted file mode 100644 index 709fa6d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/Makefile.in +++ /dev/null @@ -1,190 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: $(srcdir)/gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -$(MANPAGES): gpm.man -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# Main portion - -all: $(srcdir)/gpm.info $(MANPAGES) - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -## CLEANUP section -# normal cleanup -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# for creating distribution -distclean: clean - rm -f Makefile doc.gpm - -# to even remove things we leave for end-users -allclean: distclean - rm -f gpm.info - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -## DIST section -# when we cleaned it, we can securely copy us. -dist: distclean - # unneeded now: using pax + -s option and create tars in .. - #$(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.99.6/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/README.etouch b/software/gpm/browse_source/gpm-1.99.6/doc/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/README.evabs b/software/gpm/browse_source/gpm-1.99.6/doc/README.evabs deleted file mode 100644 index 92965abb..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/README.evabs +++ /dev/null @@ -1,39 +0,0 @@ - -This file tells how to use gpm with the driver for event-devices -that use absolut coordiantes (evabs) like touchscreens. It was -desigened and tested for eGalax controllers, but should work with -others as well. - - - CALIBRATION - ----------- - -Calibration is done with a configfile. It consists of a single -line of 8 integers: - -ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max - -The first four values (prefixed withe here) show the minimum and -maximum values of coordinates the event-device delivers for -x- and y-axis, respectivly. The last four values show range of -coordinates to which the input should be scaled, for example your -screen resolution. This works for text-mode, too. - -An example for an 800x600 screen would look like this: - -50 1950 50 1950 0 799 0 599 - - - GPM OPERATION - ------------- - -You need to use the evabs devicetype to use this feature, a -device that delivers the absolute coordinates a config-file -that describes how to scale these coordinates, and a repeater- -device used for output. -The pseudo-file /proc/bus/input/devices should tell you which -event-device to use. - -Usage example: - -gpm -t evabs -m /dev/input/event2 -c /etc/gpm-calib.conf -R ps2 diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/README.gunze b/software/gpm/browse_source/gpm-1.99.6/doc/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/README.microtouch b/software/gpm/browse_source/gpm-1.99.6/doc/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/README.synaptics b/software/gpm/browse_source/gpm-1.99.6/doc/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/README.twiddler b/software/gpm/browse_source/gpm-1.99.6/doc/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/changes/1.20.4 b/software/gpm/browse_source/gpm-1.99.6/doc/changes/1.20.4 deleted file mode 100644 index bb336eaf..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/changes/1.20.4 +++ /dev/null @@ -1,2 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/changes/1.99.6 b/software/gpm/browse_source/gpm-1.99.6/doc/changes/1.99.6 deleted file mode 100644 index afe22868..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/changes/1.99.6 +++ /dev/null @@ -1,11 +0,0 @@ -2008-04-29: Nico Schottelius - * Merge changes from 1.20.3pre6 and 1.20.3 - * Make it compile again on Linux/ppc (-Werror broke it) (acrux) - * Add initial evabs documentation (name missing) - * Update much autoconf stuff, do not use acconfig.h anymore - * Add bugfixes (possible segfault) and cleanups (Bernhard Fischer) - * Whitespace cleanup (Bernhard Fischer) - * Fix memory clobbering in synaptics code (Pavel Semerad) - * Makefile and documentation updates (Mike Frysinger) - * Include automatic generation of checksum - * Include release date and git version diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/changes/gpm-1-before-1.20.4 b/software/gpm/browse_source/gpm-1.99.6/doc/changes/gpm-1-before-1.20.4 deleted file mode 100644 index 2b2ece56..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/changes/gpm-1-before-1.20.4 +++ /dev/null @@ -1,66 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos - - pre1: - Possibly merge changes from 1.99.x to get tree up-to-date again - -* From 1.20.1 to 1.20.3: (bugfix/code cleanup) - o Applied many cleanups - o Added etouch support - o Added scripts/report_success.sh - o Updated README - - pre6: - Cleaned up "make dist" target - Added two debbugging programs: - src/prog/display-buttons.c: display pressed buttons - src/prog/display-coords.c: display mouse coordinates - Fixed Bug#474516: gpm: debug messages in syslog (Debian) - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/changes/gpm-2-before-1.99.6 b/software/gpm/browse_source/gpm-1.99.6/doc/changes/gpm-2-before-1.99.6 deleted file mode 100644 index ddfa4280..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/changes/gpm-2-before-1.99.6 +++ /dev/null @@ -1,13 +0,0 @@ -1.99.6: - * Merge changes from 1.20.3pre6 and 1.20.3 - * Make it compile again on Linux/ppc (-Werror broke it) - * Add initial evabs documentation - * Update autoconf stuff, do not use acconfig.h anymore - * Add bugfixes (possible segfault) and cleanups from Bernhard Fischer -1.99.5: Nico Schottelius, 20080401 - * Removed all compiling warnings: -Werror, -Wall, -Wextra are on! -1.99.4: Nico Schottelius, 20080330 - * Complete splitoff of mice.c! - * Renamed conf/ to example-configurations -1.99.3: Nico Schottelius, 20080326 - * Added evabs support diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.99.6/doc/doc.gpm.in deleted file mode 100644 index 4ba4fd33..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/doc.gpm.in +++ /dev/null @@ -1,2295 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001-2008 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). Text-mode (non-X) mouse library and server daemon. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001-2008 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for me to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/infofilter b/software/gpm/browse_source/gpm-1.99.6/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/manpager b/software/gpm/browse_source/gpm-1.99.6/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/mktxt b/software/gpm/browse_source/gpm-1.99.6/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/old/Changelog b/software/gpm/browse_source/gpm-1.99.6/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/old/README b/software/gpm/browse_source/gpm-1.99.6/doc/old/README deleted file mode 100644 index 8429b4d4..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/old/README +++ /dev/null @@ -1,5 +0,0 @@ -These documents are here for historical reason. - -They are not maintained anymore. - -They may or may not contain false / outdated information. diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.99.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.99.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/support/README b/software/gpm/browse_source/gpm-1.99.6/doc/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/support/autodependencies b/software/gpm/browse_source/gpm-1.99.6/doc/support/autodependencies deleted file mode 100644 index 5924ac35..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/support/autodependencies +++ /dev/null @@ -1,2 +0,0 @@ -A nice manual thet helped me to integrate deps into gpm-1.99.5: -http://make.paulandlesley.org/autodep.html diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_1 b/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_2 b/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_3 b/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.99.6/doc/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.99.6/doc/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/tests/1.99.2.2 b/software/gpm/browse_source/gpm-1.99.6/doc/tests/1.99.2.2 deleted file mode 100644 index cf8eec8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/tests/1.99.2.2 +++ /dev/null @@ -1,2 +0,0 @@ -- gpm with mc test: - * click on items works: yes (using -m /dev/psaux -t ps2) diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.3 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.3 deleted file mode 100644 index e9230255..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.3 +++ /dev/null @@ -1,3 +0,0 @@ -- fixup major bugs in 1.20.1 -- add / fix release script to include configure again! -Codename: Eiche diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.4 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.4 deleted file mode 100644 index 36243c96..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.4 +++ /dev/null @@ -1,7 +0,0 @@ -- seperate add daemon and library stuff cleanly -<<<<<<< HEAD:doc/todo/1.20.4 -x split off gpm.c and gpn.c -======= -- split off gpm.c and gpn.c -- add report success ->>>>>>> master:doc/todo/1.20.4 diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.5 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.5 deleted file mode 100644 index 1cad09d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.5 +++ /dev/null @@ -1,2 +0,0 @@ -- seperate "drivers" from the rest -- remove the unneeded typedefs diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.6 deleted file mode 100644 index 6ede04cb..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.6 +++ /dev/null @@ -1,2 +0,0 @@ -- remove all warnings -- use -Werror -W -Wall diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.7 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.7 deleted file mode 100644 index 09ec71d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.20.7 +++ /dev/null @@ -1,2 +0,0 @@ -- cleanup protocol names -- cleanup autoconf diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.10 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.10 deleted file mode 100644 index 0e99632f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.10 +++ /dev/null @@ -1,4 +0,0 @@ -- mice driver: - * load them dynamically - * do not require senseless header (all functions have the same type) - * add option to include some statically diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.11 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.11 deleted file mode 100644 index a89986c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.11 +++ /dev/null @@ -1,3 +0,0 @@ -- Double check multimouse support / begin gpm2 model - * Make sure, drivers do not reference parts from other drivers - Like etouch / gunze diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.12 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.12 deleted file mode 100644 index 1b2b7c62..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.12 +++ /dev/null @@ -1 +0,0 @@ -- remove all old FIXME entries diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.13 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.13 deleted file mode 100644 index 6c1b75d3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.13 +++ /dev/null @@ -1,4 +0,0 @@ -- Remove Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) - and create - Gpm2_Type *I_exps2(struct gpm2_init *g2i); - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.14 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.14 deleted file mode 100644 index 016b4cb7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.14 +++ /dev/null @@ -1 +0,0 @@ -- Synaptics-cleaunp: splitoff the whole stuff and integrate it cleanly into gpm diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.15 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.15 deleted file mode 100644 index 9bcc75c3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.15 +++ /dev/null @@ -1 +0,0 @@ -- we cleaned up synaptics, now comes twiddler diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.16 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.16 deleted file mode 100644 index 88812bf4..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.16 +++ /dev/null @@ -1,6 +0,0 @@ -- Begin to design gpm2-client library - -- change Events for clients for gpm2: - - * allow 32 buttons (unsigned long int) - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.2 deleted file mode 100644 index 841c6162..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - -> begun diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.20 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.20 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.20 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.21 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.21 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.21 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.23 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.23 deleted file mode 100644 index 47be48f2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.23 +++ /dev/null @@ -1 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.3 deleted file mode 100644 index 9ea392f7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.3 +++ /dev/null @@ -1 +0,0 @@ -- Apply Evabs-patch diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.4 deleted file mode 100644 index 06e5b6a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- finish splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.5 deleted file mode 100644 index 1e335c65..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.5 +++ /dev/null @@ -1,6 +0,0 @@ -Done: -- use -Werror -W -Wall - -pipe, too? - - - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.6 deleted file mode 100644 index 20d51bdc..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.6 +++ /dev/null @@ -1,9 +0,0 @@ -done: -- have a look at make dist: (in 1.20.3pre6 already) - - make release - - make test - always (build) -- cleanup autoconf stuff -- add commit to version, if git version is exiting: - git-show --abbrev-commit - -x git - -d .git diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.7 deleted file mode 100644 index caa39d6c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.7 +++ /dev/null @@ -1,22 +0,0 @@ -- finish gpm2/doc/DESIGN - -- fix dependencies...: *.d, *.P! -- check for rmev (1.19.6 or 1.17.8) -- try to implement n mice by usage of add_mouse -- add help for calib file in English -- Fixes: Remove glibc-hacks, where possible and posix conform: processConn -- add document, that describes on howto add a new driver - -- Fix open_console: serial check is missing -- write / find indent script to fixup source files - -- check for senseful use of global variables (gunze_calib, etouch - -> also in the library code - -gpm2: -- protocols: - GPM2_PROTOCOLS via cconf - wenn leer, dann ls mice/* -- version - via cconf! - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.8 deleted file mode 100644 index 26d46c24..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.8 +++ /dev/null @@ -1,4 +0,0 @@ -- double check that the os speficih code is in gpm2/os// - prefix os specific drivers with OS-name? - like linux event and joystick - diff --git a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.9 deleted file mode 100644 index 9787b875..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/doc/todo/1.99.9 +++ /dev/null @@ -1,4 +0,0 @@ -- cleanly design conf/ - add cc, ld, ..., create temporary files for cc/ld (like in cinit) -- splitoff twiddler.c -- remove most FIXME entries diff --git a/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-root.conf b/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-syn.conf b/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/example-configurations/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/TODO b/software/gpm/browse_source/gpm-1.99.6/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/client/README b/software/gpm/browse_source/gpm-1.99.6/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/README b/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/core/main.c deleted file mode 100644 index 7109e486..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/core/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc,argv)) return 1; - - if(!read_config(opts.cconfig)) return 1; - - /* creates a fork() */ - if(!mice_handler()) return 1; - - /* listen to messages: exits only on failure or shutdown */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/core/read_config.c deleted file mode 100644 index 05e3cc2a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/core/read_config.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* open cconfig-dir (FIXME: write small framework for reuse) */ - - if(!cconfig) return 0; /* remove, just to make gcc happy */ - /* set options */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/core/set_defaults.c deleted file mode 100644 index 0b840c0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/core/set_defaults.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* options */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/daemon/README b/software/gpm/browse_source/gpm-1.99.6/gpm2/daemon/README deleted file mode 100644 index 37394952..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/daemon/README +++ /dev/null @@ -1 +0,0 @@ -Stuff, that is relevant for daemonizing only. diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/daemon/become_daemon.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/daemon/become_daemon.c deleted file mode 100644 index 0b71a053..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/daemon/become_daemon.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007-2008 Nico Schottelius - * - * 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. - * - * - * Become a daemon - ********/ - -#include /* open */ -#include /* close/dup2 */ -#include /* perror */ - -#include "gpm2-messages.h" /* GPM2_MESS_* */ - -#define NULL_DEV "/dev/null" - -int become_daemon() -{ - int fd; - - /* fork */ - switch(fork()) { - case -1: /* error */ - perror(GPM2_MESS_FORK); - return 0; - break; - case 0: /* child */ - break; - default: - _exit(0); /* parent */ - } - - /***************** child code ******************/ - - /* change fds */ - fd = open(NULL_DEV, O_RDWR); - if(fd == -1) { - perror(GPM2_MESS_OPEN); - return 0; - } - - if (setsid() == -1) { - perror(GPM2_MESS_SETSID); - return 0; - } - if (chdir("/") == -1) { - perror(GPM2_MESS_CHDIR); - return 0; - } - - - /* FIXME perhaps connect to syslog? */ - if(dup2(fd, STDIN_FILENO) == -1 || - dup2(fd, STDOUT_FILENO) == -1 || - dup2(fd, STDERR_FILENO) == -1) { - perror(GPM2_MESS_DUP2); - return 0; - } - - if(close(fd) == -1) { - /* makes no sense, as stderr is dead. use gpm2_report later - perror(GPM2_MESS_CLOSE); */ - return 0; - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.99.6/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.99.6/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.99.6/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.99.6/gpm2/doc/DESIGN deleted file mode 100644 index 5f759bf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/doc/DESIGN +++ /dev/null @@ -1,71 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog - - gpm2-log: needed? - - logging interface for gpm2-daemon - - recieves messages - - diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/commandline.c deleted file mode 100644 index 76f6498e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/commandline.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) { - switch(opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/daemon-usage.c deleted file mode 100644 index e5ec067d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n",1); - mini_printf("\n",1); - mini_printf(" -c : specify configuration directory\n",1); - mini_printf(" -f: fork into background after startup \n",1); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/mini_printf.c deleted file mode 100644 index d5b0d1f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str,int fd) -{ - char *p; - - /* don't get fooled by bad pointers */ - if(str == NULL) return; - - p = str; - while(*p) p++; - - write(fd,str,(size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/read_packet.c deleted file mode 100644 index cb5285d5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/generic/read_packet.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so we do */ - - packet = malloc(len); - if(packet == NULL) return NULL; - - if(read(fd,&packet,len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 4d94470c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int become_daemon(); -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-messages.h b/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-messages.h deleted file mode 100644 index 833e2754..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/include/gpm2-messages.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Messages - ********/ - -#ifndef GPM2_MESSAGES -#define GPM2_MESSAGES - -#define GPM2_MESS_OPEN "open" -#define GPM2_MESS_FORK "fork" -#define GPM2_MESS_SETSID "setsid" -#define GPM2_MESS_CHDIR "chdir" -#define GPM2_MESS_DUP2 "dup2" - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/README b/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 37f2cb69..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* open connections: pipes */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/mice_handler.c deleted file mode 100644 index edc0cfc5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - - -#include "gpm2-daemon.h" -//#include "tmp/protocols.h" - -int mice_handler() -{ - - /* init_mice_handler(); - * open connections to gpm2_daemon: - * - one for each mouse: - * * raw channel (unidirectional) - * * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - // init_mice_handler(); - - /* init_mice: - * - * - open mousedev - * - drop priviliges after that - */ - //init_mice(); - - - //handle_mice(); /* forks and maintains mice */ - - /* dirty hack */ - int ps2test = open("/dev/psaux",O_RDWR); - - // gpm2_open_ps2(ps2test); - // gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/ps2.c deleted file mode 100644 index ff68abbe..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/mice/ps2.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - //static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - /* FIXME: check return */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("RX: %#hhx\n",ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd,&ibuf,1); - printf("ST: %#hhx\n",ibuf); - read(fd,&ibuf,1); - printf("DI: %#hhx\n",ibuf); - - /* set resolution: 0xe8 */ - - //if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* do 0xf2, get device id and print it out */ - /* do 0xe9 and print out values as status */ - - /* FIXME: time correct? */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd,data,3); - - if(data[0] & 0x01) mini_printf("left!\n",1); - if(data[0] & 0x02) mini_printf("right!\n",1); - if(data[0] & 0x04) mini_printf("middle!\n",1); - - /* decoded->button_left = data[0] & 0x01; - decoded->button_right = data[0] & 0x02; - decoded->button_middle = data[0] & 0x04; - - decoded-> */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.99.6/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.99.6/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.99.6/gpm2/tmp.README b/software/gpm/browse_source/gpm-1.99.6/gpm2/tmp.README deleted file mode 100644 index 30214bfd..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/gpm2/tmp.README +++ /dev/null @@ -1 +0,0 @@ -Directory for temporarily created files. diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i -To: spida //at\\ spida.net -Subject: gpm-calib.conf -Hi Timo! - -Das Dateiformat sieht wie folgt aus: - -ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max - -wobei alle e* die Reichweite der Koordinaten angeben, die aus dem -Event-Interface kommen und alle r* die Bilschirmkoordinaten sind, auf -die abgebildet wird. Alle Werte werden nur von Leerzeichen getrennt. -Das eGalax gibt über das Event-Interface ungefähr Werte zwischen 0 und -2000 für beide Achsen aus. Die Bildschirmkoordinaten sollten immer auf 0 -beim Minimum und auf der Bildschirmauflösung minus 1 beim Maximum -stehen. Für Textmodi entspricht die Auflösung der Textauflösung. Bei -Framebuffer-Konsolen kann ich es nicht mit Sicherheit sagen. - -Für 800x600 auf dem eGalax sollte die Datei also ungefähr so aussehen: - -50 1950 50 1950 0 799 0 599 - -Gruß, Micha. diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.3/gpm-evabs.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.3/gpm-evabs.patch deleted file mode 100644 index da23b490..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.3/gpm-evabs.patch +++ /dev/null @@ -1,327 +0,0 @@ -diff -ur gpm-1.99.2.2/src/daemon/cmdline.c gpm-1.99.2.2-patched/src/daemon/cmdline.c ---- gpm-1.99.2.2/src/daemon/cmdline.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/cmdline.c 2008-03-25 22:59:16.000000000 +0100 -@@ -32,7 +32,7 @@ - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -47,6 +47,7 @@ - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; -+ case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; -diff -ur gpm-1.99.2.2/src/daemon/gpm.c gpm-1.99.2.2-patched/src/daemon/gpm.c ---- gpm-1.99.2.2/src/daemon/gpm.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/gpm.c 2008-03-25 21:14:32.000000000 +0100 -@@ -73,9 +73,11 @@ - - struct mouse_features mouse_table[3] = { - { -- DEF_TYPE, DEF_DEV, DEF_SEQUENCE, -+ DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, -+ DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 -diff -ur gpm-1.99.2.2/src/daemon/processmouse.c gpm-1.99.2.2-patched/src/daemon/processmouse.c ---- gpm-1.99.2.2/src/daemon/processmouse.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/processmouse.c 2008-03-25 22:59:11.000000000 +0100 -@@ -55,6 +55,8 @@ - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; -+ int tempx, tempy; -+ static int oldx, oldy; - - oldT = event->type; - -@@ -77,6 +79,12 @@ - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - -+ /* use uncalibrated values as base values */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ nEvent.x = oldx; -+ nEvent.y = oldy; -+ } -+ - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { -@@ -123,6 +131,31 @@ - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - -+ /* apply calibration */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ /* save uncalibrated values for use next time around */ -+ oldx = nEvent.x; -+ oldy = nEvent.y; -+ -+ /* do calculations in a larger variable */ -+ tempx = nEvent.x; -+ tempy = nEvent.y; -+ tempx -= which_mouse->opt_dminx; -+ tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); -+ tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); -+ tempx += which_mouse->opt_ominx; -+ -+ tempy -= which_mouse->opt_dminy; -+ tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); -+ tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); -+ tempy += which_mouse->opt_ominy; -+ -+ nEvent.x = tempx; -+ nEvent.y = tempy; -+ -+ event->dx = (nEvent.x) - (event->x); -+ event->dy = (nEvent.y) - (event->y); -+ } - } /* if(eventFlag) */ - - /*....................................... update the button number */ -@@ -144,11 +177,63 @@ - } - rept1=rept2; - -- event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ /* if the values are calibrated, this is not necessary */ -+ if(which_mouse->opt_calib==NULL) -+ event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ - event->x=nEvent.x; - event->y=nEvent.y; - } -- repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ -+ -+ /* not all relative repeaters can handle big changes, -+ so repackage into several smaller updates */ -+ if (!repeated_type->absolute) { -+ int remx, remy; -+ remx = event->dx; -+ remy = event->dy; -+ -+ do { -+ if (remx<0) { -+ if (remx>=-127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = -127; -+ remx += 127; -+ } -+ } -+ if (remx>0) { -+ if (remx<=127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = 127; -+ remx -= 127; -+ } -+ } -+ if (remy<0) { -+ if (remy>=-127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = -127; -+ remy += 127; -+ } -+ } -+ if (remy>0) { -+ if (remy<=127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = 127; -+ remy -= 127; -+ } -+ } -+ repeated_type->repeat_fun(event, fifofd); -+ } while((remx!= 0)||(remy!=0)); -+ } -+ else -+ repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ -diff -ur gpm-1.99.2.2/src/daemon/startup.c gpm-1.99.2.2-patched/src/daemon/startup.c ---- gpm-1.99.2.2/src/daemon/startup.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/startup.c 2008-03-25 21:51:07.000000000 +0100 -@@ -36,6 +36,7 @@ - void startup(int argc, char **argv) - { - int i, opt; -+ FILE* calib_file; - - static struct { - char *in; -@@ -104,6 +105,21 @@ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); -+ if (which_mouse->opt_calib!=NULL) { -+ calib_file = fopen(which_mouse->opt_calib,"r"); -+ if (calib_file) { -+ if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", -+ &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, -+ &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) -+ which_mouse->opt_calib = NULL; -+ if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| -+ (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| -+ (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| -+ (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) -+ which_mouse->opt_calib = NULL; -+ } -+ fclose(calib_file); -+ } - } - - /* Check repeater status */ -diff -ur gpm-1.99.2.2/src/headers/daemon.h gpm-1.99.2.2-patched/src/headers/daemon.h ---- gpm-1.99.2.2/src/headers/daemon.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/daemon.h 2008-03-25 21:35:10.000000000 +0100 -@@ -82,7 +82,8 @@ - struct mouse_features { - char *opt_type, - *opt_dev, -- *opt_sequence; -+ *opt_sequence, -+ *opt_calib; - int opt_baud, - opt_sample, - opt_delta, -@@ -92,7 +93,15 @@ - opt_time, - opt_cluster, - opt_three, -- opt_glidepoint_tap; -+ opt_glidepoint_tap, -+ opt_dminx, -+ opt_dmaxx, -+ opt_dminy, -+ opt_dmaxy, -+ opt_ominx, -+ opt_omaxx, -+ opt_ominy, -+ opt_omaxy; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -142,6 +151,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -151,6 +161,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/gpmCfg.h gpm-1.99.2.2-patched/src/headers/gpmCfg.h ---- gpm-1.99.2.2/src/headers/gpmCfg.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/gpmCfg.h 2008-03-25 21:33:05.000000000 +0100 -@@ -48,6 +48,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -57,6 +58,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/message.h gpm-1.99.2.2-patched/src/headers/message.h ---- gpm-1.99.2.2/src/headers/message.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/message.h 2008-03-25 21:37:00.000000000 +0100 -@@ -75,6 +75,7 @@ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ -+ " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ -diff -ur gpm-1.99.2.2/src/mice.c gpm-1.99.2.2-patched/src/mice.c ---- gpm-1.99.2.2/src/mice.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/mice.c 2008-03-25 21:45:16.000000000 +0100 -@@ -140,6 +140,27 @@ - } - return 0; - } -+ -+static int M_evabs (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_ABS) { -+ if (thisevent.code == ABS_X) -+ state->x = thisevent.value; -+ else if (thisevent.code == ABS_Y) -+ state->y = thisevent.value; -+ } else if (thisevent.type == EV_KEY) { -+ switch(thisevent.code) { -+ case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; -+ case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; -+ case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; -+ } -+ } -+ return 0; -+} - #endif /* HAVE_LINUX_INPUT_H */ - - static int M_ms_plus(Gpm_Event *state, unsigned char *data) -@@ -2153,6 +2174,9 @@ - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -+ {"evabs", "Linux Event Device - absolute mode", -+ "", M_evabs, I_empty, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, - #endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/rejected/paste.debian.net/plain/154 b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/rejected/paste.debian.net/plain/154 deleted file mode 100644 index 78571944..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/rejected/paste.debian.net/plain/154 +++ /dev/null @@ -1,34 +0,0 @@ -diff -Naur gpm-1.19.6.old/contrib/control/gpm_has_mouse_control.c gpm-1.19.6/contrib/control/gpm_has_mouse_control.c ---- gpm-1.19.6.orig/contrib/control/gpm_has_mouse_control.c 1970-01-01 01:00:00.000000000 +0100 -+++ gpm-1.19.6/control/control/gpm_has_mouse_control.c 2004-08-09 18:41:53.000000000 +0200 -@@ -0,0 +1,20 @@ -+#include -+#include -+#include -+#include -+#include -+ -+int main (int argc, char **argv) -+{ -+ int fd; -+ int mode; -+ fd = open ("/dev/tty0", O_RDONLY); -+ if (fd == -1) -+ fd = open ("/dev/vc/0", O_RDONLY); -+ if (fd == -1) -+ perror ("open"); -+ if (ioctl (fd, KDGETMODE, &mode) != 0) -+ perror ("ioctl"); -+ exit(mode); -+} -+ -diff -Naur gpm-1.19.6.old/contrib/control/Makefile gpm-1.19.6/contrib/control/Makefile ---- gpm-1.19.6.orig/contrib/control/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ gpm-1.19.6/contrib/control/Makefile 2004-08-09 18:41:53.000000000 +0200 -@@ -0,0 +1,5 @@ -+all: gpm_has_mouse_control.c -+ gcc -o gpm_has_mouse_control -Wall gpm_has_mouse_control.c -+ -+clean: -+ -rm -f gpm_has_mouse_control - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/rejected/paste.debian.net/plain/154.reason b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/rejected/paste.debian.net/plain/154.reason deleted file mode 100644 index c9fb96e8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/rejected/paste.debian.net/plain/154.reason +++ /dev/null @@ -1,3 +0,0 @@ -- gcc hardcoded -- no error handling -- no description diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch deleted file mode 100644 index cdc72236..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch +++ /dev/null @@ -1,101 +0,0 @@ -diff -urN gpm-1.99.5/doc/README.1.20.2 gpm-1.99.5-patched/doc/README.1.20.2 ---- gpm-1.99.5/doc/README.1.20.2 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5-patched/doc/README.1.20.2 1970-01-01 01:00:00.000000000 +0100 -@@ -1,54 +0,0 @@ -- -- -- Dear reader, -- -- -- you are reading this document, because you saw that there is a new -- release of gpm available, gpm 1.20.2. -- -- Unfortunately this release is broken, but that's not a big problem. -- -- gpm is broken for some time and I did not spent any time to the project -- for about two years. -- -- Some weeks ago, I was contacted by someone asking me to write a very -- small feature for gpm (a small client program, included in this -- release). I answered the person that I do not have the time to code -- that part, but if he really insists that I should write that code, -- he should think about sponsoring me [0]. -- -- Some days later I recieved an email that he wanted to sponsor me. -- I was a little bit surprised, because it was the first person really -- considering my sponsoring plans. -- -- So I coded that small program and had some views in the old code of -- gpm. There's so much information in it, so many hacks, so many dirty -- tricks and there are still many people using it. -- -- So I considered to try to spent more time to gpm, perhaps even creating -- a more clean (and better maintainable) version of it. -- -- But I _am_ actually a pretty busy person, working almost all time, if not -- doing sports (just about 6 hours a week) or sleeping. -- -- So I thought, perhaps you can help me to get more time for coding FOSS [1] -- in general or gpm in specific: -- -- My idea is, that if you consider sponsoring my work, I can begin to work less -- "traditionally" and also finance my second study in computer science, which -- I will begin in autumn 2008, if I have the money to do it (living in -- Switzerland is not that cheap). -- -- I am looking forward to get any feedback from you about this idea -- at nico-gpm-sponsoring (at) schottelius.org. -- -- Thanks for reading, -- -- -- Nico Schottelius, 12. May 2007 -- -- -- P.S.: GPM is alive! -- -- [0]: Sponsoring information: http://nico.schottelius.org/about/support -- [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ -diff -urN gpm-1.99.5/doc/README.evabs gpm-1.99.5-patched/doc/README.evabs ---- gpm-1.99.5/doc/README.evabs 1970-01-01 01:00:00.000000000 +0100 -+++ gpm-1.99.5-patched/doc/README.evabs 2008-04-06 16:11:30.000000000 +0200 -@@ -0,0 +1,39 @@ -+ -+This file tells how to use gpm with the driver for event-devices -+that use absolut coordiantes (evabs) like touchscreens. It was -+desigened and tested for eGalax controllers, but should work with -+others as well. -+ -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done with a configfile. It consists of a single -+line of 8 integers: -+ -+ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max -+ -+The first four values (prefixed withe here) show the minimum and -+maximum values of coordinates the event-device delivers for -+x- and y-axis, respectivly. The last four values show range of -+coordinates to which the input should be scaled, for example your -+screen resolution. This works for text-mode, too. -+ -+An example for an 800x600 screen would look like this: -+ -+50 1950 50 1950 0 799 0 599 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+You need to use the evabs devicetype to use this feature, a -+device that delivers the absolute coordinates a config-file -+that describes how to scale these coordinates, and a repeater- -+device used for output. -+The pseudo-file /proc/bus/input/devices should tell you which -+event-device to use. -+ -+Usage example: -+ -+gpm -t evabs -m /dev/input/event2 -c /etc/gpm-calib.conf -R ps2 diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.modified b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.modified deleted file mode 100644 index a5c18071..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.modified +++ /dev/null @@ -1,43 +0,0 @@ -diff -urN gpm-1.99.5/doc/README.evabs gpm-1.99.5-patched/doc/README.evabs ---- gpm-1.99.5/doc/README.evabs 1970-01-01 01:00:00.000000000 +0100 -+++ gpm-1.99.5-patched/doc/README.evabs 2008-04-06 16:11:30.000000000 +0200 -@@ -0,0 +1,39 @@ -+ -+This file tells how to use gpm with the driver for event-devices -+that use absolut coordiantes (evabs) like touchscreens. It was -+desigened and tested for eGalax controllers, but should work with -+others as well. -+ -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done with a configfile. It consists of a single -+line of 8 integers: -+ -+ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max -+ -+The first four values (prefixed withe here) show the minimum and -+maximum values of coordinates the event-device delivers for -+x- and y-axis, respectivly. The last four values show range of -+coordinates to which the input should be scaled, for example your -+screen resolution. This works for text-mode, too. -+ -+An example for an 800x600 screen would look like this: -+ -+50 1950 50 1950 0 799 0 599 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+You need to use the evabs devicetype to use this feature, a -+device that delivers the absolute coordinates a config-file -+that describes how to scale these coordinates, and a repeater- -+device used for output. -+The pseudo-file /proc/bus/input/devices should tell you which -+event-device to use. -+ -+Usage example: -+ -+gpm -t evabs -m /dev/input/event2 -c /etc/gpm-calib.conf -R ps2 diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.reason b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.reason deleted file mode 100644 index 6ece1f6f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.reason +++ /dev/null @@ -1 +0,0 @@ -No need to modify the 1.20.2 README for evabs doc. diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/commit-36f0509 b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/commit-36f0509 deleted file mode 100644 index 09b36112..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/commit-36f0509 +++ /dev/null @@ -1,45 +0,0 @@ -commit 36f0509100b0e851f93f0a544950539c0af83937 -Author: Bernhard Fischer -Date: Tue Apr 15 17:29:05 2008 +0200 - - remove unused f_fgcmd - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index a01caa8..dda6904 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -179,7 +179,6 @@ Draw *cfg_alloc(void); - - enum F_call {F_CREATE, F_POST, F_INVOKE, F_DONE}; - int f_bgcmd(int mode, DrawItem *self, int uid); --int f_fgcmd(int mode, DrawItem *self, int uid); - int f_jptty(int mode, DrawItem *self, int uid); - int f_mktty(int mode, DrawItem *self, int uid); - int f_menu(int mode, DrawItem *self, int uid); -@@ -287,7 +286,6 @@ struct funcName { - int (*fun)(); - }; - struct funcName funcList[] = { -- {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, -@@ -441,18 +439,6 @@ void f__fix(struct passwd *pass) - } - - /*---------------------------------------------------------------------*/ --int f_fgcmd(int mode, DrawItem *self, int uid) --{ -- self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ -- switch (mode) { -- case F_CREATE: -- case F_POST: break; -- case F_INVOKE: ; /* MISS */ -- } -- return 0; --} -- --/*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { - int i; diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/commit-9b45502 b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/commit-9b45502 deleted file mode 100644 index 2b084aa4..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/commit-9b45502 +++ /dev/null @@ -1,132 +0,0 @@ -commit 9b45502d530adad84c7a7325601a8642741a510d -Author: Bernhard Fischer -Date: Tue Apr 15 17:16:13 2008 +0200 - - remove unneeded functions - - Remove f_debug and f_debug_one since they are ifdefed out. - Remove f_lock; Use the vlock program if you want to lock terminals. - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index e30a5d4..a01caa8 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -178,13 +178,11 @@ Draw *cfg_alloc(void); - /* prototypes for predefined functions */ - - enum F_call {F_CREATE, F_POST, F_INVOKE, F_DONE}; --int f_debug(int mode, DrawItem *self, int uid); - int f_bgcmd(int mode, DrawItem *self, int uid); - int f_fgcmd(int mode, DrawItem *self, int uid); - int f_jptty(int mode, DrawItem *self, int uid); - int f_mktty(int mode, DrawItem *self, int uid); - int f_menu(int mode, DrawItem *self, int uid); --int f_lock(int mode, DrawItem *self, int uid); - int f_load(int mode, DrawItem *self, int uid); - int f_free(int mode, DrawItem *self, int uid); - int f_time(int mode, DrawItem *self, int uid); -@@ -289,13 +287,11 @@ struct funcName { - int (*fun)(); - }; - struct funcName funcList[] = { -- {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, -- {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, -@@ -445,58 +441,6 @@ void f__fix(struct passwd *pass) - } - - /*---------------------------------------------------------------------*/ --static int f_debug_one(FILE *f, Draw *draw) --{ -- DrawItem *ip; -- static int tc=0; -- int i; -- --#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); -- LINE((f,"UID %i\n",draw->uid)); -- LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); -- LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); -- LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); -- for (ip=draw->menu; ip; ip=ip->next) { -- LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); -- if (ip->fun == f_menu) { -- tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; -- } -- } --#undef LINE -- return 0; --} -- --int f_debug(int mode, DrawItem *self, int uid) --{ -- -- mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ --#if 0 /* Disabled on account of security concerns; the way -- * "/tmp/root-debug" is used is gratuitously -- * open to symlink abuse */ -- -- FILE *f; -- Draw *dp; -- -- switch (mode) { -- case F_POST: -- if (!(f=fopen("/tmp/root-debug","a"))) return 1; -- for(dp=drawList; dp; dp=dp->next) -- f_debug_one(f,dp); -- fprintf(f,"\n\n"); -- fclose(f); -- -- case F_CREATE: -- case F_INVOKE: -- break; -- } --#endif /* 0 */ -- return 0; --} -- -- --/*---------------------------------------------------------------------*/ - int f_fgcmd(int mode, DrawItem *self, int uid) - { - self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ -@@ -620,31 +564,6 @@ int f_menu(int mode, DrawItem *self, int uid) - return 0; /* just a placeholder, recursion is performed in main() */ - } - --/*---------------------------------------------------------------------*/ --int f_lock(int mode, DrawItem *self, int uid) --{ -- mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ --#if 0 /* some kind of interesting ...: if never */ -- int all; -- static DrawItem msg = { -- 0, -- 10, -- "Enter your password to unlock", -- NULL, NULL, NULL, NULL -- }; -- static Draw -- -- -- switch (mode) { -- case F_CREATE: /* either "one" or anything else */ -- if (strcmp(self->arg,"one")) self->arg[0]='a'; -- case F_POST: break; -- case F_INVOKE: /* the biggest of all... */ -- } -- --#endif -- return 0; --} - - /*---------------------------------------------------------------------*/ - int f_load(int mode, DrawItem *self, int uid) diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-add-install-exec.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-add-install-exec.patch deleted file mode 100644 index 9f0fa56d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-add-install-exec.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -rdup gpm-1.99.5.old7/Makefile.in gpm-1.99.5/Makefile.in ---- gpm-1.99.5.old7/Makefile.in 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/Makefile.in 2008-04-15 13:46:27.000000000 +0200 -@@ -44,6 +44,9 @@ install: check installdirs do-install - install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -+install-exec: installdirs -+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install -+ - installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-fix-drivers-etouch.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-fix-drivers-etouch.patch deleted file mode 100644 index 4b3af261..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-fix-drivers-etouch.patch +++ /dev/null @@ -1,15 +0,0 @@ -\\\\ -\\ drivers/etouch/i.c: In function 'I_etouch': -\\ drivers/etouch/i.c:74: error: array subscript is above array bounds -diff -rdup gpm-1.99.5.old4/src/drivers/etouch/i.c gpm-1.99.5/src/drivers/etouch/i.c ---- gpm-1.99.5.old4/src/drivers/etouch/i.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/drivers/etouch/i.c 2008-04-15 13:32:22.000000000 +0200 -@@ -71,7 +71,7 @@ Gpm_Type *I_etouch(int fd, unsigned shor - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-missing-return-in-main.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-missing-return-in-main.patch deleted file mode 100644 index 37d8919b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-missing-return-in-main.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -rdup gpm-1.99.5.old/src/daemon/old_main.c gpm-1.99.5/src/daemon/old_main.c ---- gpm-1.99.5.old/src/daemon/old_main.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/daemon/old_main.c 2008-04-15 13:25:49.000000000 +0200 -@@ -261,4 +261,5 @@ int old_main() - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -+ return 0; - } diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-susv3-legacy.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-susv3-legacy.patch deleted file mode 100644 index 92e94828..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-susv3-legacy.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff -rdup gpm-1.99.5.old/src/daemon/old_main.c gpm-1.99.5/src/daemon/old_main.c ---- gpm-1.99.5.old/src/daemon/old_main.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/daemon/old_main.c 2008-04-15 13:22:49.000000000 +0200 -@@ -88,7 +88,7 @@ int old_main() - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); -- bzero((char *)&ctladdr,sizeof(ctladdr)); -+ memset((char *)&ctladdr, 0, sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); -diff -rdup gpm-1.99.5.old/src/daemon/processconn.c gpm-1.99.5/src/daemon/processconn.c ---- gpm-1.99.5.old/src/daemon/processconn.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/daemon/processconn.c 2008-04-15 13:22:37.000000000 +0200 -@@ -49,7 +49,7 @@ int processConn(int fd) /* returns newfd - - /*....................................... Accept */ - -- bzero((char *)&addr,sizeof(addr)); -+ memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); -diff -rdup gpm-1.99.5.old/src/lib/liblow.c gpm-1.99.5/src/lib/liblow.c ---- gpm-1.99.5.old/src/lib/liblow.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/lib/liblow.c 2008-04-15 13:23:15.000000000 +0200 -@@ -289,7 +289,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - } - - #ifndef SO_PEERCRED -- bzero((char *)&addr,sizeof(addr)); -+ memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); -@@ -303,7 +303,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - } - #endif - -- bzero((char *)&addr,sizeof(addr)); -+ memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); ---- gpm-1.99.5.old5/src/drivers/synaptics/synaptics.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/drivers/synaptics/synaptics.c 2008-04-15 13:35:53.000000000 +0200 -@@ -2121,9 +2121,9 @@ void tp_read_config_file (char* config_f - break; - - case Flag_Param: -- if (index ("YyTt1", token [0])) { -+ if (strchr ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; -- } else if (index ("NnFf0", token [0])) { -+ } else if (strchr ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-wrong-include-for-ioctl.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-wrong-include-for-ioctl.patch deleted file mode 100644 index a9458267..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/gpm-1.99.5-wrong-include-for-ioctl.patch +++ /dev/null @@ -1,15 +0,0 @@ -Only in gpm-1.99.5/src/daemon: old_main.P -Only in gpm-1.99.5/src/daemon: old_main.o -diff -rdup gpm-1.99.5.old3/src/daemon/open_console.c gpm-1.99.5/src/daemon/open_console.c ---- gpm-1.99.5.old3/src/daemon/open_console.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/daemon/open_console.c 2008-04-15 13:30:03.000000000 +0200 -@@ -21,7 +21,7 @@ - - #include /* open and co. */ - #include /* stat() */ --#include /* ioctl */ -+#include /* ioctl() */ - - /* Linux specific (to be outsourced in gpm2 */ - #include /* for serial console check */ -Only in gpm-1.99.5/src/daemon: open_console.d diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch deleted file mode 100644 index 218fcac0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch +++ /dev/null @@ -1,21 +0,0 @@ -\\\\ -\\ src/prog/gpm-root.y:449: error: 'f_debug_one' defined but not used -diff -rdup gpm-1.99.5.old6/src/prog/gpm-root.y gpm-1.99.5/src/prog/gpm-root.y ---- gpm-1.99.5.old6/src/prog/gpm-root.y 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/prog/gpm-root.y 2008-04-15 13:40:36.000000000 +0200 -@@ -445,6 +445,7 @@ void f__fix(struct passwd *pass) - } - - /*---------------------------------------------------------------------*/ -+#ifdef DEBUG - static int f_debug_one(FILE *f, Draw *draw) - { - DrawItem *ip; -@@ -467,6 +468,7 @@ static int f_debug_one(FILE *f, Draw *dr - #undef LINE - return 0; - } -+#endif - - int f_debug(int mode, DrawItem *self, int uid) - { diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch.reason b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch.reason deleted file mode 100644 index f3fc8e3c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch.reason +++ /dev/null @@ -1 +0,0 @@ -Should cleanup all debug stuff in gpm-root better diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-blah.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-blah.patch deleted file mode 100644 index 14395301..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-blah.patch +++ /dev/null @@ -1,437 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index 357764b..d22527d 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -48,9 +48,9 @@ install-exec: installdirs - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install - - installdirs: -- $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ -+ @MKDIR_P@ $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ -- $(MKDIR) $(lispdir) ; \ -+ @MKDIR_P@ $(lispdir) ; \ - fi - - ### GENERIC -diff --git a/Makefile.include.in b/Makefile.include.in -index 913172f..b2527c5 100644 ---- a/Makefile.include.in -+++ b/Makefile.include.in -@@ -58,8 +58,6 @@ AR = ar - ETAGS = etags - AWK = awk - CP = cp -a --MKDIR = mkdir -p # linux specific, but who cares ? -- # gpm is linux specific, too. - RM = rm - - -diff --git a/acinclude.m4 b/acinclude.m4 -new file mode 100644 -index 0000000..c83a5a8 ---- /dev/null -+++ b/acinclude.m4 -@@ -0,0 +1,36 @@ -+dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -+AC_DEFUN(ITZ_SYS_ELF, -+[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -+[AC_EGREP_CPP(win, -+[#ifdef __ELF__ -+win -+#else -+lose -+#endif -+],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -+if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then -+ PICFLAGS="-DPIC -fPIC" -+ SOLDFLAGS="-fPIC -shared -Wl,-soname," -+else -+ PICFLAGS= -+ SOLDFLAGS= -+fi -+]) -+AC_DEFUN(ITZ_PATH_SITE_LISP, -+[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -+[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -+sed -e '/^$/d' | sed -n -e 2p` -+case x${itz_cv_path_site_lisp} in -+x*site-lisp*) ;; -+x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -+esac]) -+]) -+AC_DEFUN(ITZ_CHECK_TYPE, -+[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -+AC_TRY_COMPILE([ -+#include <$2> -+],[ -+$1 dummy; -+return 0; -+],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -+]) -diff --git a/aclocal.m4 b/aclocal.m4 -deleted file mode 100644 -index c83a5a8..0000000 ---- a/aclocal.m4 -+++ /dev/null -@@ -1,36 +0,0 @@ --dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ --AC_DEFUN(ITZ_SYS_ELF, --[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, --[AC_EGREP_CPP(win, --[#ifdef __ELF__ --win --#else --lose --#endif --],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) --if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then -- PICFLAGS="-DPIC -fPIC" -- SOLDFLAGS="-fPIC -shared -Wl,-soname," --else -- PICFLAGS= -- SOLDFLAGS= --fi --]) --AC_DEFUN(ITZ_PATH_SITE_LISP, --[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, --[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | --sed -e '/^$/d' | sed -n -e 2p` --case x${itz_cv_path_site_lisp} in --x*site-lisp*) ;; --x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; --esac]) --]) --AC_DEFUN(ITZ_CHECK_TYPE, --[AC_CACHE_CHECK([for $1],itz_cv_type_$1, --AC_TRY_COMPILE([ --#include <$2> --],[ --$1 dummy; --return 0; --],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) --]) -diff --git a/autogen.sh b/autogen.sh -new file mode 100755 -index 0000000..12e6747 ---- /dev/null -+++ b/autogen.sh -@@ -0,0 +1,9 @@ -+#!/bin/sh -e -+ -+[ -d config ] || mkdir config -+${ACLOCAL-aclocal} -I config -+${LIBTOOLIZE-libtoolize} --force --copy -+${AUTOHEADER-autoheader} -+${AUTOMAKE-automake} --add-missing --copy 2> /dev/null || true -+${AUTOCONF-autoconf} -+ -diff --git a/configure.ac b/configure.ac -index f8bba91..c1d175a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2,15 +2,18 @@ dnl Process this file with autoconf to produce a configure script. - dnl written jan/1997 - T.E.Dickey - - AC_PREREQ(2.61) --AC_INIT(src/daemon/main.c) --AC_CONFIG_HEADER(src/headers/config.h) - --release=1.99.6 --release_date="no date yet" --revgit=`git-rev-parse --short HEAD` --AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release", "Release number") --AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date", "Release date") --AC_DEFINE_UNQUOTED(GPM_RELEASE_GIT,"$revgit", "Result from git-rev-parse") -+AC_INIT([gpm],[1.99.6],[http://unix.schottelius.org/gpm/]) -+AC_CONFIG_SRCDIR([src/daemon/main.c]) -+AC_CONFIG_AUX_DIR([config]) -+AC_CONFIG_HEADER([src/headers/config.h]) -+ -+AC_CANONICAL_HOST -+ -+revgit="`git-rev-parse --short HEAD`" -+builddate="`date +%Y%m%d\ %T\ %z`" -+AC_DEFINE_UNQUOTED([GPM_RELEASE_GIT],["$revgit"],[git short revision]) -+AC_DEFINE_UNQUOTED([GPM_RELEASE_DATE],["$builddate"],[build date]) - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. -@@ -31,6 +34,7 @@ fi - AC_PROG_CC - AC_PROG_RANLIB - AC_PROG_INSTALL -+AC_PROG_MKDIR_P - AC_PROG_YACC - AC_PROG_LN_S - -diff --git a/install-sh b/install-sh -deleted file mode 100755 -index ab74c88..0000000 ---- a/install-sh -+++ /dev/null -@@ -1,238 +0,0 @@ --#!/bin/sh --# --# install - install a program, script, or datafile --# This comes from X11R5. --# --# Calling this script install-sh is preferred over install.sh, to prevent --# `make' implicit rules from creating a file called install from it --# when there is no Makefile. --# --# This script is compatible with the BSD install script, but was written --# from scratch. --# -- -- --# set DOITPROG to echo to test this script -- --# Don't use :- since 4.3BSD and earlier shells don't like it. --doit="${DOITPROG-}" -- -- --# put in absolute paths if you don't have them in your path; or use env. vars. -- --mvprog="${MVPROG-mv}" --cpprog="${CPPROG-cp}" --chmodprog="${CHMODPROG-chmod}" --chownprog="${CHOWNPROG-chown}" --chgrpprog="${CHGRPPROG-chgrp}" --stripprog="${STRIPPROG-strip}" --rmprog="${RMPROG-rm}" --mkdirprog="${MKDIRPROG-mkdir}" -- --tranformbasename="" --transform_arg="" --instcmd="$mvprog" --chmodcmd="$chmodprog 0755" --chowncmd="" --chgrpcmd="" --stripcmd="" --rmcmd="$rmprog -f" --mvcmd="$mvprog" --src="" --dst="" --dir_arg="" -- --while [ x"$1" != x ]; do -- case $1 in -- -c) instcmd="$cpprog" -- shift -- continue;; -- -- -d) dir_arg=true -- shift -- continue;; -- -- -m) chmodcmd="$chmodprog $2" -- shift -- shift -- continue;; -- -- -o) chowncmd="$chownprog $2" -- shift -- shift -- continue;; -- -- -g) chgrpcmd="$chgrpprog $2" -- shift -- shift -- continue;; -- -- -s) stripcmd="$stripprog" -- shift -- continue;; -- -- -t=*) transformarg=`echo $1 | sed 's/-t=//'` -- shift -- continue;; -- -- -b=*) transformbasename=`echo $1 | sed 's/-b=//'` -- shift -- continue;; -- -- *) if [ x"$src" = x ] -- then -- src=$1 -- else -- # this colon is to work around a 386BSD /bin/sh bug -- : -- dst=$1 -- fi -- shift -- continue;; -- esac --done -- --if [ x"$src" = x ] --then -- echo "install: no input file specified" -- exit 1 --else -- true --fi -- --if [ x"$dir_arg" != x ]; then -- dst=$src -- src="" -- -- if [ -d $dst ]; then -- instcmd=: -- else -- instcmd=mkdir -- fi --else -- --# Waiting for this to be detected by the "$instcmd $src $dsttmp" command --# might cause directories to be created, which would be especially bad --# if $src (and thus $dsttmp) contains '*'. -- -- if [ -f $src -o -d $src ] -- then -- true -- else -- echo "install: $src does not exist" -- exit 1 -- fi -- -- if [ x"$dst" = x ] -- then -- echo "install: no destination specified" -- exit 1 -- else -- true -- fi -- --# If destination is a directory, append the input filename; if your system --# does not like double slashes in filenames, you may need to add some logic -- -- if [ -d $dst ] -- then -- dst="$dst"/`basename $src` -- else -- true -- fi --fi -- --## this sed command emulates the dirname command --dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` -- --# Make sure that the destination directory exists. --# this part is taken from Noah Friedman's mkinstalldirs script -- --# Skip lots of stat calls in the usual case. --if [ ! -d "$dstdir" ]; then --defaultIFS=' --' --IFS="${IFS-${defaultIFS}}" -- --oIFS="${IFS}" --# Some sh's can't handle IFS=/ for some reason. --IFS='%' --set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` --IFS="${oIFS}" -- --pathcomp='' -- --while [ $# -ne 0 ] ; do -- pathcomp="${pathcomp}${1}" -- shift -- -- if [ ! -d "${pathcomp}" ] ; -- then -- $mkdirprog "${pathcomp}" -- else -- true -- fi -- -- pathcomp="${pathcomp}/" --done --fi -- --if [ x"$dir_arg" != x ] --then -- $doit $instcmd $dst && -- -- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && -- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && -- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && -- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi --else -- --# If we're going to rename the final executable, determine the name now. -- -- if [ x"$transformarg" = x ] -- then -- dstfile=`basename $dst` -- else -- dstfile=`basename $dst $transformbasename | -- sed $transformarg`$transformbasename -- fi -- --# don't allow the sed command to completely eliminate the filename -- -- if [ x"$dstfile" = x ] -- then -- dstfile=`basename $dst` -- else -- true -- fi -- --# Make a temp file name in the proper directory. -- -- dsttmp=$dstdir/#inst.$$# -- --# Move or copy the file name to the temp name -- -- $doit $instcmd $src $dsttmp && -- -- trap "rm -f ${dsttmp}" 0 && -- --# and set any options; do chmod last to preserve setuid bits -- --# If any of these fail, we abort the whole thing. If we want to --# ignore errors from any of these, just make sure not to ignore --# errors from the above "$doit $instcmd $src $dsttmp" command. -- -- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && -- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && -- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && -- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && -- --# Now rename the file to the real destination. -- -- $doit $rmcmd -f $dstdir/$dstfile && -- $doit $mvcmd $dsttmp $dstdir/$dstfile -- --fi && -- -- --exit 0 -diff --git a/src/headers/message.h b/src/headers/message.h -index 9a869a4..8344163 100644 ---- a/src/headers/message.h -+++ b/src/headers/message.h -@@ -62,7 +62,7 @@ - /* messages */ - - /* info */ --#define GPM_MESS_VERSION "gpm " GPM_RELEASE " git:" GPM_RELEASE_GIT ", " GPM_RELEASE_DATE -+#define GPM_MESS_VERSION "gpm " PACKAGE_VERSION " git:" GPM_RELEASE_GIT ", " GPM_RELEASE_DATE - #define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." - #define GPM_MESS_KILLED "Killed gpm(%d)." - #define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -diff --git a/src/lib/libxtra.c b/src/lib/libxtra.c -index 8ea119c..fa5471a 100644 ---- a/src/lib/libxtra.c -+++ b/src/lib/libxtra.c -@@ -38,7 +38,7 @@ - * these two functions return version information - */ - --static char *gpml_ver_s=GPM_RELEASE; -+static char *gpml_ver_s=PACKAGE_VERSION; - static int gpml_ver_i = 0; - - char *Gpm_GetLibVersion(int *where) diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-configure-mkdir.patch b/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-configure-mkdir.patch deleted file mode 100644 index 0271ab75..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-configure-mkdir.patch +++ /dev/null @@ -1,46 +0,0 @@ -let configure figure out a program to use for recursive mkdir - - It uses either 'mkdir -p' or 'install-sh -d'. - -diff --git a/Makefile.in b/Makefile.in -index 357764b..d22527d 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -48,9 +48,9 @@ install-exec: installdirs - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install - - installdirs: -- $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ -+ @MKDIR_P@ $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ -- $(MKDIR) $(lispdir) ; \ -+ @MKDIR_P@ $(lispdir) ; \ - fi - - ### GENERIC -diff --git a/Makefile.include.in b/Makefile.include.in -index 913172f..b2527c5 100644 ---- a/Makefile.include.in -+++ b/Makefile.include.in -@@ -58,8 +58,6 @@ AR = ar - ETAGS = etags - AWK = awk - CP = cp -a --MKDIR = mkdir -p # linux specific, but who cares ? -- # gpm is linux specific, too. - RM = rm - - -diff --git a/configure.ac b/configure.ac -index f8bba91..c1d175a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -31,6 +34,7 @@ fi - AC_PROG_CC - AC_PROG_RANLIB - AC_PROG_INSTALL -+AC_PROG_MKDIR_P - AC_PROG_YACC - AC_PROG_LN_S - - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz deleted file mode 100644 index bf630ad0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/MS3-PATCH-ANDREW.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/MS3-PATCH-ANDREW.gz deleted file mode 100644 index bf1a6d33..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/MS3-PATCH-ANDREW.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/OPEN_MAX.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/OPEN_MAX.gz deleted file mode 100644 index 98d577a9..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/OPEN_MAX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/VSXXX-AA-patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/VSXXX-AA-patch.gz deleted file mode 100644 index de76a90f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/VSXXX-AA-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_1.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_1.gz deleted file mode 100644 index 969a4294..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_2.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_2.gz deleted file mode 100644 index 03d782e1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_2.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_3.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_3.gz deleted file mode 100644 index 61655fbc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/andreas_mohr_3.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_12.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_12.gz deleted file mode 100644 index d27fb356..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_12.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_3rd-final?.tar.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_3rd-final?.tar.gz deleted file mode 100644 index 2317ced5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_3rd-final?.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_c_7.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_c_7.gz deleted file mode 100644 index 0c0e799b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/diff_synaptics_c_7.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/evdev.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/evdev.patch.gz deleted file mode 100644 index 11cfee16..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/evdev.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz deleted file mode 100644 index e09018f2..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz deleted file mode 100644 index 9c37a865..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz deleted file mode 100644 index ab2a7433..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz deleted file mode 100644 index 118b8572..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.20.0-wheel.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.20.0-wheel.patch.gz deleted file mode 100644 index ef7450ba..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.20.0-wheel.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz deleted file mode 100644 index e2c494a0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm06122002-cvs-tty.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm06122002-cvs-tty.patch.gz deleted file mode 100644 index fa16c22b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm06122002-cvs-tty.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm_synaptic_diff.gtar.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm_synaptic_diff.gtar.gz deleted file mode 100644 index 6872e2b8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm_synaptic_diff.gtar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm_unsigned_patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm_unsigned_patch.gz deleted file mode 100644 index 1f5b8862..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/gpm_unsigned_patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/repeater-patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/repeater-patch.gz deleted file mode 100644 index 4a590a94..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/repeater-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/repeater-patch.mail.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/repeater-patch.mail.gz deleted file mode 100644 index 8232d220..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/repeater-patch.mail.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/shlib-patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/shlib-patch.gz deleted file mode 100644 index 54a5cc01..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/applied/shlib-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch deleted file mode 100644 index 65a54431..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- gpm-1.19.3/gpm.c.serialconsole Fri Jan 5 14:10:46 2001 -+++ gpm-1.19.3/gpm.c Fri Jan 5 14:39:28 2001 -@@ -38,6 +38,7 @@ - #include /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.99.6/patches/done/nice_but_refused/compat.c deleted file mode 100644 index 55c29620..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs( void ) { - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - - -/* We may not be able to open the silly thing!!! */ - -const char * get_virtualconsole0( void ) { - static const char * const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char * console = NULL; - struct stat buf; - int i; - - if (console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,lstat); - - /* If we failed as yet ... try again, this time with stat. - Someone is bound to leave a symlink around for compatiblity. */ - - LOOP_SET_SUCCESS_MAJOR(console,TTY_MAJOR,stat); - - oops("Unable to determine virtual console device"); -} - -const char * get_virtualconsole_base( void ) { - static char * console_base = NULL; - - if (console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[ strlen(console_base)-1 ] = '\0'; - } - - return console_base; -} - -const char * get_virtualscreen0( void ) { - static const char * const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char * screen = NULL; - struct stat buf; - int i; - - if (screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,lstat); - - /* try again ... maybe there are others ... at least we can assume - some compatiblity from time to time... */ - - LOOP_SET_SUCCESS_MAJOR(screen,VCS_MAJOR,stat); - - oops("Unable to determine virtual console screen device"); -} - -const char * get_virtualscreen_base( void ) { - static char * screen_base = NULL; - - if (screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if (using_devfs() - || screen_base[ strlen(screen_base)-1 ] == '0') - screen_base[ strlen(screen_base)-1 ] = '\0'; - } - - return screen_base; -} -/* Local Variables: */ -/* tab-width:8 */ -/* c-indent-level:4 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.99.6/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.6/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.99.6/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.99.6/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clockfix.diff b/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clockfix.diff deleted file mode 100644 index e69de29b..00000000 diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 6e0ee29e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,87 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - //printf("Get status\n"); - if((nRet=ioctl(_hFile,TSCRN_CONTROLLER_STATUS ,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - close(_hFile); - exit(1); - } - //printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet,hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile=open("/dev/usb/usbtest",O_RDONLY )) < 0) - { - printf("Error open %d\n",hFile); - return 0; - }; - (void)getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet=ioctl(hFile,73)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - (void)getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet=ioctl(hFile,TSCRN_CALIBRATION,buff)) < 0) - { - printf("Error ioctl %d\n",nRet); - return 0; - } - printf("\n"); - //while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - //printf("\n"); - while((nRet=getStatus(hFile)) < 2) - { - printf("wait for lower left corner %d\n",nRet); - sleep(1); - } - printf("\n"); - while((nRet=getStatus(hFile)) < 3) - { - printf("lower left corner complited;wait for upper right corner %d\n",nRet); - sleep(1); - } - printf("\n"); - if((nRet=getStatus(hFile)) == 3) - printf("upper right corner complited %d\n",nRet); - else - printf("upper right corner error %d\n",nRet); - - printf(" koniec kalibracji OK ioctl: %d \n",nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index e431f21b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,992 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -#include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -#define TSCRN_DEBUG(X) X -#else -#define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data -{ - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead,*pToWrite;// pointers to toRead cell of buffer and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = { NULL, /* ... */}; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor=-1, product=-1; -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = (struct tscrn_usb_data_report *)tscrn->data; - - if (urb->status) return; - - //return when driver was clesed - if(!tscrn->isopen) return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - //if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data))+1; - - // store data to buffer - memcpy(tscrn->pToWrite,data,TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf+OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if (waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - //dbg("irq_touchscreen(): GET_Data 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], tscrn->ctrlout.status); - - return; -} - - -static int open_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) - { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if (!dev) - { - return -ENODEV; - } - - if (!tscrn->present) { - return -ENODEV; - } - - if (tscrn->isopen) { - return -EBUSY; - } - - //clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode * inode, struct file * file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR (inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if (!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - //int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if (signal_pending(current)) - { - ret = -EINTR; - return ret; - } - - this_read = (count >= TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA: count; - - partial = this_read; - //dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, this_read, partial); - dbg("read count=%d", count); - - if (partial) - { /* Data returned */ - if (copy_to_user(buffer, tscrn->pToRead, this_read)) - { - ret = -EFAULT; - return ret;//break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf+OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - - dbg("poll_touchscreen(%d): entered", minor); - - if (!p_tscrn_table[minor]) - { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - //return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - //if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor,cmd); - - if (!p_tscrn_table[minor]) - { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) - { - case TSCRN_USER_REQUEST: - { - /* sends reset command */ - struct - { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if (copy_from_user(&args, (void *)arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev,0x00);//0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d",minor,tscrn->ctrlout.status,nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf,0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if (copy_to_user((void *)arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if (copy_from_user(&type, (void *)arg, sizeof(type))) - { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, *((int *)arg)); - return -EFAULT; - }; - - switch(type) - { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), (unsigned char *)tscrn->setup_packet, - NULL, 0, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void * probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet,nCounter; -#endif - //devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if (vendor != -1 && product != -1) - { - info("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if( dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID - ) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if (!valid_device) - return NULL; /* We didn't find anything pleasing */ - - - if(ifnum != 0) - { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if (dev->descriptor.bNumConfigurations != 1) - { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if (dev->config[0].bNumInterfaces != 1) - { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - //interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", (int) interface->bNumEndpoints); - - if (interface->bNumEndpoints != 1) - { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - - //ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if (IS_EP_INTR(endpoint[ep_cnt])) - { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } - else - { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for (minor = 0; minor < TSCRN_MAX_MNR; minor++) - { - if (!p_tscrn_table[minor]) - break; - } - - /* Check to make sure that the last slot isn't already taken */ - if (p_tscrn_table[minor]) - { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if (!(tscrn = kmalloc (sizeof (struct tscrn_usb_data), GFP_KERNEL))) - { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset (tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg ("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* Ok, now initialize all the relevant values */ - if (!(tscrn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if (!(tscrn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if (!(tscrn->setup_packet = (void *)kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) - { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet),sizeof(devrequest)); - memset((char *)tscrn->setup_packet, 0 , sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT);//| BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - /////////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) - { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver,&dev->actconfig[0].interface[ifnum],tscrn); - } - else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, have_intr); - /* sends reset command */ - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0;//ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) - { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor,tscrn->ctrlin.status); - nRet = usb_clear_halt(dev,0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", minor,tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlin))) - { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor,tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *)tscrn->ibuf,0,IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), (unsigned char *)tscrn->setup_packet, - tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if ((nRet=usb_submit_urb(&tscrn->ctrlout))) - { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor,(int)tscrn->ibuf[0],(int)tscrn->ibuf[1],(int)tscrn->ibuf[2],(int)tscrn->ibuf[3],(int)tscrn->ibuf[4],(int)tscrn->ibuf[5],(int)tscrn->ibuf[6],(int)tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - //////////////////////////////////////////////////////////////////////////////////// - /* Ok, if we detected an interrupt EP, setup a handler for it */ - if (have_intr) - { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, - usb_rcvintpipe(dev, 0x81),//endpoint[(int )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, tscrn, - endpoint[(int)(have_intr-1)].bInterval); - //2); - - if (usb_submit_urb(&tscrn->irq)) - { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - //the status will be -115 -> thist means EINPROGRESS, but it should be that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor,endpoint[(int)(have_intr-1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - //if(tscrn->intr_ep) - //{ - if(tscrn->irq.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - //} - if(tscrn->ctrlin.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) - { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn->ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree (tscrn); -} - -static struct file_operations usb_touchscreen_fops = -{ -read: read_touchscreen, - //write: write_touchscreen, -poll: poll_touchscreen, -ioctl: ioctl_touchscreen, -open: open_touchscreen, -release: close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = -{ - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - { NULL, NULL }, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init (void) -{ - if (usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.99.6/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.99.6/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.99.6/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.99.6/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.99.6/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.99.6/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.6/scripts/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.99.6/scripts/build-from-git-and-run.sh deleted file mode 100644 index 0bfe08c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/scripts/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/../build-from-git.sh" && sudo ../src/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.6/scripts/generate_drivers_header.sh b/software/gpm/browse_source/gpm-1.99.6/scripts/generate_drivers_header.sh deleted file mode 100644 index d35d941e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/scripts/generate_drivers_header.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-gpm2008 at schottelius.org) -# -# This file is part of gpm. -# -# gpm 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. -# -# gpm 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 gpm. If not, see . -# - -cd "$1" - -cat << eof -/* - * Warning: This file is autogenerated by $0. - * - * DO NOT EDIT IT, ALL CHANGES WILL BE LOST IN ANY CASE. - * - */ - -#ifndef __GPM_DRIVER_H -#define __GPM_DRIVER_H - -eof - -( - grep -h "^int M_" drivers/*/m.c - grep -h "^Gpm_Type" drivers/*/i.c - grep -h "^int R_" drivers/*/r.c -) | sed 's/$/;/' - -echo "#endif" diff --git a/software/gpm/browse_source/gpm-1.99.6/scripts/generate_drivers_makefile.sh b/software/gpm/browse_source/gpm-1.99.6/scripts/generate_drivers_makefile.sh deleted file mode 100644 index a6d03364..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/scripts/generate_drivers_makefile.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-gpm2008 at schottelius.org) -# -# This file is part of gpm. -# -# gpm 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. -# -# gpm 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 gpm. If not, see . -# - -dir="$1" - -cat << eof -# -# Warning: This file is autogenerated by $0. -# -# DO NOT EDIT IT, ALL CHANGES WILL BE LOST IN ANY CASE. -# -# - -GDRIVERS = \\ -eof - -( - cd $1 - ls drivers/*/*.c -) | sed 's/$/ \\/' - -# append an empty line -echo "" diff --git a/software/gpm/browse_source/gpm-1.99.6/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.99.6/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.6/scripts/gpm.release b/software/gpm/browse_source/gpm-1.99.6/scripts/gpm.release deleted file mode 100644 index 963e0c6d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/scripts/gpm.release +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(awk -F= '/^release=/ { print $2 }' configure.in )" -#VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo -n "=> Version: $VERSION; ok?" -read ok -#echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.6/scripts/gpm2.release b/software/gpm/browse_source/gpm-1.99.6/scripts/gpm2.release deleted file mode 100644 index c675a0e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/scripts/gpm2.release +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -if [ $# -ne 1 ]; then - echo "This is a maintainer-only script to release cinit" - echo $(basename $0): version - exit 1 -fi - -if [ ! -d .git ]; then - echo "Missing .git" - exit 1 -fi - -set -e -version_1="$1" -version_conf="$(awk -F= '/^release=/ { print $2 }' configure.in)" - -hier=${0%/*} - -echo "=> Version you want: $version_1" -echo "=> Version conf: $version_conf" - -if [ "$version_1" = "$version_conf" ]; then - echo "=> Version confirmed." -else - echo "That is not ok" - exit 1 -fi - -TAR_NAME="gpm-${version_1}.tar.bz2" -OUT_NAME="../$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "Release version $version_1 and copy to ${D_HOST}?" -echo -n "=> Continue? " -read yes - -echo "Creating bzip2 compressed tar" -#tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -"${hier}/git-archiv-tarbz2.sh" "${version_1}" - -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" - -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$TAR_NAME -C $D_SOURCE" - -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.6/scripts/release-tar.sh b/software/gpm/browse_source/gpm-1.99.6/scripts/release-tar.sh deleted file mode 100644 index 8cce41b0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/scripts/release-tar.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 20080313 - -version=$1 -hier=${0##*/} - -echo $hier - -[23:11] denkbrett:gpm% sha512sum gpm-1.20.3pre4.tar.bz2 > gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512suM -[23:12] denkbrett:gpm% chmod 0644 gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum home.schottelius.org:www/org/schottelius/unix/www/gpm/archives - - -[ "$version" ] || exit 3 - -git archive --format=tar --prefix=gpm-${version}/ HEAD | \ - tee ../gpm-${version}.tar | bzip2 -9 > ../gpm-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.6/scripts/report_success.sh b/software/gpm/browse_source/gpm-1.99.6/scripts/report_success.sh deleted file mode 100644 index ab66ae70..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/scripts/report_success.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-ccollect at schottelius.org) -# -# This file is part of ccollect. -# -# ccollect 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 3 of the License, or -# (at your option) any later version. -# -# ccollect 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 ccollect. If not, see . -# -# Sends feedback -# -# Adapted for gpm -# - -software="gpm" -author="Nico Schottelius" -subject="==> success: $software" -to="nico-gpm-success" -host="schottelius.org" -fullto="${to}@${host}" - -info="$(awk -F= '/^release=/ { print $2 }' configure.in; uname -s -v -r -m)" - - -echo "Reporting success for $software to ${author}" -echo "-----------------" -echo -n "Your name (leave free for anonymous): " -read name -echo -n "Your email (leave free for anonymous): " -read email -echo -n "Your normal gpm parameters (-m -t -o ...): " -read params -echo -n "Comment (leave free for no comment): " -read comment - -echo "" -echo "The following information will be send to ${author}:" -echo "" - -cat << eof -Name: $name (will be used to contact you and kept secret) -E-Mail: $email (will be used to contact you and kept secret) -Comment: $comment -Info: $info -Parameters: $params - -eof - -echo -n "Is it ok to send out that mail (press enter to send or ctrl-c to abort)? " -read yes - -cat << eof | mail -s "$subject" "$fullto" -Name: $name -E-Mail: $email -Comment: $comment -Info: $info -Parameters: $params -eof - -echo "Send. Thank you for your feedback." diff --git a/software/gpm/browse_source/gpm-1.99.6/src/Makefile.in b/software/gpm/browse_source/gpm-1.99.6/src/Makefile.in deleted file mode 100644 index bcc0b30f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/Makefile.in +++ /dev/null @@ -1,202 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_builddir = .. - -## INCLUDES --include Makefile.drivers.generated -include $(top_builddir)/Makefile.include - - -## SOURCE FILES - -GSRC = mice.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - gpm2/become_daemon.c \ - daemon/startup.c daemon/wait_text.c report.c - -# mouse-test and gpm -GCOMMON = generic/check_no_argv.c generic/parse_argv.c \ - generic/limit_delta.c generic/option_modem_lines.c \ - generic/setspeed.c generic/read_mouse_id.c \ - generic/m_listtypes.c generic/write_to_mouse.c \ - generic/isodigit.c generic/getsym.c \ - tools.c - -GSRC += $(GDRIVERS) -GSRC += $(GCOMMON) - -GOBJ = $(GSRC:.c=.o) - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c tools.c - -LOBJ = $(LSRC:.c=.o) @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c \ - prog/display-buttons.c prog/display-coords.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) -SRCSP= $(SRCS:.c=.P) lib/libcurses.P -OBJECTS = $(SRCS:.c=.o) - -DEFS = @DEFS@ - -STRIP = -s - -### REAL TARGETS -all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -# the prog rules are not very clean... -prog/%.o: prog/%.c - $(CC) -Iheaders @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -%.o: %.c - $(CC) -MD @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - @cp $*.d $*.P; \ - sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ - -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ - #rm -f $*.d - -%.lo: %.c - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -%: %.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -### GENERATED INCLUDES - -# FIXME: add absolute path of source files below -$(OBJECTS): headers/drivers.h - -headers/drivers.h: $(GDRIVERS) - ../scripts/generate_drivers_header.sh . > $@ - -#-include $(SRCSP) - -Makefile.drivers.generated: - ../scripts/generate_drivers_makefile.sh . > $@ - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_lev@ libgpm.so \ - && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ ;\ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ - echo "Or to update everything just type ldconfig"; \ - fi - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# Configure & unconfigure - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - -prog/mouse-test: prog/mouse-test.o mice.o prog/open_console.o \ - $(GCOMMON:.c=.o) $(GDRIVERS:.c=.o) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ \ - $(GOBJ) \ - $(LOBJ) \ - $(PICS) \ - $(POBJ) \ - $(PROG) \ - $(RDEPS) \ - $(SRCSP) \ - gpm2/* \ - core *~ prog/gpm-root.c Makefile.drivers.generated prog/open_console.o \ - headers/config.h.in~ - find . -name \*.d -exec rm {} \; - -distclean: clean - rm -f headers/config.h headers/drivers.h Makefile - -allclean: clean - rm -f headers/config.h.in - -### GPM2 integration -gpm2/become_daemon.c: $(srcdir)/../gpm2/daemon/become_daemon.c - cp $^ $@ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/add_mouse.c deleted file mode 100644 index 09f9b66b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/add_mouse.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ -/* RETURN: - */ -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* PREAMBLE for all work: */ - /* -m /dev/misc/psaux -t ps2 [ -o options ] */ - - switch(type) { - - /*---------------------------------------------------------------------*/ - /********************** -m mousedevice *********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* first invocation */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG,"adding mouse device: %s",value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* find actual mouse */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG,"finished searching"); - - /* found end of micelist, add new mouse */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG,"next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - //} else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - - break; - - /*---------------------------------------------------------------------*/ - /************************* -t type / protocol **************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* skip to next mouse, where either device or protocol is missing */ - while(tmp->device != NULL && tmp->protocol != NULL && tmp->next !=NULL) - tmp = tmp->next; - - /* check whether device (-m) is there, if so, write protocol */ - if(tmp->device == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse type: %s",value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - /*************************** -o options ********************************/ - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - - /* look for the last mouse */ - tmp = option.micelist; - while(tmp->next != NULL) tmp = tmp->next; - - /* if -m or -t are missing exit */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG,"adding mouse options: %s",value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/build_argv.c deleted file mode 100644 index 3b1ae941..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/build_argv.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - char **argv; - char *s; - - /* argv0 is never NULL, but the extra string may well be */ - if (str) - for (s=str; sep && (s = strchr(s, sep)); argc++) s++; - - argv = calloc(argc+2, sizeof(char **)); - if (!argv) gpm_report(GPM_PR_OOPS,GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if (!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* else, add arguments */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* ok, now split: the first one is in place, and s is the whole string */ - for ( ; sep && (s = strchr(s, sep)) ; argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/check_kill.c deleted file mode 100644 index 167da635..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/check_kill.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - FILE* fp = fopen(GPM_NODE_PID, "r"); - - /* if we cannot find the old pid file, leave */ - if (fp == NULL) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN, GPM_NODE_PID); - - /* else read the pid */ - if (fscanf(fp,"%d",&old_pid) != 1) - gpm_report(GPM_PR_OOPS,GPM_MESS_READ_PROB,GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG,GPM_MESS_KILLING,old_pid); - - /* first check if we run */ - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* then kill us (not directly, but the other instance ... ) */ - if (kill(old_pid,SIGTERM) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_INFO,GPM_MESS_KILLED,old_pid); - exit(0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/check_uniqueness.c deleted file mode 100644 index d9ab23ef..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if (kill(old_pid,0) == -1) { - gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS,GPM_MESS_ALREADY_RUN, old_pid); - } - /* now try to sign ourself */ - if ((fp = fopen(GPM_NODE_PID,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_NOTWRITE,GPM_NODE_PID); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/cmdline.c deleted file mode 100644 index fc9fd7b4..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/cmdline.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - int opt; - - /* initialize for the dual mouse */ - mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table+1; /* use the first */ - - while ((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': (which_mouse->opt_accel) = atoi(optarg); break; - case 'A': opt_aged++; - if (optarg) - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; - case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; - case 'h': exit(usage(NULL)); - case 'i': (which_mouse->opt_time)=atoi(optarg); break; - case 'k': check_kill(); break; - case 'l': opt_lut = optarg; break; - case 'm': add_mouse(GPM_ADD_DEVICE,optarg); - (which_mouse->opt_dev) = optarg; break; /* GO AWAY!*/ - case 'M': opt_double++; option.repeater++; - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - (which_mouse->opt_options) = optarg; break; /* GO AWAY */ - case 'p': opt_ptrdrag = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ - (which_mouse->opt_scale)=atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) (which_mouse->opt_scale)=100; /* the maximum */ - else (which_mouse->opt_scale)=100/(which_mouse->opt_scale); break; - case 'R': - option.repeater++; - if (optarg) option.repeater_type = optarg; - else option.repeater_type = "msc"; break; - case 's': (which_mouse->opt_sample) = atoi(optarg); break; - case 'S': if (optarg) opt_special = optarg; - else opt_special=""; break; - case 't': add_mouse(GPM_ADD_TYPE,optarg); - (which_mouse->opt_type) = optarg; break; /* GO AWAY */ - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); - case '2': (which_mouse->opt_three) = -1; break; - case '3': (which_mouse->opt_three) = 1; break; - default: exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/disable_paste.c deleted file mode 100644 index 5caf9de5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO,GPM_MESS_DISABLE_PASTE,vc); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/do_client.c deleted file mode 100644 index fb1fa37a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/do_client.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -{ - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; - /* value to return if event is not used */ - int res = !(info.defaultMask & event->type); - - /* instead of returning 0, scan the stack of clients */ - if ((info.minMod & event->modifiers) < info.minMod) - goto scan; - if ((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* if not managed, use default mask */ - if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) return res; - else goto scan; - } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); - write(fd,event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if (cinfo->next != 0) - return do_client (cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/do_selection.c deleted file mode 100644 index 189fc078..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/do_selection.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event *event) /* returns 0, always */ -{ - static int x1=1, y1=1, x2, y2; -#define UNPOINTER() 0 - - x2=event->x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if (event->buttons==GPM_B_LEFT) { - if (event->margin) /* fix margins */ - switch(event->margin) { - case GPM_TOP: x2=1; y2++; break; - case GPM_BOT: x2=maxx; y2--; break; - case GPM_RGT: x2--; break; - case GPM_LFT: y2<=y1 ? x2++ : (x2=maxx, y2--); break; - } - selection_copy(x1,y1,x2,y2,event->clicks); - if (event->clicks>=opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2,y2,x2,y2,3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1=x2; y1=y2; - selection_copy(x1,y1,x2,y2,event->clicks); /* start selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if ((which_mouse->opt_three)==1) - selection_copy(x1,y1,x2,y2,event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/find_mouse_by_name.c deleted file mode 100644 index cbd71a13..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - char *s; - int len = strlen(name); - - for (type=mice; type->fun; type++) { - if (!strcasecmp(name, type->name)) break; - /* otherwise, look in the synonym list */ - for (s = type->synonyms; s; s = strchr(s, ' ')) { - while (*s && isspace(*s)) s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) break;/*found*/ - } - if(s) break; /* found a synonym */ - } - if (!type->fun) return NULL; - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/get_console_size.c deleted file mode 100644 index 126ea3f4..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/get_console_size.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event *ePtr) -{ - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ - - /* before asking the new console size, save the previous values */ - prevmaxx = maxx; prevmaxy = maxy; - - i=open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if (!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col=80; win.ws_row=25; - } - maxx=win.ws_col; maxy=win.ws_row; - gpm_report(GPM_PR_DEBUG,GPM_MESS_SCREEN_SIZE,maxx,maxy); - - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley)=(which_mouse->opt_scale)*50*maxx/80/maxy; - gpm_report(GPM_PR_DEBUG,GPM_MESS_X_Y_VAL,(which_mouse->opt_scale),(which_mouse->opt_scaley)); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/get_data.c deleted file mode 100644 index 16f504d3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/get_data.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect *where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC) - gpm_report(GPM_PR_INFO,GPM_MESS_NO_MAGIC); - - if (!i) return 0; - if (check!=GPM_MAGIC) { - gpm_report(GPM_PR_INFO,GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/getmousedata.c deleted file mode 100644 index 1869020c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/getmousedata.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ -#include "mice.h" /* GPM MAGIC */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -unsigned char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - unsigned char *edata = data + type->packetlen; - int howmany=type->howmany; - int i,j; - -/*....................................... read and identify one byte */ - - if (read(fd, data, howmany)!=howmany) { - if (opt_test) exit(0); - gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if ((data[0]&((which_mouse->m_type)->proto)[0]) != ((which_mouse->m_type)->proto)[1]) { - if ((which_mouse->m_type)->getextra == 1) { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG,GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i=(which_mouse->m_type)->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); - - if (i) { - gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if ((data[1]&((which_mouse->m_type)->proto)[2]) != ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO,GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_DATA_4, data[0], data[1], data[2], data[3]); - return data; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm-killed.c deleted file mode 100644 index 7ee35f66..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm-killed.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo==SIGUSR1) { - gpm_report(GPM_PR_WARN,GPM_MESS_KILLED_BY, option.progname, getpid(), option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm.c deleted file mode 100644 index bdb30c3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "gpmInt.h" /* old daemon header */ -#include "message.h" - -#include "daemon.h" /* clean daemon header */ - -/* who the f*** runs gpm without glibc? doesn't have dietlibc __socklent_t? */ -#if !defined(__GLIBC__) - typedef unsigned int __socklen_t; -#endif /* __GLIBC__ */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; -int statusX,statusY,statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - (char *)NULL /* extra */, - -1, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, - DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (Gpm_Type *)NULL - } -}; -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut=DEF_LUT; -int opt_test=DEF_TEST; -int opt_ptrdrag=DEF_PTRDRAG; -int opt_double=0; - -char *opt_special=NULL; /* special commands, like reboot or such */ -int opt_rawrep=0; - -struct winsize win; -int maxx, maxy; -int fifofd=-1; - -int eventFlag=0; -Gpm_Cinfo *cinfo[MAX_VC+1]; - -time_t last_selection_time; -time_t opt_age_limit = 0; - - -int opt_resize=0; /* not really an option */ - - -int statusC = 0; /* clicks */ -void get_console_size(Gpm_Event *ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm_exited.c deleted file mode 100644 index 5005c924..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG,GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/init_mice.c deleted file mode 100644 index 56c66885..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/init_mice.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG,"initialize %s with proto %s",tmp->device,tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/loadlut.c deleted file mode 100644 index 528b1a2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/loadlut.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - unsigned char this, next; - static uint32_t long_array[9]={ - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - - -#define inwordLut (long_array+1) - - for (i=0; charset[i]; ) { - i += getsym((unsigned char *)charset+i, &this); - if (charset[i] == '-' && charset[i + 1] != '\0') - i += getsym((unsigned char *)charset+i+1, &next) + 1; - else - next = this; - for (c = this; c <= next; c++) - inwordLut[c>>5] |= 1 << (c&0x1F); - } - - if ((fd=open(option.consolename, O_WRONLY)) < 0) { - /* try /dev/console, if /dev/tty0 failed -- is that really senseful ??? */ - free(option.consolename); /* allocated by main */ - if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - /* FIXME: remove hardcoded device names */ - strcpy(option.consolename,GPM_SYS_CONSOLE); - - if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - if (ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if (errno==EPERM && getuid()) - gpm_report(GPM_PR_WARN,GPM_MESS_ROOT); /* why do we still continue?*/ - else if (errno==EINVAL) - gpm_report(GPM_PR_OOPS,GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/main.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/main.c deleted file mode 100644 index 93c78b41..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - - -#include "daemon.h" - -int main(int argc, char **argv) -{ - startup(argc,argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back success */ -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/old_main.c deleted file mode 100644 index 14703d52..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/old_main.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -#ifndef max -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -int realposx=-1; -int realposy=-1; - - -int old_main() -{ - int ctlfd, newfd; - struct sockaddr_un ctladdr; - int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; - Gpm_Event event; - - for (i = 1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - - if (!(which_mouse->opt_dev)) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev),"-")) fd=0; /* use stdin */ - else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - - /* and then reset the flag */ - fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); - - /* create argc and argv for this device */ - mouse_argv[i] = build_argv((which_mouse->opt_type), (which_mouse->opt_options), &mouse_argc[i], ','); - - /* init the device, and use the return value as new mouse type */ - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(fd, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if (!(which_mouse->m_type)) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); - - which_mouse->fd=fd; - maxfd=max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH,gpm_killed); /* winch can be sent if console is resized */ - -/*....................................... create your nodes */ - - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); - memset((char *)&ctladdr, 0, sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1) - gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - - /* needs to be 0777, so all users can _try_ to access gpm */ - chmod(GPM_NODE_CTL,0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd,&connSet); - - if (opt_double) FD_SET(mouse_table[2].fd,&connSet); - - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - - signal(SIGPIPE,SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet=readySet; - resetTimeout(); - if (opt_test) timeout.tv_sec=0; - - if (eventFlag) { /* an event left over by clustering */ - pending=1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd,&selSet); - } - else - while((pending=select(maxfd+1,&selSet,NULL_SET,NULL_SET,&timeout))==0){ - selSet=readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH,gpm_killed); /* reinstall handler */ - - /* and notify clients */ - for(i=0; inext) kill(ci->data.pid,SIGWINCH); - } - } - - if (pending < 0) { - if (errno==EBADF) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR,GPM_MESS_SELECT_STRING,strerror(errno)); - selSet=readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG,GPM_MESS_SELECT_TIMES,pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; - FD_SET(mouse_table[1].fd,&readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) { - FD_CLR(which_mouse->fd,&selSet); pending--; - if (processMouse(which_mouse->fd, &event, kd_mode)) - - /* pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ - if(cinfo[event.vc]) - if(!do_client(cinfo[event.vc], &event)) - if(cinfo[0]) - if(!do_client(cinfo[0], &event)) - do_selection(&event); - - - /* Same idea as above, just here for documentation - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); - */ - } - } - - /*..................... got connection, process it */ - - if (pending && FD_ISSET(ctlfd,&selSet)) { - FD_CLR(ctlfd,&selSet); pending--; - newfd=processConn(ctlfd); - if (newfd>=0) { - FD_SET(newfd,&connSet); - FD_SET(newfd,&readySet); - maxfd=max(maxfd,newfd); - } - } - - /*........................ got request */ - - /* itz 10-22-96 check _all_ clients, not just those on top! */ - for (i=0; pending && (i<=MAX_VC); i++) { - Gpm_Cinfo* ci; - for (ci = cinfo[i]; pending && ci; ci = ci->next) { - if (FD_ISSET(ci->fd,&selSet)) { - FD_CLR(ci->fd,&selSet); pending--; - /* itz Sat Sep 12 21:10:22 PDT 1998 */ - /* this code is clearly incorrect; the next highest - descriptor after the one we're closing is not necessarily - being used. Fortunately, it doesn't hurt simply to leave this - out. */ - -#ifdef NOTDEF - if ((processRequest(ci,i)==-1) && maxfd==ci->fd) maxfd--; -#else - (void)processRequest(ci,i); -#endif - } - } - } - - /*.................. look for a spare fd */ - - /* itz 10-22-96 this shouldn't happen now! */ - for (i=0; pending && i<=maxfd; i++) { - if (FD_ISSET(i,&selSet)) { - FD_CLR(i,&selSet); - pending--; - gpm_report(GPM_PR_WARN,GPM_MESS_STRANGE_DATA,i); - } - } - - /*................... all done. */ - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/open_console.c deleted file mode 100644 index edacf9d4..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/open_console.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl() */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - int maj; - int twelve = 12; -// struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if (fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if (maj != 4 && (maj < 136 || maj > 143)) { - if (ioctl(fd, TIOCLINUX, &twelve) < 0) { - /* FIXME: si.line is not initialized, but used! */ - //if (si.line > 0) { - // gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - // } - } - } - } else { - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/processconn.c deleted file mode 100644 index 7d5c86cb..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/processconn.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - - -int processConn(int fd) /* returns newfd or -1 */ -{ - Gpm_Cinfo *info; - Gpm_Connect *request; - Gpm_Cinfo *next; - int vc, newfd; -#if !defined(__GLIBC__) - int len; -#else /* __GLIBC__ */ - size_t len; /* isn't that generally defined in C ??? -- nico */ -#endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; - uid_t uid; - char *tty = NULL; - -/*....................................... Accept */ - - memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); - if ((newfd=accept(fd,(struct sockaddr *)&addr, &len))<0) { - gpm_report(GPM_PR_ERR,GPM_MESS_ACCEPT_FAILED,strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_CONECT_AT,newfd); - - info=malloc(sizeof(Gpm_Cinfo)); - if (!info) gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - request=&(info->data); - - if(get_data(request,newfd)==-1) { - free(info); - close(newfd); - return -1; - } - - if ((vc=request->vc)>MAX_VC) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } - -#ifndef SO_PEERCRED - if (stat (addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR,GPM_MESS_ADDRES_NSOCKET,addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if (statbuf.st_atime < staletime - || statbuf.st_ctime < staletime - || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET_OLD); - free (info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG,GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if (uid != 0) { - if(( tty = - malloc(strlen(option.consolename)+Gpm_cnt_digits(vc) + sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - - strncpy(tty,option.consolename,strlen(option.consolename)-1); - sprintf(&tty[strlen(option.consolename)-1],"%d",vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR,GPM_MESS_STAT_FAILS,tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if (uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN,GPM_MESS_FAILED_CONNECT, uid, tty); /*SUSPECT!*/ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; - info->fd=newfd; - cinfo[vc]=info; - gpm_report(GPM_PR_DEBUG,GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, request->defaultMask, - request->minMod, request->maxMod); - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) { - //Gpm_Event event={0, 0, vc, 0, 0, statusX, statusY, GPM_MOVE, 0, 0}; - - Gpm_Event event; - event.buttons = 0; - event.modifiers = 0; - event.vc = vc; - event.dx = 0; - event.dy = 0; - event.x = statusX; - event.y = statusY; - event.type = GPM_MOVE; - event.clicks = 0; - event.margin = 0; - event.wdx = 0; - event.wdy = 0; - - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/processmouse.c deleted file mode 100644 index 32761f67..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/processmouse.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - - -int processMouse(int fd, Gpm_Event *event, int kd_mode) -{ - unsigned char *data; - static int fine_dx, - fine_dy, - i, j, m, - newB=0, /* old buttons and Type to chain events */ - oldB=0, - oldT=0; - - static Gpm_Event nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - int tempx, tempy; - static int oldx, oldy; - - oldT = event->type; - - if(eventFlag) { - eventFlag=0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute device */ - event->x=nEvent.x; - event->y=nEvent.y; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; - event->buttons=nEvent.buttons; - } else { - event->dx=event->dy = 0; - event->wdx=event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - - /* use uncalibrated values as base values */ - if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ - nEvent.x = oldx; - nEvent.y = oldy; - } - - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { - - if (!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons&7]&7) | - (nEvent.buttons & ~7); /* change the order */ - oldB = newB; - newB = nEvent.buttons; - - if (!i) event->buttons = nEvent.buttons; - - if (oldB != newB) { - eventFlag = (i!=0)*(which_mouse-mouse_table); /* 1 or 2 */ - break; - } - - /* propagate movement */ - if (!((which_mouse->m_type)->absolute)) { /* mouse */ - if (abs(nEvent.dx)+abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx*=(which_mouse->opt_accel), nEvent.dy*=(which_mouse->opt_accel); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; - } else { /* a pen */ - /* get dx,dy to check if there has been movement */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* propagate wheel */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - - /* apply calibration */ - if((which_mouse->opt_calib != NULL) && - (which_mouse->m_type->absolute)) { - - /* save uncalibrated values for use next time around */ - oldx = nEvent.x; - oldy = nEvent.y; - - /* do calculations in a larger variable */ - tempx = nEvent.x; - tempy = nEvent.y; - tempx -= which_mouse->opt_dminx; - tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); - tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); - tempx += which_mouse->opt_ominx; - - tempy -= which_mouse->opt_dminy; - tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); - tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); - tempy += which_mouse->opt_ominy; - - nEvent.x = tempx; - nEvent.y = tempy; - - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if ((event->buttons & GPM_B_MIDDLE) && !(which_mouse->opt_three)) - (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if (kd_mode!=KD_TEXT) { - if (fifofd != -1 && ! opt_rawrep) { - if ((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) - *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) { - event->dx=0; - event->dy=0; - } - rept1=rept2; - - /* if the values are calibrated, this is not necessary */ - if(which_mouse->opt_calib==NULL) - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - - event->x=nEvent.x; - event->y=nEvent.y; - } - - /* not all relative repeaters can handle big changes, - so repackage into several smaller updates */ - if (!repeated_type->absolute) { - int remx, remy; - remx = event->dx; - remy = event->dy; - - do { - if (remx<0) { - if (remx>=-127) { - event->dx = remx; - remx = 0; - } else { - event->dx = -127; - remx += 127; - } - } - if (remx>0) { - if (remx<=127) { - event->dx = remx; - remx = 0; - } else { - event->dx = 127; - remx -= 127; - } - } - if (remy<0) { - if (remy>=-127) { - event->dy = remy; - remy = 0; - } else { - event->dy = -127; - remy += 127; - } - } - if (remy>0) { - if (remy<=127) { - event->dy = remy; - remy = 0; - } else { - event->dy = 127; - remy -= 127; - } - } - repeated_type->repeat_fun(event, fifofd); - } while((remx!= 0)||(remy!=0)); - } - else - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ - -/*....................................... no, we arent a repeater, go on */ - - /* use fine delta values now, if delta is the information */ - if (!((which_mouse->m_type))->absolute) { - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/(which_mouse->opt_scale); event->dy=fine_dy/(which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); fine_dy %= (which_mouse->opt_scaley); - } - - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - - /* rodney 13/mar/2008 wheel movement similar to mouse movement - * must also be excluded from time (click) processing */ - if (!event->dx && !event->dy - && !event->wdx && !event->wdy - && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if (time(NULL)<=awaketime) return 0; - awaketime=time(NULL)+1; - break; - } while (0); - -/*....................................... fill missing fields */ - - event->x+=event->dx, event->y+=event->dy; - statusB=event->buttons; - - i=open_console(O_RDONLY); - /* modifiers */ - j = event->modifiers; /* save them */ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* status */ - j = stat.v_active; - if (ioctl(i,VT_GETSTATE,&stat)<0) gpm_report(GPM_PR_OOPS,GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if (stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if (oldB==event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - - /* check first click */ - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<(which_mouse->opt_time))) { - statusC++; - statusC%=3; /* 0, 1 or 2 */ - } - else - statusC=0; - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ - event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<clicks=statusC; - -/* UGLY - FIXME! */ -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - - /* selection used 1-based coordinates, so do I */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type&(GPM_DRAG|GPM_UP))!=0); /* i is boolean */ - - if (event->y>win.ws_row) {event->y=win.ws_row+1-!i; i=0; m = GPM_BOT;} - else if (event->y<=0) {event->y=1-i; i=0; m = GPM_TOP;} - - if (event->x>win.ws_col) {event->x=win.ws_col+1-!i; if (!m) m = GPM_RGT;} - else if (event->x<=0) {event->x=1-i; if (!m) m = GPM_LFT;} - - event->margin=m; - - gpm_report(GPM_PR_DEBUG,"dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx,event->dy, - event->x,event->y, - event->buttons, event->vc, - event->clicks); - - /* update the global state */ - statusX=event->x; - statusY=event->y; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/processrequest.c deleted file mode 100644 index 2a48f7bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/processrequest.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - - - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - - -int processRequest(Gpm_Cinfo *ci, int vc) -{ - int i; - Gpm_Cinfo *cinfoPtr; - Gpm_Cinfo *next; - Gpm_Connect conn; - static Gpm_Event event; - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if (vc>MAX_VC) return -1; - - /* itz 10-22-96 this shouldn't happen now */ - if (vc==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i=get_data(&conn,ci->fd); - - if (!i) { /* no data */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd,&connSet); - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* somewhere inside the stack, have to walk it */ - cinfoPtr = cinfo[vc]; - while (cinfoPtr && cinfoPtr->next) { - if (cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free (next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } /* not data */ - - if (i == -1) return -1; /* too few bytes */ - - if (conn.pid!=0) { - ci->data = conn; - return 0; - } - - /* Aha, request for information (so-called snapshot) */ - switch(conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i,VT_GETSTATE,&stat); - event.modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event.modifiers))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - /* missing break or do you want this ??? */ - - case GPM_REQ_BUTTONS: - event.type= ((which_mouse->opt_three)==1 ? 3 : 2); /* buttons */ - write(ci->fd,&event,sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/processspecial.c deleted file mode 100644 index 906fc9f9..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/processspecial.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include /* for OPEN_MAX */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpmInt.h" -#include "daemon.h" /* daemon internals */ - - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL=NULL; /* kill init */ -static char *commandM="shutdown -h now"; -static char *commandR="shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event *event) -{ - char *command=NULL; int i; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT|GPM_B_RIGHT))) /* trigger */ - special_status=time(NULL); - - if (!special_status) /* not triggered: return */ - return 1; - - /* devfs change */ - consolef=fopen(option.consolename,"w"); - if (!consolef) consolef=stderr; - if (event->type & GPM_TRIPLE) /* just triggered: make noise and return */ - { - if (!did_parse) - { - did_parse++; - if (opt_special && opt_special[0]) /* not empty */ - { - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if (commandM) - { - *commandM='\0'; commandM++; - commandR = strchr(commandM, ':'); - if (commandR) - { *commandR='\0'; commandR++; } - } - } - } - fprintf(consolef,"\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef,"gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - - if (time(NULL) > special_status+3) - { - fprintf(consolef,"\n%s: timeout: no special command taken\n", option.progname); - if (consolef!=stderr) fclose(consolef); - special_status=0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status=0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef,"going to run: buttons is %i\n",event->buttons); -#endif - switch(event->buttons) - { - case GPM_B_LEFT: command=commandL; break; - case GPM_B_MIDDLE: command=commandM; break; - case GPM_B_RIGHT: command=commandR; break; - default: - fprintf(consolef,"\n%s: more than one button: " - "special command discarded\n",option.progname); - if (consolef!=stderr) fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef,"\n%s: executing ", option.progname); - - if (!command || !command[0]) - { - fprintf(consolef,"hard reboot (by signalling init)\n"); - if (consolef!=stderr) fclose(consolef); - kill(1,2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef,"\"%s\"\n",command); - if (consolef!=stderr) fclose(consolef); - - switch(fork()) - { - case -1: /* error */ - fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); close(1); close(2); - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;i - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG,"reset: %s with proto %s",end->device,end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG,"and options %s",end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/selection_copy.c deleted file mode 100644 index 53f7af31..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/selection_copy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6*sizeof(short)]; - unsigned short *arg = (unsigned short *)buf + 1; - int fd; - - buf[sizeof(short)-1] = 2; /* set selection */ - - arg[0]=(unsigned short)x1; - arg[1]=(unsigned short)y1; - arg[2]=(unsigned short)x2; - arg[3]=(unsigned short)y2; - arg[4]=(unsigned short)mode; - - if ((fd=open_console(O_WRONLY))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - /* FIXME: should be replaced with string constant (message.h) */ - gpm_report(GPM_PR_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); - if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if (mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/selection_paste.c deleted file mode 100644 index 31dfd52a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/selection_paste.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c=3; - int fd; - - if (!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if (opt_aged) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_PASTE); - return; - } - - fd=open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/startup.c deleted file mode 100644 index 81ef424c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/startup.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" -#include "gpm2-import.h" - -void startup(int argc, char **argv) -{ - int i, opt; - FILE* calib_file; - - static struct { - char *in; - char *out; - } seq[] = { - {"123","01234567"}, - {"132","02134657"}, - {"213","01452367"}, /* warning: these must be readable as integers... */ - {"231","02461357"}, - {"312","04152637"}, - {"321","04261537"}, - {NULL,NULL} - }; - - /* log to debug, who we are */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_VERSION); - - /* basic settings */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* basic2: are not necessary for oops()ing, if not root */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - - cmdline(argc, argv); /* parse command line */ - - if (geteuid() != 0) gpm_report(GPM_PR_OOPS,GPM_MESS_ROOT); /* root or exit */ - - /* Planned for gpm-1.30, but only with devfs */ - /* if(option.autodetect) autodetect(); */ - - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if (option.repeater) { - if(mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) - gpm_report(GPM_PR_OOPS,GPM_MESS_CREATE_FIFO,GPM_NODE_FIFO); - if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* duplicate initialization */ - for (i=1; i <= 1+opt_double; i++) { - which_mouse=mouse_table+i; /* used to access options */ - if ((which_mouse->opt_accel) < 1) exit(usage("acceleration")); - if ((which_mouse->opt_delta) < 2) exit(usage("delta")); - if (strlen((which_mouse->opt_sequence)) != 3 || atoi((which_mouse->opt_sequence))<100) - exit(usage("sequence")); - if ((which_mouse->opt_glidepoint_tap) > 3) exit(usage("glidepoint tap button")); - if ((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap)=GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap)-1); - - /* choose the sequence */ - for (opt=0; seq[opt].in && strcmp(seq[opt].in,(which_mouse->opt_sequence)); opt++) ; - if(!seq[opt].in) exit(usage("button sequence")); - (which_mouse->opt_sequence)=strdup(seq[opt].out); /* I can rewrite on it */ - - /* look for the mouse type */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - if (which_mouse->opt_calib!=NULL) { - calib_file = fopen(which_mouse->opt_calib,"r"); - if (calib_file) { - if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", - &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, - &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) - which_mouse->opt_calib = NULL; - if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| - (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| - (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| - (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) - which_mouse->opt_calib = NULL; - } - fclose(calib_file); - } - } - - /* Check repeater status */ - if (option.repeater) { - if (strcmp(option.repeater_type,"raw") == 0) - opt_rawrep = 1; - else { - /* look for the type */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) exit(M_listTypes()); /* not found */ - - if (!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_REPEAT,option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ - if(!become_daemon()) { - gpm_report(GPM_PR_OOPS, GPM_MESS_FORK_FAILED); - } - } - option.run_status = GPM_RUN_DAEMON; - - /* damon init: check whether we run or not, display message */ - check_uniqueness(); - gpm_report(GPM_PR_INFO,GPM_MESS_STARTED); - - //return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/usage.c deleted file mode 100644 index d6b8f65a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if (whofailed) { - gpm_report(GPM_PR_ERR,GPM_MESS_SPEC_ERR,whofailed,option.progname); - return 1; - } - printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT,DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.99.6/src/daemon/wait_text.c deleted file mode 100644 index 43a37e97..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/daemon/wait_text.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - int kd_mode; - - close(*fdptr); - do - { - sleep(2); - fd = open_console(O_RDONLY); - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while (kd_mode != KD_TEXT); - - /* reopen, reinit (the function is only used if we have one mouse device) */ - if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0) - gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,(which_mouse->opt_dev)); - if ((which_mouse->m_type)->init) - (which_mouse->m_type)=((which_mouse->m_type)->init)(*fdptr, (which_mouse->m_type)->flags, (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/README b/software/gpm/browse_source/gpm-1.99.6/src/drivers/README deleted file mode 100644 index 957c5b56..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/README +++ /dev/null @@ -1,32 +0,0 @@ -Write definiton of I_*, M_* and R_* in one line (needed by ./scripts/generate_drivers_header.sh). - - -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/bare/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/bare/m.c deleted file mode 100644 index 6bd336b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/bare/m.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_bare(Gpm_Event *state, unsigned char *data) -{ - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/bm/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/bm/m.c deleted file mode 100644 index a3ade9cf..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/bm/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/brw/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/brw/m.c deleted file mode 100644 index 9a85b3c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/brw/m.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "mice.h" /* Gpm_type */ -#include "message.h" /* messaging */ - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -int M_brw(Gpm_Event *state, unsigned char *data) -{ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| - ((data[1]&0xC0) != 0x00)|| - ((data[2]&0xC0) != 0x00)|| - ((data[3]&0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG,GPM_MESS_SKIP_DATAP,data[0],data[1],data[2],data[3]); - return -1; - } - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus/i.c deleted file mode 100644 index 36439e61..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus/i.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice stuff */ -#include "daemon.h" /* which_mouse */ -#include "drivers.h" /* I_serial */ - - -Gpm_Type *I_calus(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - if (check_no_argv(argc, argv)) return NULL; - - if ((which_mouse->opt_baud) == 1200) (which_mouse->opt_baud)=9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus/m.c deleted file mode 100644 index 68e84dd3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus/m.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* win */ -#include "mice.h" /* realposy */ - - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -int M_calus(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = 0; state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 - : (long)(x-CAL_X_MIN) * (long)(win.ws_col-1) / CAL_X_SIZE+2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long)(x-CAL_X_MIN) * (long)(16382) / CAL_X_SIZE+2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long)(CAL_Y_MAX-y) * (long)16383 / CAL_Y_SIZE + 1; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus_rel/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus_rel/m.c deleted file mode 100644 index e35e5b4e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/calus_rel/m.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* abs */ - - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -int M_calus_rel(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - - x = ((data[1] & 0x3F)<<7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F)<<7) | (data[5] & 0x7F); - - if (ox==-1 || abs(x-ox)>CAL_LIMIT_BRK || abs(y-oy)>CAL_LIMIT_BRK) { - ox=x; oy=y; - } - - state->buttons = GPM_B_LEFT * ((data[0]>>2) & 1) - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; - ox=x; oy=y; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/empty/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/empty/i.c deleted file mode 100644 index d7608d40..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/empty/i.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ - - -Gpm_Type* I_empty(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - /* FIXME: remove unecessary init, but make gcc happy: warning: unused parameter ‘fd’ */ - fd = 0; - flags = 0; - if(check_no_argv(argc, argv)) return NULL; - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/etouch.h b/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/etouch.h deleted file mode 100644 index da4a235c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/etouch.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_DRV_ETOUCH -#define _GPM_DRV_ETOUCH - -extern int elo_click_ontouch; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/i.c deleted file mode 100644 index 92bc6b0f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/i.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ - -#include "types.h" /* Gpm_type */ -#include "etouch.h" /* etouch specs */ -#include "message.h" /* reporting */ -#include "mice.h" /* parse_argv */ -#include "daemon.h" /* options */ - -extern int gunze_calib[4]; /* FIXME: do not depend on other drivers! */ - -/* simple initialization for the elo touchscreen */ -Gpm_Type *I_etouch(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, - calibok = 0; - - flags = 0; /* FIXME: unused */ - - /* Calibration config file (copied from I_gunze, below :) */ - #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, - {"", ARGV_END, u: {iptr: &elo_click_ontouch}, value:0 } - }; - parse_argv(optioninfo, argc, argv); - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); - /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/m.c deleted file mode 100644 index 50f250ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/etouch/m.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "etouch.h" /* etouch specs */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse */ - -int elo_click_ontouch = 0; /* the bigger the smoother */ - -extern int gunze_calib[4]; /* FIXME: do not depend on other drivers! */ - -int M_etouch(Gpm_Event *state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch - else first Move then Touch*/ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[2]&0x04) /* FINGER UP - Release */ - { upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx=-1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* NOW WE HAVe FINGER DOWN */ - x = data[3] | (data[4]<<8); x&=0xfff; - y = data[5] | (data[6]<<8); x&=0xfff; - x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ - { GET_TIME(tv); - state->buttons = 0; - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) - { /* if Initial Touch immediate after finger UP then start DRAG */ - x=upx; y=upy; /* A:start DRAG at finger-UP position */ - if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; - } - else /* 1:MOVE to Initial Touch position */ - { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ - if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ - } - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - return 0; - } /* endof INITIAL TOUCH */ - - - state->buttons = 0; /* Motion event */ - if (tv.tv_sec) /* draging or elo_click_ontouch */ - { state->buttons = GPM_B_LEFT; - if (elo_click_ontouch) - { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ - y=avgy=upy; - tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/evabs/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/evabs/m.c deleted file mode 100644 index 7d0c46e8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/evabs/m.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -#include /* FIXME: Linux specific: thisevent */ -#include /* memcpy */ - - -#ifdef HAVE_LINUX_INPUT_H -int M_evabs (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_ABS) { - if (thisevent.code == ABS_X) - state->x = thisevent.value; - else if (thisevent.code == ABS_Y) - state->y = thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/evdev/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/evdev/m.c deleted file mode 100644 index 1a52c45b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/evdev/m.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* FIXME: Linux specific: thisevent */ -#include /* memcpy */ - -#include "types.h" /* Gpm_type */ - - -#ifdef HAVE_LINUX_INPUT_H - -int M_evdev (Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - (void) memcpy (&thisevent, data, sizeof (struct input_event)); - if (thisevent.type == EV_REL) { - if (thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if (thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if (thisevent.type == EV_KEY) { - switch(thisevent.code) { - case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; - case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; - case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; - case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; - } - } - return 0; -} - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/exps2/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/exps2/i.c deleted file mode 100644 index 92e7ddb8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/exps2/i.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - - -#include /* usleep, write */ -#include /* tcflush */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - flags = 0; /* FIXME: 1.99.13 */ - - if (check_no_argv(argc, argv)) return NULL; - - write(fd, s1, sizeof (s1)); - usleep(30000); - tcflush(fd, TCIFLUSH); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/geni/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/geni/m.c deleted file mode 100644 index fc86edc5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/geni/m.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -#include "daemon.h" /* daemon internals */ - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -int M_geni(Gpm_Event *state, unsigned char *data) -{ - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if - * we use the puck we have four buttons. (And the - * protocol is a little mangled if several of the buttons - * on the puck are pressed simultaneously. - * I don't use the puck, hence I try to decode three buttons - * only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01)<<2 | - (data[0] & 0x02) | - (data[0] & 0x04)>>2; - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/gunze/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/gunze/i.c deleted file mode 100644 index b1412a50..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/gunze/i.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include "types.h" /* Gpm_type */ -#include "mice.h" /* ‘parse_argv’ */ -#include "daemon.h" /* ‘which_mouse’ */ -#include "message.h" /* gpm_report */ - -/* from m.c */ -extern int gunze_avg; -extern int gunze_calib[4]; -extern int gunze_debounce; - - -/* simple initialization for the gunze touchscreen */ -Gpm_Type *I_gunze(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - FILE *f; - char s[80]; - int i, calibok = 0; - - flags = 0; /* FIXME: 1.99.13 */ - - - #define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* accept a few options */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr: &gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr: &gunze_debounce}}, - /* FIXME: add corner tapping */ - {"", ARGV_END, u: {iptr: &gunze_avg}} - }; - parse_argv(optioninfo, argc, argv); - - /* check that the baud rate is valid */ - if ((which_mouse->opt_baud) == DEF_BAUD) (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if ((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_WRONG_BAUD,option.progname, argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = ((which_mouse->opt_baud) == 9600 ? B9600 : B19200) |CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* FIXME: try to find some information about the device */ - - /* retrieve calibration, if not existent, use defaults (uncalib) */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if (f) { - fgets(s, 80, f); /* discard the comment */ - if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, - gunze_calib+2, gunze_calib+3) == 4) - calibok = 1; - /* Hmm... check */ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; - if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - gpm_report(GPM_PR_ERR,GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/gunze/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/gunze/m.c deleted file mode 100644 index 99cb656d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/gunze/m.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "message.h" /* gpm_report */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse */ - - -int gunze_avg = 9; /* the bigger the smoother */ -int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ -int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -int M_gunze(Gpm_Event *state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - static int avgx, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static int released = 0, dragging = 0; - static struct timeval uptv, tv; /* time of last up, and down events */ - int timediff; - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released=1; - return 0; - } - - if(sscanf((char *)data+1, "%d, %d", &x, &y) != 2) { - gpm_report(GPM_PR_INFO,GPM_MESS_GUNZE_INV_PACK,data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); - - /* range is 0-1023, rescale it upwards (0-REALPOS_MAX) */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; - if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if (released) { /* press event -- or just bounce*/ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if (timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if (timediff <= gunze_debounce) { - /* just a bounce, invalidate offset, leave dragging alone */ - upx = upy = 0; - } else { - /* else, count as a new motion event, reset avg */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if (dragging) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x)/(gunze_avg+1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y)/(gunze_avg+1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/header.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/header.c deleted file mode 100644 index e11a8ad3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/header.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/i.c deleted file mode 100644 index 30e4f335..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/i.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include -#include /* NULL */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* GPM_AUX_ENABLE_DEV */ -#include "message.h" /* messaging */ -#include "daemon.h" /* mice */ - - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -/* Autodetect: Steve Bennett */ -Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; - static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - - /* Do a basic init in case the mouse is confused */ - write_to_mouse(fd, basic_init, sizeof (basic_init)); - - /* Now try again and make sure we have a PS/2 mouse */ - if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_INIT); - return(NULL); - } - - /* Try to switch to 3 button mode */ - if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_FAILED); - return(NULL); - } - - /* Read the mouse id */ - id = read_mouse_id(fd); - if (id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* And do the real initialisation */ - if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_SETUP_FAIL); - } - - if (id == GPM_AUX_ID_IMPS2) { - /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ - gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_AUTO); - return type; - } - if (id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR,GPM_MESS_IMPS2_BAD_ID, id); - } - else gpm_report(GPM_PR_INFO,GPM_MESS_IMPS2_PS2); - - for (type=mice; type->fun; type++) - if (strcmp(type->name, "ps2") == 0) return(type); - - /* ps2 was not found!!! */ - return(NULL); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/m.c deleted file mode 100644 index 022f0ad1..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/m.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ - - -int M_imps2(Gpm_Event *state, unsigned char *data) -{ - - static int tap_active=0; /* there exist glidepoint ps2 mice */ - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons= ((data[0] & 1) << 2) /* left */ - | ((data[0] & 6) >> 1); /* middle and right */ - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) // by default this is false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - } - - /* Standard movement.. */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ - unsigned char wheel = data[3] & 0x0f; - if (wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* rodney 13/mar/2008 - * The use of GPM_B_UP / GPM_B_DOWN is very unclear; - * only mouse type ms3 uses these - * For this mouse, we only support the relative movement - * i.e. no button is set (same as mouse movement), wdy changes +/- - * according to wheel movement (+ for rolling away from user) - * wdx (horizontal scroll) is for a second wheel. They do exist! */ - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - } - } - - return 0; - -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/r.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/r.c deleted file mode 100644 index 2403b7ca..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/imps2/r.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - -int R_imps2(Gpm_Event *state, int fd) -{ - signed char buffer[4]; - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if (state->wdy > 0) buffer[3] = 0xff; - if (state->wdy < 0) buffer[3] = 0x01; - if (state->wdx > 0) buffer[3] = 0xfe; - if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/js/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/js/m.c deleted file mode 100644 index 10374b00..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/js/m.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ - -#ifdef HAVE_LINUX_JOYSTICK_H -/* Joystick mouse emulation (David Given) */ -int M_js(Gpm_Event *state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; - static int centery = 0; - static int oldbuttons = 0; - static int count = 0; - int dx; - int dy; - - count++; - if (count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if (centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if (dx > 0) state->dx = dx * dx; - else state->dx = -(dx * dx); - state->dx >>= 2; - - if (dy > 0) state->dy = dy * dy; - else state->dy = -(dy * dy); - state->dy >>= 2; - - /* Prevent pointer drift. (PC joysticks are notoriously inaccurate.) */ - - if ((state->dx >= -1) && (state->dx <= 1)) state->dx = 0; - if ((state->dy >= -1) && (state->dy <= 1)) state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/logi/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/logi/i.c deleted file mode 100644 index 06eb055f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/logi/i.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* fstat */ -#include /* termios */ -#include /* usleep, write */ -#include /* FIXME: Linux specific: MAJOR */ - - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ -#include "daemon.h" /* which_mouse */ - -struct { - int sample; - char code[2]; -} sampletab[]={ - { 0,"O"}, - { 15,"J"}, - { 27,"K"}, - { 42,"L"}, - { 60,"R"}, - { 85,"M"}, - {125,"Q"}, - {1E9,"N"}, - }; - - -Gpm_Type* I_logi(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int i; - struct stat buf; - int busmouse; - - if (check_no_argv(argc, argv)) return NULL; - - /* is this a serial- or a bus- mouse? */ - if(fstat(fd,&buf)==-1) gpm_report(GPM_PR_OOPS, GPM_MESS_FSTAT); - i=MAJOR(buf.st_rdev); - - /* I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device - * exists must be clear before. Not here. */ - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse = (i != (int) MAJOR(buf.st_rdev)); - - /* fix the howmany field, so that serial mice have 1, while busmice have 3 */ - type->howmany = busmouse ? 3 : 1; - - /* change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */, flags); - - /* this stuff is peculiar of logitech mice, also for the serial ones */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write */, - CS8 |PARENB |PARODD |CREAD |CLOCAL |HUPCL); - - /* configure the sample rate */ - for (i=0;(which_mouse->opt_sample)<=sampletab[i].sample;i++) ; - write(fd,sampletab[i].code,1); - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/logi/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/logi/m.c deleted file mode 100644 index 424163c5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/logi/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/logimsc/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/logimsc/m.c deleted file mode 100644 index bb5440d9..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/logimsc/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/mm/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/mm/m.c deleted file mode 100644 index b6b0f120..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/mm/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_mm(Gpm_Event *state, unsigned char *data) -{ - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/mman/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/mman/m.c deleted file mode 100644 index e5fd1513..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/mman/m.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice */ -#include "daemon.h" /* which_mouse */ - - -int M_mman(Gpm_Event *state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ - unsigned char b = (*data>>4); - - if(data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) { - /* got unexpected fourth byte */ - if (b > 0x3) return -1; /* just a sanity check */ - //if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx=state->dy=0; - - mytype->packetlen=4; - mytype->getextra=0; - } - else { - /* got 3/4, as expected */ - - /* motion is independent of packetlen... */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } - - if(mytype->packetlen==4) { - if(b == 0) { - mytype->packetlen=3; - mytype->getextra=1; - } else { - if (b & 0x2) prev |= GPM_B_MIDDLE; - if (b & 0x1) prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons=prev; - - /* This "chord-middle" behaviour was reported by David A. van Leeuwen */ - if (((prev^state->buttons) & GPM_B_BOTH)==GPM_B_BOTH ) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev=state->buttons; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms/m.c deleted file mode 100644 index 04a8e42d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms/m.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int M_ms(Gpm_Event *state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms3/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms3/m.c deleted file mode 100644 index a2b32d18..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms3/m.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -int M_ms3(Gpm_Event *state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4) /* right */ - | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms3/r.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms3/r.c deleted file mode 100644 index 9c8f64c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms3/r.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int R_ms3(Gpm_Event *state, int fd) -{ - - int dx, dy; - char buf[4] = {0, 0, 0, 0}; - - buf[0] |= 0x40; - - if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; - if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; - if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; - if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; - if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* wheel */ - if (state->wdy > 0) buf[3] |= 0x0f; - else if (state->wdy < 0) buf[3] |= 0x01; - - return write(fd,buf,4); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms_plus/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms_plus/m.c deleted file mode 100644 index 91cc7aaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms_plus/m.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int M_ms_plus(Gpm_Event *state, unsigned char *data) -{ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0) &&(state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ - - prev=state->buttons; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms_plus_lr/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms_plus_lr/m.c deleted file mode 100644 index efd21da0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ms_plus_lr/m.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* Allow motion *and* button change (Michael Plass) */ - - if((state->dx==0)&& (state->dy==0) && (state->buttons==(prev&~GPM_B_MIDDLE))) - state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ - else - state->buttons |= prev&GPM_B_MIDDLE;/* change: preserve middle */ - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ - - if (!((~state->buttons)&(GPM_B_LEFT|GPM_B_RIGHT)) && - ((~prev)&(GPM_B_LEFT|GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev=state->buttons; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/msc/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/msc/m.c deleted file mode 100644 index c1c12e64..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/msc/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_msc(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/msc/r.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/msc/r.c deleted file mode 100644 index 1071951c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/msc/r.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - -int R_msc(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - int dx, dy; - - /* sluggish... */ - buffer[0]=(state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx/2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy/2); - return write(fd,buffer,5); - -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/mtouch/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/mtouch/i.c deleted file mode 100644 index 956b9d89..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/mtouch/i.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* NULL */ - -#include /* usleep, write */ -#include /* termios */ - -#include "types.h" /* Gpm_type */ - - -Gpm_Type *I_mtouch(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - - /* Turn it to "format tablet" and "mode stream" */ - write(fd,"\001MS\r\n\001FT\r\n",10); - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/mtouch/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/mtouch/m.c deleted file mode 100644 index ff4e97e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/mtouch/m.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice */ -#include "daemon.h" /* which_mouse */ - -int M_mtouch(Gpm_Event *state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - static int avgx=-1, avgy; /* average over time, for smooth feeling */ - static int upx, upy; /* keep track of last finger-up place */ - static struct timeval uptv, tv; /* time of last up, and down events */ - - #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) - #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!(data[0]&0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx=-1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2]<<7); - y = 0x3FFF - (data[3] | (data[4]<<7)); - - if (avgx < 0) { /* press event */ - GET_TIME(tv); - if (DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* count as button press placed at finger-up pixel */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - /* else, count as a new motion event */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if (tv.tv_sec) { /* a drag event: use position relative to press */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); - - return 0; - - #undef REAL_TO_XCELL - #undef REAL_TO_YCELL - #undef GET_TIME - #undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ncr/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ncr/m.c deleted file mode 100644 index 3637a87a..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ncr/m.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - - - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* win */ - - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -int M_ncr(Gpm_Event *state, unsigned char *data) -{ - int x,y; - - state->buttons= (data[0]&1)*GPM_B_LEFT + - !!(data[0]&2)*GPM_B_RIGHT; - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; - - /* these formulaes may look curious, but this is the way it works!!! */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col+1 - : (long)(x-NCR_LEFT_X) * (long)(win.ws_col-1) / NCR_DELTA_X+2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 - : (long)(x-NCR_LEFT_X) * (long)(16382) / NCR_DELTA_X+2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 - : (long)(NCR_TOP_Y-y) * (long)16383 / NCR_DELTA_Y + 1; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/netmouse/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/netmouse/i.c deleted file mode 100644 index 82b07f54..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/netmouse/i.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ - - -Gpm_Type *I_netmouse(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - flags = 0; /* FIXME: 1.99.13 */ - - if (check_no_argv(argc, argv)) return NULL; - for (i=0; i<6; i++) { - unsigned char c = 0; - write( fd, magic+i, 1 ); - read( fd, &c, 1 ); - if (c != 0xfa) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_NO_ACK,c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read( fd, rep, 1 ); - read( fd, rep+1, 1 ); - read( fd, rep+2, 1 ); - if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR,GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], rep[2]); - return NULL; - } - } - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/netmouse/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/netmouse/m.c deleted file mode 100644 index afe0ec46..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/netmouse/m.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_netmouse(Gpm_Event *state, unsigned char *data) -{ - /* Avoid these beasts if you can. They connect to normal PS/2 port, - * but their protocol is one byte longer... So if you have notebook - * (like me) with internal PS/2 mouse, it will not work - * together. They have four buttons, but two middle buttons can not - * be pressed simultaneously, and two middle buttons do not send - * 'up' events (however, they autorepeat...) - - * Still, you might want to run this mouse in plain PS/2 mode - - * where it behaves correctly except that middle 2 buttons do - * nothing. - - * Protocol is - * 3 bytes like normal PS/2 - * 4th byte: 0xff button 'down', 0x01 button 'up' - * [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - - * Pavel Machek - */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/pnp/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/pnp/i.c deleted file mode 100644 index ba031db8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/pnp/i.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* option_modem_lines */ - - -Gpm_Type *I_pnp(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/i.c deleted file mode 100644 index 62fed32e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/i.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* termios */ - -#include "types.h" /* Gpm_type */ - -/* standard ps2 */ -Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - write (fd, s, sizeof (s)); - usleep (30000); - tcflush (fd, TCIFLUSH); - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/m.c deleted file mode 100644 index 937b6f89..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/m.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ - - -int M_ps2(Gpm_Event *state, unsigned char *data) -{ - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - if (data[0]==0 && (which_mouse->opt_glidepoint_tap)) /* by default this is false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but - * working around it only causes artifacts when the actual report is -256; - * they'll be treated as zero. This should be rare if the mouse sampling - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/r.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/r.c deleted file mode 100644 index 9f2590c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/ps2/r.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - - -/* ps2 */ -int R_ps2(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]=((state->buttons & GPM_B_LEFT ) > 0)*1 + - ((state->buttons & GPM_B_RIGHT ) > 0)*2 + - ((state->buttons & GPM_B_MIDDLE) > 0)*4; - buffer[0] |= 8 + - ((state->dx < 0) ? 0x10 : 0) + - ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd,buffer,3); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/serial/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/serial/i.c deleted file mode 100644 index 2f4c38a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/serial/i.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* select */ -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ -#include "drivers.h" /* other drivers */ -#include "daemon.h" /* which_mouse */ -#include "synaptics.h" /* synaptics support */ - - - -Gpm_Type* I_serial(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - int i; - unsigned char c; - fd_set set; - struct timeval timeout={0,0}; /* used when not debugging */ - - /* accept "-o dtr", "-o rts" and "-o both" */ - if (option_modem_lines(fd, argc, argv)) return NULL; - -#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) { - FD_SET(fd,&set); - switch(select(fd+1,&set,(fd_set *)NULL,(fd_set *)NULL,&timeout/*zero*/)){ - case 1: if (read(fd,&c,1)==0) break; - case -1: continue; - } - break; - } - - if (type->fun==M_logimsc) write(fd, "QU", 2 ); - -#if 0 /* Did this ever work? -- I don't know, but should we not remove it, - * if it doesn't work ??? -- Nico */ - if (type->fun==M_ms && i==2 && c==0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO,GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -#endif -#endif - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if (type->fun==M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun==M_geni) { - gpm_report(GPM_PR_INFO,GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":" ,1); - write(fd, "E" ,1); /* setup tablet. relative mode, resolution... */ - write(fd, "@" ,1); /* setup tablet. relative mode, resolution... */ - } - - if (type->fun==M_synaptics_serial) { - int packet_length; - - setspeed (fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init (fd); - setspeed (fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if (type->fun==M_vsxxx_aa) { - setspeed (fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* a mouse does not send a bytestream */ - } - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/i.c deleted file mode 100644 index dfff8d70..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/i.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* select */ -#include /* termios */ -#include /* string */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* setspeed */ - -extern int SUMMA_BORDER; -extern int summamaxx; -extern int summamaxy; -extern signed char summaid; - - -Gpm_Type *I_summa(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - void resetsumma() - { - write(fd,0,1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() - { - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return(err); - } - int err; - char buffer[255]; - char config[5]; - /* Summasketchtablet (from xf86summa.o: thanks to Steven Lang )*/ - #define SS_PROMPT_MODE "B" /* Prompt mode */ - #define SS_FIRMID "z?" /* Request firmware ID string */ - #define SS_500LPI "h" /* 500 lines per inch */ - #define SS_READCONFIG "a" - #define SS_ABSOLUTE "F" /* Absolute Mode */ - #define SS_TABID0 "0" /* Tablet ID 0 */ - #define SS_UPPER_ORIGIN "b" /* Origin upper left */ - #define SS_BINARY_FMT "zb" /* Binary reporting */ - #define SS_STREAM_MODE "@" /* Stream mode */ - /* Geniustablet (hisketch.txt)*/ - #define GEN_MMSERIES ":" - char GEN_MODELL=0x7f; - - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if (strstr(type->name,"acecad")!=NULL) summaid=11; - - if (summaid<0) { /* Summagraphics test */ - /* read the Summa Firm-ID */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err=waitsumma(); - if (!((err == -1) || (!err))) { - summaid=10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if (summaid<0) { /* Genius-test */ - resetsumma(); - write(fd,GEN_MMSERIES,1); - write(fd,&GEN_MODELL,1); /* Read modell */ - err=waitsumma(); - if (!((err == -1) || (!err))) { /* read Genius-ID */ - err=waitsumma(); - if (!((err == -1) || (!err))) { - err=waitsumma(); - if (!((err == -1) || (!err))) { - read(fd,&config,1); - summaid=(config[0] & 224) >> 5; /* genius tablet-id (0-7)*/ - } - } - } - } /* end of Geniustablet-test */ - - /* unknown tablet ?*/ - if ((summaid<0) || (summaid==11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* read tablet size */ - err=waitsumma(); - if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer)); - write(fd,SS_READCONFIG,1); - read(fd,&config,5); - summamaxx=(config[2]<<7 | config[1])-(SUMMA_BORDER*2); - summamaxy=(config[4]<<7 | config[3])-(SUMMA_BORDER*2); - - write(fd,SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN,3); - if (summaid<0) write(fd,SS_500LPI SS_TABID0 SS_BINARY_FMT,4); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/m.c deleted file mode 100644 index 84a21daf..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/m.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse / win */ - - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ -/* Summagraphics MM-Series format*/ -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER=100, - summamaxx, - summamaxy; -signed char summaid=-1; - - -int M_summa(Gpm_Event *state, unsigned char *data) -{ - int x, y; - - x = ((data[2]<<7) | data[1])-SUMMA_BORDER; - if (x<0) x=0; - if (x>summamaxx) x=summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4]<<7) | data[3])-SUMMA_BORDER; - if (y<0) y=0; if (y>summamaxy) y=summamaxy; - state->y = 1 + y * (win.ws_row-1)/summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + - !!(data[0]&4) * GPM_B_MIDDLE; - - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/r.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/r.c deleted file mode 100644 index 6d65eb57..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/summa/r.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ - - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -int R_summa(Gpm_Event *state, int fd) -{ - signed char buffer[5]; - static int x,y; - - if (realposx==-1) { /* real absolute device? */ - x=x+(state->dx*25); if (x<0) x=0; if (x>16383) x=16383; - y=y+(state->dy*25); if (y<0) y=0; if (y>16383) y=16383; - } else { /* yes */ - x=realposx; y=realposy; - } - - buffer[0]=0x98+((state->buttons&GPM_B_LEFT)>0?1:0)+ - ((state->buttons&GPM_B_MIDDLE)>0?2:0)+ - ((state->buttons&GPM_B_RIGHT)>0?3:0); - buffer[1]=x & 0x7f; /* X0-6*/ - buffer[2]=(x >> 7) & 0x7f; /* X7-12*/ - buffer[3]=y & 0x7f; /* Y0-6*/ - buffer[4]=(y >> 7) & 0x7f; /* Y7-12*/ - - return write(fd,buffer,5); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/sun/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/sun/m.c deleted file mode 100644 index a1373aab..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/sun/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -int M_sun(Gpm_Event *state, unsigned char *data) -{ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/sun/r.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/sun/r.c deleted file mode 100644 index fc39f84c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/sun/r.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ - - -int R_sun(Gpm_Event *state, int fd) -{ - signed char buffer[3]; - - buffer[0]= (state->buttons ^ 0x07) | 0x80; - buffer[1]= state->dx; - buffer[2]= -(state->dy); - return write(fd,buffer,3); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics/synaptics.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics/synaptics.c deleted file mode 100644 index 324fcbab..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics/synaptics.c +++ /dev/null @@ -1,3324 +0,0 @@ -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - - - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "gpm.h" -#include "daemon.h" /* which_mouse */ -#include "synaptics.h" -#include "message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - - -/* The next is UGLY, but I only want debug info from this file */ -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); -static char *syn_model_name (int sensor); -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C*/ -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled C*/ -static int tossing_enabled = 1; /* is toss/catch enabled C*/ -static int does_toss_use_static_speed = 1; /* is toss/catch speed C*/ - /* based on toss dist */ -static int edge_motion_enabled = 1; /* is edge motion enabled C*/ -static int edge_motion_speed_enabled = 1; /* does pressure control C*/ - /* speed of edge motion */ -static int pressure_speed_enabled = 1; /* does pressure control C*/ - /* speed in non edges */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while holding a tap C*/ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; /*C*/ -static int speed_up_pressure = 60; /*C*/ -static float speed_pressure_factor = 0.05; /*C*/ -static float standard_speed_factor = 0.08; /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ -static int max_toss_time = 300; /* ms: 0.30 sec */ /*C*/ -static int prevent_toss_time = 300; /* ms: 0.25 sec */ /*C*/ -static int min_toss_dist = 2; /* mm */ /*C*/ -static int static_toss_speed = 70; /*C*/ -static float toss_speed_factor = 0.5; /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C*/ -static int x_max_center = 5312; /* define right edge C*/ -static int y_min_center = 1408; /* define bottom edge C*/ -static int y_max_center = 4108; /* define top edge C*/ -static int edge_speed = 20; /* default speed at edges C*/ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ -static int drag_lock_enabled = 1; /* is drag locking enabled C */ -static int finger_threshold = 30; /* pressure before it is a finger C */ -static int tap_lower_limit = 5; /* a tap last at least this long C */ -static int tap_upper_limit = 200; /* a tap is at most this long C */ -static int tap_range = 100; /* mm finger movement limit C */ -static int tap_interval = 200; /* a tap reports button press this long C*/ -static int multiple_tap_delay = 30; /* time between reported button pressed C*/ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's tap_interval. C*/ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ -static int palm_detect_level = 12; /* Detecting a palm level (between 0-11) C */ -static int multi_finger_tap_enabled= 1; /* No of fingers decides which button is pressed C*/ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with multi finger C*/ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger detection. C*/ -static int fake_finger_layer_enabled = 1; /* add an extra software layer to detect multi fingers C*/ - - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner action turn_on_off. C*/ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored in - * absolute mode, this option try to recognize - * it's packets. C*/ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is reported as left click C*/ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on some touchpads C*/ -static int four_way_button_is_mouse= 1; /* Is the button: 4 buttons or does it moves the mouse. C*/ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right edge C*/ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C*/ -static int scrolling_speed = 10;/* less is faster, 1 fastest */ -static float scrolling_button_factor = 0.5; /* How fast should a button/corner tap scroll, higher faster C*/ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C*/ -static int reset_on_error_enabled = 0; /* If a packet does not conform to any absolute protocol - * should we reset the touchpad? This is wrong, because we - * should rather find out why it does that in first place. - * Do not turn it on per default. */ - - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions [] = { - { UPPER_LEFT_CORNER, No_Action }, - { LOWER_LEFT_CORNER, No_Action }, - { UPPER_RIGHT_CORNER, Middle_Button_Action }, - { LOWER_RIGHT_CORNER, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { FOURTH_BUTTON, Fourth_Button_Action }, - { UP_BUTTON, Up_Button_Action }, - { DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions [] = { - { ONE_FINGER, Left_Button_Action }, - { TWO_FINGERS, Right_Button_Action }, - { THREE_FINGERS, Middle_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type four_button_actions [] = { - { FOUR_LEFT_BUTTON, Middle_Button_Action }, - { FOUR_RIGHT_BUTTON, Fourth_Button_Action }, - { FOUR_UP_BUTTON, Up_Button_Action }, - { FOUR_DOWN_BUTTON, Down_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - -static touchpad_action_type stick_actions [] = { - { LEFT_BUTTON, Left_Button_Action }, - { MIDDLE_BUTTON, Middle_Button_Action }, - { RIGHT_BUTTON, Right_Button_Action }, - { 0, No_Action } /* stop flag value */ -}; - - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data [] = { - /* enabling configuration parameters */ - { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, - { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, - { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, - { "tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled }}, - { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, - { "tossing_enabled", Flag_Param, {&tossing_enabled }}, - { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - { "tap_hold_edge_motion_enabled",Flag_Param, {&tap_hold_edge_motion_enabled}}, - - /* pressure induced speed related configuration parameters */ - { "low_pressure", Integer_Param, {&low_speed_pressure }}, - { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, - { "pressure_factor", Float_Param, {&speed_pressure_factor }}, - { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ - { "min_toss_time", Integer_Param, {&min_toss_time }}, - { "max_toss_time", Integer_Param, {&max_toss_time }}, - { "prevent_toss_time", Integer_Param, {&prevent_toss_time }}, - { "min_toss_dist", Integer_Param, {&min_toss_dist }}, - { "static_toss_speed", Integer_Param, {&static_toss_speed }}, - { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ - { "x_min_center", Integer_Param, {&x_min_center }}, - { "x_max_center", Integer_Param, {&x_max_center }}, - { "y_min_center", Integer_Param, {&y_min_center }}, - { "y_max_center", Integer_Param, {&y_max_center }}, - { "edge_speed", Integer_Param, {&edge_speed }}, - /* use wmode */ - { "wmode_enabled", Flag_Param, {&wmode_enabled }}, - { "drag_lock_enabled", Flag_Param, {&drag_lock_enabled }}, - { "finger_threshold", Integer_Param, {&finger_threshold }}, - { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, - { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, - { "tap_range", Integer_Param, {&tap_range }}, - { "tap_interval", Integer_Param, {&tap_interval }}, - { "multiple_tap_delay", Integer_Param, {&multiple_tap_delay }}, - { "pads_tap_interval", Integer_Param, {&pads_tap_interval }}, - /* Additional wmode parameters */ - { "palm_detect_enabled", Flag_Param, {&palm_detect_enabled }}, - { "palm_detect_level", Integer_Param, {&palm_detect_level }}, - { "multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled }}, - { "multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled }}, - { "multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay }}, - { "fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled }}, - /* Additional options*/ - { "touchpad_enabled", Flag_Param, {&touchpad_enabled }}, - { "stick_enabled", Flag_Param, {&stick_enabled }}, - { "stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled }}, - { "four_way_button_enabled", Flag_Param, {&four_way_button_enabled }}, - { "four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse }}, - { "scrolling_enabled", Flag_Param, {&scrolling_enabled }}, - { "auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled }}, - { "scrolling_edge", Integer_Param, {&scrolling_edge }}, - { "scrolling_speed", Integer_Param, {&scrolling_speed }}, - { "scrolling_button_factor", Float_Param, {&scrolling_button_factor }}, - { "auto_scrolling_factor", Float_Param, {&auto_scrolling_factor }}, - /* corner tap actions */ - { "upper_left_action", Action_Param, {&corner_actions [0] }}, - { "lower_left_action", Action_Param, {&corner_actions [1] }}, - { "upper_right_action", Action_Param, {&corner_actions [2] }}, - { "lower_right_action", Action_Param, {&corner_actions [3] }}, - /* no. of fingers tap actions */ - { "one_finger_tap_action", Action_Param, {&multi_finger_actions [0] }}, - { "two_fingers_tap_action", Action_Param, {&multi_finger_actions [1] }}, - { "three_fingers_tap_action", Action_Param, {&multi_finger_actions [2] }}, - /* normal button actions */ - { "left_button_action", Action_Param, {&normal_button_actions [0] }}, - { "middle_button_action", Action_Param, {&normal_button_actions [1] }}, - { "right_button_action", Action_Param, {&normal_button_actions [2] }}, - { "fourth_button_action", Action_Param, {&normal_button_actions [3] }}, - { "up_button_action", Action_Param, {&normal_button_actions [4] }}, - { "down_button_action", Action_Param, {&normal_button_actions [5] }}, - /* 4 way button actions */ - { "four_way_left_button_action", Action_Param, {&four_button_actions [0] }}, - { "four_way_right_button_action",Action_Param, {&four_button_actions [1] }}, - { "four_way_up_button_action", Action_Param, {&four_button_actions [2] }}, - { "four_way_down_button_action", Action_Param, {&four_button_actions [3] }}, - /* Synaptic Stick (passthrugh,stick) actions */ - { "stick_left_button_action", Action_Param, {&stick_actions [0] }}, - { "stick_middle_button_action", Action_Param, {&stick_actions [1] }}, - { "stick_right_button_action", Action_Param, {&stick_actions [2] }}, - /* end of list */ - { NULL, Flag_Param, {NULL }} -}; - - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names [] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - - -static sensor_info_type sensor_info [] = { - { "", 0, 0, 0.0, 0.0 }, - { "Standard", 85, 94, 47.1, 32.3 }, - { "Mini", 91, 124, 44.0, 24.5 }, - { "Super", 57, 58, 70.2, 52.4 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "", 0, 0, 0.0, 0.0 }, - { "UltraThin", 85, 94, 47.1, 32.3 }, - { "Wide", 73, 96, 54.8, 31.7 }, - { "", 0, 0, 0.0, 0.0 }, - { "Stamp", 187, 170, 21.4, 17.9 }, - { "SubMini", 122, 167, 32.8, 18.2 }, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0],&sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad again)*/ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - - - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report,cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - - - -/* -** Parameters for controlling the touchpad. -*/ -/* touchpad information */ -static int res_x; -static int res_y; -static int x_per_mm; -static int y_per_mm; - - -/* status information */ -static int packet_num = 0; -static int was_edges = 0; -static int was_non_edge = 0; -static location_type last_locs [4]; -static Gpm_Event last_state; -static int tap_lower_limit_packet; -static int tap_upper_limit_packet; -static int last_corner_action = GPM_B_NOT_SET; -static int last_finger_action = GPM_B_NOT_SET; -static int last_normal_button_actions[6] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_stick_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; -static int last_4_way_button_actions[8] = - {GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET,GPM_B_NOT_SET}; - -/* toss status information */ -static int is_tossing = 0; -static int was_tossing = 0; -static int min_toss_dist__2 = 32000; -static int max_toss_packets; -static int min_toss_packets; -static int prevent_toss_packets; -static int toss_timer; -static location_type toss_speed; -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in the hold periode. - * (action like: Multifingers, non-repeating actions etc.*/ - -/* Multi finger information */ -static int was_fingers = 0; -static int multi_finger_stop_timer = 0; -static int multi_finger_pressure = 0; -static int multi_finger_xy = 0; - - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge*/ -static int is_always_scrolling = 0; /* Only report scrolling, no mouse movement */ -static int scrolling_speed_timer = 0; -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - - - - - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -#if DEBUG_REPORTS -static void tp_dump_report_data (report_type report, - int edges, - Gpm_Event* state) -{ - static report_type last_report_reported; - static unsigned int times_report_repeated = 0; - - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if (memcmp(&report,&last_report_reported,sizeof(report_type)) == 0){ - times_report_repeated++; - return; - } - - /* Was the last report repeated ? */ - if(times_report_repeated > 0){ - gpm_report (GPM_PR_DEBUG,"\rSynps2: Last report reported %d times\n",times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report (GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - - report.x, report.y, report.pressure, - report.w,was_fingers, - - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - - state->dx,state->dy,state->buttons, - - - multi_finger_pressure,multi_finger_xy, - (multi_finger_pressure>4500 && multi_finger_xy>50000? 'f':' ')); - -} -#endif - - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report (GPM_PR_INFO,"Synaptic %s Device:",(stick?"Stick":"Touchpad")); - - gpm_report (GPM_PR_INFO,"Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, ident[stick].info_minor); - gpm_report (GPM_PR_INFO,"Synaptics model:"); - gpm_report (GPM_PR_INFO," rot180: %s", model[stick].info_rot180 ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," portrait: %s", model[stick].info_portrait ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sensor: %d", model[stick].info_sensor); - gpm_report (GPM_PR_INFO," %s", syn_model_name (model[stick].info_sensor)); - gpm_report (GPM_PR_INFO," %s", sensor[stick]->model); - gpm_report (GPM_PR_INFO," %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report (GPM_PR_INFO," %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report (GPM_PR_INFO," %dx%d res", res_x, res_y); - gpm_report (GPM_PR_INFO," hardware: %d", model[stick].info_hardware); - gpm_report (GPM_PR_INFO," newABS: %s", model[stick].info_new_abs ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," simpleCmd: %s", model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," geometry: %d", model[stick].info_geometry); - gpm_report (GPM_PR_INFO," extended: %s", capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," stick: %s", capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," sleep: %s", capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," 4 buttons: %s", capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," multifinger: %s", capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report (GPM_PR_INFO," palmdetect: %s", capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - - -/* Get model name, STIG page 11 */ -static char *syn_model_name (int sensor) -{ - if (sensor < 0 || 44 < sensor ) { - return "Reserved"; - } else { - return model_names [sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info (int model_int, model_id_type *model) -{ - model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info (int sensor_id) -{ - if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; - } -} - - - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, ext_cap_type *cap) -{ - -# ifdef DEBUG - gpm_report(GPM_PR_INFO,"Synaptics Device Capabilities: %02X",ext_cap_int); -# endif - - cap->cap_ext = check_bits (ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext){ - cap->cap_stick = check_bits (ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits (ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits (ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits (ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits (ext_cap_int, EXT_CAP_PALM_DETECT); - }else{ - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* Wmode is not supported, but this should be turned off after reading the - config file.*/ - } -} - - -/* -** Check for edges. -*/ -static int tp_edges (location_type loc) -{ - int edges = 0; - - if (loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if (loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if (loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if (loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event *state) -{ - /* Limit the amount of scrolling, so that we do not overrun. */ - if ( scrolling_amount_left > 256*20 ) - scrolling_amount_left = 256*20; - - if ( scrolling_amount_left < -256*20 ) - scrolling_amount_left = -256*20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if (scrolling_amount_left > scrolling_speed){ - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - }else if (scrolling_amount_left < -scrolling_speed){ - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type *action_list, int mask) -{ - int i = 0; - int status = GPM_B_NOT_SET; - static int Left_Double_Click = 0; - - if (mask == 0){ - gpm_report (GPM_PR_WARN,"Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while (action_list [i].action_mask) { - if (check_bits (mask, action_list [i].action_mask)) { - switch (action_list [i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -# ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -# endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report (GPM_PR_WARN,"Default Action: Action no. %X not defined", - action_list [i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps (Gpm_Event *state, report_type *report) -{ - static int edges_at_cornertap_time; - - if (report->gesture && - ((is_corner (was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = tp_process_action(corner_actions,edges_at_cornertap_time); - - if (last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps (Gpm_Event *state, report_type *report) -{ - - - if (report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner (was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET) ){ - - if( ( multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = tp_process_action(multi_finger_actions, ONE_FINGER); - - if (multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = tp_process_action(multi_finger_actions, TWO_FINGERS); - - if (multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = tp_process_action(multi_finger_actions, THREE_FINGERS); - - if (last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event *state, int feature, int last_feature, int *last_action, - touchpad_action_type *action_list,int feature_mask) -{ - if (feature) { - if (!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if (*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event *state, int features, int last_features, int last_actions[], - touchpad_action_type *action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1<left, last_report.left, - &last_normal_button_actions[0], normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], normal_button_actions, DOWN_BUTTON); -} - - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - - -static void syn_process_wmode_report( report_type *report ) -{ - /* STIG page 9: Values of w, vary from pad to pad. It is not precise when pressure is small < 25. - * 4-7 finger of normal width - * 8-14 very wide finger or palm - * 15 maximum reportable width - */ - report->fingerwidth = max(0,report->w - 4); - - /* Check whether there is one finger on the pad */ - report->fingers = (report->pressure > finger_threshold); - - /* use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) */ - if (capabilities[0].cap_multi_finger){ - if (report->pressure != 0 && (report->w == 0 || report->w == 1)){ - report->fingers = 2+report->w; - } - } -} - - - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets( unsigned char *data, - report_type *report, - Gpm_Event *state) -{ - static int last_stick_buttons = GPM_B_NONE; - static int last_4_way_buttons = GPM_B_NONE; - int tmp_buttons = GPM_B_NONE; - - /* Sanity check of data. */ - if ((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3 ) { - - /* Something is wrong, should we assume it is an extended packet? It - * cannot be processed further than here as the pressure is 0, which would - * break things, if the user uses it simultaneously with the touchpad. - */ - /* Allow some simultaneously usage: tap-hold on touchpad, with extended movement. - * Do not do buttons, as they are not always correctly defined yet. */ - if (last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - - /* Stick invariant bits (I hope). See absolute packets */ - /* Stick pressed: The stick do only generates one packet, so double tap is - * a problem; squeezing in a non-clicked state. It is probably not a real - * problem, as it is hard not to move the stick a little between pressing, - * thereby returning a non-clicked state between the packets. Maybe - * press-lock mechanism is useful. Forget it, the styk supports it! */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && - (data[3] & 0xFC) == 0xC4){ - - tp_process_button_press (state,report); - - if (stick_enabled) { - state->dx= ((data[1] & 0x10) ? data[4]-256 : data[4]); - state->dy= -((data[1] & 0x20) ? data[5]-256 : data[5]); - } - - if (stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - } - - last_stick_buttons = tmp_buttons; - -# ifdef DEBUG_STICK - gpm_report (GPM_PR_DEBUG,"StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0],data[1],data[2],data[3],data[4],data[5], - state->dx,state->dy,state->buttons); -# endif - return 1; - } - - /* 4 way button invariant bits (I hope). I dont know the official name. */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && - report->x < 4 && report->y < 4 ){ - - if(four_way_button_enabled){ - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press (state,report); - - if (four_way_button_is_mouse){ - /* Report motion */ - if (report->x & 1) /* UP */ - state->dy = -1; - if (report->y & 1) /* DOWN */ - state->dy = 1; - if (report->x & 2) /* LEFT */ - state->dx = -1; - if (report->y & 2) /* RIGHT */ - state->dx = 1; - }else{ - /* Report buttons */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON: 0); /* RIGHT */ - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if ( scrolling_amount_left != 0 ){ - tp_handle_scrolling(state); - } - - return 1; - } - - /* This is unknown packet. */ - gpm_report (GPM_PR_ERR,"\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - return 1; - } - - /* Multiplexing with the stick (guest) device. */ - if (stick_pressure_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_stick_buttons; - if (tmp_buttons || last_stick_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons, - &last_stick_button_actions[0],stick_actions); - last_stick_buttons = tmp_buttons; - } - } - if (four_way_button_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_4_way_buttons; - if (tmp_buttons || last_4_way_buttons) { - tp_process_repeating_actions(state,tmp_buttons,last_4_way_buttons, - &last_4_way_button_actions[0],four_button_actions); - last_4_way_buttons = tmp_buttons; - } - } - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers ( report_type *report, - Gpm_Event *state) -{ - - static int fake_extra_finger; - static int was_fake_pressure; - - state = NULL; /* FIXME: gpm 1.99.13 */ - - /* Check whether there is a palm on the pad */ - if (palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)){ -# ifdef DEBUG_PALM - gpm_report (GPM_PR_DEBUG,"\rTouchpad: palm detected. finger width: %d",report->fingerwidth); -# endif - /* BUG should not return 1, as this drops packets. Return a repeated report ? */ - /* last_locs [mod4 (packet_num - 1)].x = report->x; */ - /* last_locs [mod4 (packet_num - 1)].y = report->y; */ - /* or */ - /* report->pressure = 0; */ - return 1; - } - - - /* Extra check for vertical multi fingers which my pad is very bad to detect. - ** Only check for extra fingers if no of fingers has not changed. Faking - ** fingers may go wrong so sanity check needed. This is not an attempt to - ** know the number of fingers all the time, as this is not needed. - */ - if (fake_finger_layer_enabled){ - - if (report->fingers > 1){ - fake_extra_finger = 0; - } - - if(report->fingers == 0){ - fake_extra_finger = 0; -# ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -# endif - }else - if (report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = (sqr(last_locs [mod4 (packet_num - 1)].x - report->x) + - sqr(last_locs [mod4 (packet_num - 1)].y - report->y) ); - - /* Check for a second finger. If the move is larger than tap range, - * then it is not a tap, and adding the finger does not change reported - * buttons, but it will still stop the moving if - * multi_finger_stop_enabled is on. These tests are complete base on my - * imagination and experience, so any better idea are welcome. */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - }/* Check for third finger. */ - else if(last_report.pressure > 180 && (report->fingers + fake_extra_finger) == 2 && - multi_finger_pressure > 4500 && multi_finger_xy > 2*sqr((double)tap_range)){ - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if ( (fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)){ - fake_extra_finger --; - - } else if(multi_finger_pressure < -5000 && multi_finger_xy > 2*sqr((double)tap_range)){ - /* Probably missed a placed multi finger, as this is one removed! */ - last_report.fingers ++; - } - } - - report->fingers += fake_extra_finger; - - } - - - /* Check whether to reduce sensibility when adding or removing fingers */ - if (multi_finger_stop_enabled){ - - /* Is a finger added or removed since last packet? */ - if( (report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers) ){ - - /* Updating the timer right after another added/removed finger, - * would make the undo moving become redo, so dont.*/ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -# ifdef DEBUG_MULTI_FINGER - gpm_report (GPM_PR_DEBUG,"%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add":"Remove", - last_report.fingers,report->fingers,fake_extra_finger); -# endif - - } /* Should be tested last, because of undo moving when removing fingers. */ - else if(report->fingers == 0){ - multi_finger_stop_timer = 0; - } - - /* Stop moving the mouse after a finger adding/removing. */ - if( multi_finger_stop_timer > 0){ - last_locs [mod4 (packet_num - 1)].x = report->x; - last_locs [mod4 (packet_num - 1)].y = report->y; - last_locs [mod4 (packet_num - 2)].x = report->x; - last_locs [mod4 (packet_num - 2)].y = report->y; - - /* Undo the previous move (before detecting of the adding/removing). */ - if (multi_finger_stop_timer == multi_finger_stop_delay){ - last_locs [mod4 (packet_num - 2)].x += last_state.dx * 2 / standard_speed_factor; - last_locs [mod4 (packet_num - 2)].y -= last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer --; - } - } - - /* If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval){ - if (report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap --; - else - was_fingers = 0; - } - - - was_fingers = max(was_fingers,report->fingers); - - return 0; -} - - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - - -static void tp_find_gestures (report_type *report) -{ - static int finger_on_pad_timer = 0; - static int time_to_forget_tap = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - - - if (report->fingers > 0) { - - /* finger down for the first time */ - if (finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* don't want timer to overflow */ - if (finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer ++; - - /* dragging and consecutive tap gestures is to end with finger up - * forget fast that there was a tap if this is not a part of a tap.*/ - if (time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if ((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum finger down time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum finger down time */ - ((distance((double)(stroke_x - last_report.x), /* maximum range for finger to drift while down */ - (double)(stroke_y - last_report.y)) - < sqr((double)tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* not a consecutive tap? */ - if (time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay gesture to create multiple click */ - } - - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - - } else { /* It was not a tap */ - - /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. - */ - if (drag_lock_enabled && - (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if (time_to_forget_tap > 0) time_to_forget_tap --; - if (time_to_forget_tap == 0) was_fingers=0; - if (gesture_delay > 0) gesture_delay --; - - } - -# ifdef DEBUG_TAPS - if (finger_on_pad_timer) - gpm_report (GPM_PR_DEBUG,"A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet,finger_on_pad_timer,tap_upper_limit_packet, - stroke_x-last_report.x,stroke_y-last_report.y,tap_range*tap_range); -# endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; -} - - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report (Gpm_Event *state, - report_type *report) -{ - location_type loc; - int edges; - float pressure_speed_factor; - float edge_speed_factor; - int edge_motion_on; - float dx, dy; - - /* extract location and edges */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges (loc); - - - if (report->fingers > 0) { - - if (tossing_enabled) { - /* this is the cue to stop tossing, if we are tossing so - Force a touch free pause before a new tossing is allowed (prevent toss time) */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* if we start tossing then this is from where */ - if (last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* Save the edge state, so we can detect a movement from non edge to edge. */ - if (!edges) - was_non_edge = 1; - - /* Need enough packets to perform smoothing on dy and dx - * but it should work with only 2, so why is 4 required? */ - if (packet_num > 3) { - - /* Is this start of scrolling? */ - if (scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner (edges))); /* no corner */ - - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled && last_report.gesture && - was_non_edge); - - - /* compute the speed factor based on pressure */ - pressure_speed_factor = standard_speed_factor; - - if (report->pressure > speed_up_pressure) { - pressure_speed_factor *= 1.0 + ((report->pressure - speed_up_pressure) * - speed_pressure_factor); - } - - /* use the edge speed factor if edge_motion_speed is enabled */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if ( auto_scrolling_enabled && is_scrolling ){ - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - - /* Calculate dx and dy depending on whether we are at an edge */ - - if (edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs [mod4 (packet_num - 1)].y + - last_locs [mod4 (packet_num - 2)].y) / 2) - - ((loc.y + - last_locs [mod4 (packet_num - 1)].y) / 2))); - - if (edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if (edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs [mod4 (packet_num - 1)].x) / 2) - - ((last_locs [mod4 (packet_num - 1)].x + - last_locs [mod4 (packet_num - 2)].x) / 2))); - } /* If (packet_num > 3)*/ - - last_locs [mod4 (packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* No finger on the pad */ - /* Start the tossing action if enabled */ - if (tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && - (packet_num < max_toss_packets)) { - - dx = last_locs [mod4 (packet_num - 1)].x - touch_loc.x; - dy = - (last_locs [mod4 (packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance (dx, dy)); -#endif - - if (distance (dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* determine the toss speed */ - if (does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs (dx) + abs (dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs (dx) + abs (dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report (GPM_PR_INFO,"tossx: %d tossy: %d", toss_speed.x, toss_speed.y); -#endif - } - } - - /* no fingers therefore: no edge, and restart packet count */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - - /* if we are tossing then apply the toss speed */ - if (tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - - /* if we are scrolling then stop moving and report wheel amount. The reason - ** for having this above buttons actions is buttons can then move the - ** mouse while scrolling. - */ - if ((scrolling_enabled && is_scrolling) || - is_always_scrolling){ - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - - /* check for (corner)buttons if we didn't just complete a toss or is scrolling */ - if (!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if (!report->gesture && - !report->left && !report->right && !report->middle && !report->fourth ) { - if (!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press (state, report); - if(tap_gesture_enabled) tp_process_finger_taps (state, report); - if(corner_taps_enabled) tp_process_corner_taps (state, report); - } - } - - /* Is there any amount of scrolling left? Should be checked after corner actions. */ - if (scrolling_amount_left != 0){ - tp_handle_scrolling(state); - } - - - was_tossing = was_tossing && toss_timer; - if (was_tossing) - toss_timer--; - - - /* remember the last state of the finger for toss processing */ - last_report = *report; - last_state = *state; - - /* Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. */ - if (!touchpad_enabled){ - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } - -#if DEBUG_REPORTS - tp_dump_report_data (*report, edges, state); -#endif - -} - - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file (char* config_filename) -{ - char line [80]; - char *token; - char *end_ptr; - int param, tmp_read_int_param; - FILE *config; - char full_filename[100]; - int status; - float tmp_read_float_param; - - status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename); - if (status < 0) { - gpm_report (GPM_PR_WARN,"Too long path for configure file: %s", config_filename); - return; - } - - - if ( !(config = fopen (full_filename, "r")) ) { - gpm_report (GPM_PR_WARN,"Failed to open configfile: %s", full_filename); - }else{ - while (fgets (line, 80, config)) { - if (line [0] == '[') { - if ( (token = strtok (line, "[] \t")) ) { - param = 0; - - /* which param is it */ - while (param_data [param].name && - strcasecmp (token, param_data [param].name) != 0) { - param++; - } - - /* was a param found? */ - if (!param_data [param].name) { - gpm_report (GPM_PR_WARN,"Unknown parameter %s", token); - } else { - token = strtok (NULL, "[] \t"); - - switch (param_data [param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - *(param_data [param].addr.int_p) = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Integer value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - *(param_data [param].addr.int_p)); -# endif - break; - - case Float_Param: - tmp_read_float_param = strtod (token, &end_ptr); - if (end_ptr != token) - *(param_data [param].addr.float_p) = tmp_read_float_param; - else - gpm_report (GPM_PR_WARN,"Float value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %3.3f", - param_data [param].name, - *(param_data [param].addr.float_p)); -# endif - break; - - case Flag_Param: - if (strchr ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; - } else if (strchr ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", - token, param_data [param].name); - } -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %s", - param_data [param].name, - (*(param_data [param].addr.flag_p) ? - "True" : "False")); -# endif - break; - - case Action_Param: - tmp_read_int_param = strtol (token, &end_ptr, 0); - if (end_ptr != token) - param_data [param].addr.corner_p->action = tmp_read_int_param; - else - gpm_report (GPM_PR_WARN,"Action value (%s) for parameter %s is invalid", - token, param_data [param].name); -# if DEBUG_PARAMS - gpm_report (GPM_PR_INFO,"Param %s set to %d", - param_data [param].name, - param_data [param].addr.corner_p->action); -# endif - break; - - default: ; - } - } - } - } - } - - fclose (config); - } -} - - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config (info_type ident, - model_id_type model) -{ - sensor[0] = syn_get_sensor_info (model.info_sensor); - gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file ("gpm-syn.conf"); - - - /* Limit the options depending on the touchpad capabilities. This should be - done after reading the configure file so they may be turned off on purpose - and can'nt be turned on if not supported. */ - if(!capabilities[0].cap_ext){ - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect){ - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick){ - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* fake_forget_tap_interval must be set if the hardware does the gesture. */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* Save important information */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* convert the tap times to packets (80 pkts/sec and 1000 ms/sec) */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* Convert the toss dist to touchpad resolution from mm */ - min_toss_dist__2 = sqr (min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* convert the toss times to packets (80 pkts/sec and 1000 ms/sec) */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - - - - -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) -{ - unsigned char bytes [3]; - int result; - - bytes [0] = byte1; - bytes [1] = byte2; - bytes [2] = '\0'; - sscanf ((char *) bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO,"Serial tossing"); - fflush (stdout); -#endif - read (fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report (GPM_PR_INFO," %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read (int fd, - unsigned char *bytes, - size_t count) -{ - struct timeval tv; - fd_set rfds; - int num_read = 0; - int read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while ((select (fd+1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < (int) count)) { - read_count = read (fd, &bytes [num_read], count - num_read); - num_read += read_count; - - FD_ZERO (&rfds); - FD_SET (fd, &rfds); - } - - for (; num_read < (int) count; num_read++) { - bytes [num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) -{ - unsigned char junk [15]; - - tp_serial_flush_input (fd); - write (fd, cmd, strlen ((char *) cmd)); - tp_serial_read (fd, junk, strlen ((char *) cmd)); -#if DEBUG_FLUSH - junk [strlen (cmd)] = '\0'; - gpm_report (GPM_PR_DEBUG,"serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode (int fd, - unsigned char mode) -{ - unsigned char bytes [15]; - - sprintf ((char *) bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report (GPM_PR_DEBUG,"modes: %s", bytes); -#endif - tp_serial_send_cmd (fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident (int fd, - info_type *info) -{ - unsigned char bytes [5]; - - tp_serial_send_cmd (fd, (unsigned char *) "%A"); - tp_serial_read (fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes [4] = '\0'; - gpm_report (GPM_PR_INFO,"Serial ident: %s", bytes); -#endif - - if ( bytes [0] == 'S' && bytes [0] == 'T'){ - /* reformat the data - * The out commented is wrong according to STIG page 57.*/ - /* info->info_model_code = (bytes [2] & 0x07) >> 3; */ - info->info_model_code = bytes [2] >> 3; - info->info_major = (bytes [2] & 0x07); - info->info_minor = bytes [3]; - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - - - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id (int fd, - model_id_type *model) -{ - unsigned char bytes [7]; - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if ( (ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)){ - tp_serial_send_cmd (fd, (unsigned char *) "%D"); - tp_serial_read (fd, bytes, 6); - - /* reformat the data */ - model_int = ((tp_hextoint (bytes [0], bytes [1]) << 16) | - (tp_hextoint (bytes [2], bytes [3]) << 8) | - (tp_hextoint (bytes [4], bytes [5]))); - -# if DEBUG_SENT_DATA - bytes [6] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial model id: %s", bytes); -# endif - - }else{ - model_int = 0; - } - - syn_extract_model_id_info (model_int, model); -} - - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap (int fd, - ext_cap_type *cap) -{ - unsigned char bytes [8]; - int cap_int = 0; - - tp_serial_send_cmd (fd, (unsigned char *) "%B"); - tp_serial_read (fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes [7] = '\0'; - gpm_report (GPM_PR_DEBUG,"Serial capabilites: %s", bytes); -#endif - - if (ident[0].info_major >= 4){ - if (bytes [0] == '3' && bytes [0] == 'B'){ - cap_int = ((tp_hextoint (bytes [4], bytes [5]) << 8) | - (tp_hextoint (bytes [6], bytes [7]))); - }else{ - gpm_report (GPM_PR_ERR,"PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int,cap); -} - - - -/*------------------------------------------------------------------------*/ -/* PS/2 Utility functions. */ -/* Adapted from tpconfig.c by C. Scott Ananian */ -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode)*/ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect*/ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent after a PS2_READY */ - - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate (used after a sample rate cmd). - * All other sample rate gives undefined behavior (used to address 4 byte mode)*/ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ - - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - - - - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Getting byte"); -# endif - - read(fd, &b, 1); - -# ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG,"Got %X",b); -# endif - - return b; -} - - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send real byte %X",b); -# endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if (ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } - -# ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG,"Responce %X to byte %X",ack,b); -# endif - - return ack; -} - - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if (!stick) { - response[1]=tp_ps2_getbyte(fd); - } else { - response[0]=tp_ps2_getbyte(fd); - response[1]=tp_ps2_getbyte(fd); - response[2]=tp_ps2_getbyte(fd); - response[3]=tp_ps2_getbyte(fd); - response[4]=tp_ps2_getbyte(fd); - response[5]=tp_ps2_getbyte(fd); - - /* Do some sanity checking */ - if((response[0] & 0xFC) != 0x84) { - gpm_report (GPM_PR_ERR,"Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report (GPM_PR_ERR,"Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, - int stick, - byte b) -{ - byte ack; - -# ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG,"Send byte %X to %s",b,(stick?"Stick":"Touchpad")); -# endif - - if (!stick) { - ack = tp_ps2_putbyte(fd,b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd,DEVICE_STICK); - } - - if (ack != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick?"Stick":"Touchpad"),b,ack); -} - - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, - int stick, - byte cmd) -{ - int i; - -# ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG,"Send Command %X to %s",cmd,(stick?"Stick":"Touchpad")); -# endif - - /* initialize with 'inert' command */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd>>6)&0x3); - cmd<<=2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, - int stick, - byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte (fd, stick, PS2_SYN_SET_MODE2); -} - - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, - int stick, - byte cmd, - byte *bytes) -{ - gpm_report (GPM_PR_INFO,"Status request for %s, %X", (stick?"stick":"touchpad"),cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte (fd, stick, PS2_STATUS_REQ); - bytes [0]=syn_ps2_getbyte(fd,stick); - bytes [1]=syn_ps2_getbyte(fd,stick); - bytes [2]=syn_ps2_getbyte(fd,stick); - - gpm_report (GPM_PR_INFO,"Status request %X %X %X", bytes[0], bytes[1], bytes[2]); -} - - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes (int fd, int stick) -{ - unsigned char bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report (GPM_PR_INFO,"Synaptic PS/2 %s modes: %02X", (stick?"stick":"touchpad"),bytes [2]); -# endif -} - -#endif - - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident (int fd, - int stick, - info_type *info) -{ - byte bytes [3]; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s identification\n", - (stick?"sticks":"touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes [0]; - info->info_model_code = (bytes [2] >> 4) & 0x0f; - info->info_major = bytes [2] & 0x0f; - } -} - - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id (int fd, - int stick, - model_id_type *model) -{ - unsigned char bytes [3]; - int model_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | - (bytes [2])); - syn_extract_model_id_info (model_int, model); -} - - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap (int fd, - int stick, - ext_cap_type *cap) -{ - unsigned char bytes [3]; - int ext_cap_int; - - syn_ps2_status_rqst (fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if (bytes [1] != PS2_SYN_STATUS_OK) { - gpm_report (GPM_PR_ERR,"PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick?"stick":"touchpad")); - ext_cap_int = 0; - }else{ - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - - - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data (int fd) -{ - struct timeval tv; - fd_set rfds; - unsigned char status; - byte cmd = PS2_DISABLE_DATA; - - - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd,&cmd,1); - - usleep (50000); - - while (select (fd+1, &rfds, NULL, NULL, &tv) == 1) { - read (fd, &status, 1); -#if DEBUG_RESET - gpm_report (GPM_PR_INFO,"PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET (fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if (status != PS2_ACK) - gpm_report (GPM_PR_ERR,"Invalid ACK to disable stream command, got %02X",status); -} - - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if (stick_enabled) - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_ENABLE_DATA); - syn_ps2_putbyte(fd,DEVICE_TOUCHPAD,PS2_ENABLE_DATA); -} - - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status,id_code = PS2_MOUSE_IDCODE; - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG,"Reseting Synaptic PS/2 %s\n",(stick?"Stick":"Touchpad")); - - /* Send reset command without eating the ack. */ - if(!stick) { - write(fd,&reset_cmd,1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* Sometimes the touchpad sends additional ready,idcode before ack the reset command. - * I dont know why! */ - while (status == PS2_READY){ - gpm_report(GPM_PR_INFO,"PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd,stick); - status = syn_ps2_getbyte(fd,stick); - } - - if (status != PS2_ACK || id_code != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Sending reset command to PS/2 Device failed: No ACK, got %02X.\n",status); - } - - /* Wait 750 ms to recalibrate. */ - usleep(750000); - - if ( (status = syn_ps2_getbyte(fd,stick)) != PS2_READY ){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n",status); - } - if ( (id_code = syn_ps2_getbyte(fd,stick)) != PS2_MOUSE_IDCODE){ - gpm_report(GPM_PR_ERR,"Reseting PS/2 Device failed: Wrong ID, got %02X.\n",id_code); - } - -} - - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* select 6 byte packet, high packet rate, no-sleep */ - syn_ps2_set_mode2 (fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - - - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - - -static void syn_serial_translate_data (unsigned char *data, - report_type *report) -{ - report->gesture = check_bits (data [0], 0x10); - report->fingers = check_bits (data [0], 0x08); - report->left = check_bits (data [0], 0x04); - report->middle = check_bits (data [0], 0x02); - report->right = check_bits (data [0], 0x01); - report->x = (data [1] << 7) | (data [2] << 1); - report->y = (data [3] << 7) | (data [4] << 1); - report->pressure = data [5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if (model[0].info_new_abs){ - report->up = check_bits (data [6], 0x20); - report->down = check_bits (data [6], 0x40); - report->y |= (data [6] & 0x08) >> 3; - report->x |= (data [6] & 0x04) >> 2; - report->pressure |= (data [6] & 0x03); - - if (wmode_enabled){ - report->w = (data [7] & 0x0F); - } - } -} - - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, - report_type *report) -{ - gpm_report(GPM_PR_WARN,"Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data [0],data [1],data [2],data [3],data [4],data [5]); - - if (reset_on_error_enabled) { - /* Hack to get the fd: which_mouse is the current mouse, - and as the synaptic code is called, it is the current mouse. */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data (unsigned char *data, - report_type *report) -{ - - /* Check that this is indeed an absolute 6 byte new version packet*/ - if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated data */ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x0F) << 8) | - ((data [3] & 0x10) << 8) | - ((data [4]))); - report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | - ((data [5]))); - report->pressure = data [2]; - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /*th Old style packet maybe */ - else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ - ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ - ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ - ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data [1] & 0x1F) << 8) | - ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | - ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | - ((data [3] & 0x3f))); - report->gesture = check_bits (data [0], 0x04); - report->fingers = check_bits (data [1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data (unsigned char *data, - report_type *report) -{ - /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->right = check_bits (data[0], 0x02); - report->fourth = check_bits (data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | - ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | - ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | - ((data[0] & 0x30) >> 2)); - - - } else { - syn_ps2_translate_error(data,report); - } -} - - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data) -{ - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data (data, &cur_report); - if (wmode_enabled){ - syn_process_wmode_report(&cur_report); - } - if (tp_find_fingers(&cur_report,state)) return; - if (wmode_enabled){ - tp_find_gestures(&cur_report); - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode (fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - NORMAL_REPORT | - REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init (int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident (fd, &ident[0]); - syn_serial_read_model_id (fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - - syn_dump_info(0); - - /* Change the protocol to use either 6,7 or 8 bytes, STIG 63 */ - if (model[0].info_new_abs){ - if (wmode_enabled){ - return_packetlength = 8; - }else{ - return_packetlength = 7; - } - }else{ - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode (fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : NORMAL_REPORT) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - - return return_packetlength; -} - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data) -{ - /* gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); */ - - /* initialize the state */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - - if (wmode_enabled) { - syn_ps2_translate_wmode_data (data, &cur_report); - if (syn_ps2_process_extended_packets(data,&cur_report,state)) return; - syn_process_wmode_report(&cur_report); - if (tp_find_fingers(&cur_report,state)) return; - tp_find_gestures(&cur_report); - }else { - syn_ps2_translate_data (data, &cur_report); - if (tp_find_fingers(&cur_report,state)) return; - } - - tp_process_report (state, &cur_report); -} - - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset (int fd) -{ - gpm_report (GPM_PR_INFO,"Reseting Synaptic PS/2 Touchpad."); - - /* Stop incoming motion data (of whatever kind absolute/relative). */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if (!stick_enabled) return; - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 Stick Device"); - - /* Reset it, set defaults, streaming */ - syn_ps2_send_reset(fd,DEVICE_STICK); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_SET_DEFAULT); - syn_ps2_putbyte(fd,DEVICE_STICK,PS2_STREAM_MODE); - - /* Unused */ - /* syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); */ - /* syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); */ - /* syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); */ - - /* syn_dump_info(DEVICE_STICK); */ -} - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd) -{ - - gpm_report(GPM_PR_DEBUG,"Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* Init touchpad */ - syn_ps2_send_reset(fd,DEVICE_TOUCHPAD); - - syn_ps2_read_ident (fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id (fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap (fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config (ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* Absolut mode must be set before Init Stick device*/ - syn_ps2_init_stick(fd); - - /* Enable absolut mode and streaming */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics_ps2/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics_ps2/m.c deleted file mode 100644 index 49eb8d1c..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics_ps2/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* synaptics support */ - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics_serial/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics_serial/m.c deleted file mode 100644 index 02af1c2d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/synaptics_serial/m.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* synaptics support */ - - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -{ - syn_process_serial_data (state, data); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/synps2/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/synps2/i.c deleted file mode 100644 index 9150af2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/synps2/i.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* Gpm_type */ - -/* synaptics touchpad, ps2 version: Henry Davies */ -Gpm_Type *I_synps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - syn_ps2_init (fd); - return type; -} - - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/i.c deleted file mode 100644 index 290ad1ce..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/i.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "daemon.h" /* which_mouse */ -#include "drivers.h" - -int twiddler_key_init(void); /* FIXME: from twiddler */ - -Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - - if (check_no_argv(argc, argv)) return NULL; - - if (twiddler_key_init() != 0) return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud)==DEF_BAUD) (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is dirty) */ - return I_serial(fd, flags, type, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/m.c deleted file mode 100644 index f15524b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/m.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* KG_SHIFT */ - -#include "types.h" /* Gpm_type */ -#include "twiddler.h" /* twiddler */ - -int M_twid(Gpm_Event *state, unsigned char *data) -{ - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; - - /* build the message as a single number */ - for (i=0; i<5; i++) - message |= (data[i]&0x7f)<<(i*7); - key = message & TW_ANY_KEY; - - if ((message & TW_MOD_M) == 0) { /* manage keyboard */ - if (((message & TW_ANY_KEY) != (unsigned long ) lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: state->buttons = GPM_B_RIGHT; break; - case TW_M1: state->buttons = GPM_B_MIDDLE; break; - case TW_R1: state->buttons = GPM_B_LEFT; break; - case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ - if (message & TW_ANY2) state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) state->buttons |= GPM_B_LEFT; - if (message & TW_R3) state->buttons |= GPM_B_RIGHT; - - /* put in modifiers information */ - { - struct {unsigned long in, out;} *ptr, list[] = { - { TW_MOD_S, 1<in; ptr++) - if(message & ptr->in) state->modifiers |= ptr->out; - } - - /* now extraxt H/V */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if (h & TW_M_BIT) h = -(TW_M_MASK + 1 - h); - if (v & TW_M_BIT) v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* static implementation: return movement */ - if (!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* in case I'll change the resolution */ - static int tw_threshold = 5; /* above this it moves */ - static int tw_scale = 5; /* every 5 report one */ - - if (h > -tw_threshold && h < tw_threshold) state->dx=0; - else { - h = h - (h<0)*tw_threshold +lasth; - lasth = h%tw_scale; - state->dx = -(h/tw_scale); - } - if (v > -tw_threshold && v < tw_threshold) state->dy=0; - else { - v = v - (v<0)*tw_threshold +lastv; - lastv = v%tw_scale; - state->dy = -(v/tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* in case I'll change the resolution */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - static int tw_scale = 10; /* ball: every 6 units move one unit */ - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if (!lock) { - lasth = h; lasthrest = 0; - lastv = v; lastvrest = 0; - lock = 1; - } - - if (h > -tw_threshold && h < tw_threshold) { - state->dx = -(h-lasth+lasthrest)/tw_static_scale; - lasthrest = (h-lasth+lasthrest)%tw_static_scale; - } else /* ballistic */ { - h = h - (h<0)*tw_threshold + lasthrest; - lasthrest = h%tw_scale; - state->dx = -(h/tw_scale); - } - lasth = h; - if (v > -tw_threshold && v < tw_threshold) { - state->dy = -(v-lastv+lastvrest)/tw_static_scale; - lastvrest = (v-lastv+lastvrest)%tw_static_scale; - } else /* ballistic */ { - v = v - (v<0)*tw_threshold + lastvrest; - lastvrest = v%tw_scale; - state->dy = -(v/tw_scale); - } - lastv = v; - } -#endif - - /* fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/twiddler.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/twiddler.c deleted file mode 100644 index 6adb2db9..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/twid/twiddler.c +++ /dev/null @@ -1,532 +0,0 @@ -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpm.h" -#include "gpmInt.h" -#include "message.h" -#include "twiddler.h" - -#include "daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { TW_MOD_0, "", twiddler_table[0]}, - { TW_MOD_S, "Shift", twiddler_table[1]}, - { TW_MOD_N, "Numeric", twiddler_table[2]}, - { TW_MOD_F, "Function", twiddler_table[3]}, - { TW_MOD_C, "Control", twiddler_table[4]}, - { TW_MOD_C, "Ctrl", twiddler_table[4]}, - { TW_MOD_A, "Alt", twiddler_table[5]}, - { TW_MOD_A, "Meta", twiddler_table[5]}, -/* This is different!! */ - { TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, - { TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, - { 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - {"F1", "\033[[A" }, - {"F2", "\033[[B" }, - {"F3", "\033[[C" }, - {"F4", "\033[[D" }, - {"F5", "\033[[E" }, - {"F6", "\033[17~" }, - {"F7", "\033[18~" }, - {"F8", "\033[19~" }, - {"F9", "\033[20~" }, - {"F10", "\033[21~" }, - {"F11", "\033[23~" }, - {"F12", "\033[24~" }, - {"F13", "\033[25~" }, - {"F14", "\033[26~" }, - {"F15", "\033[28~" }, - {"F16", "\033[29~" }, - {"F17", "\033[31~" }, - {"F18", "\033[32~" }, - {"F19", "\033[33~" }, - {"F20", "\033[34~" }, - {"Find", "\033[1~" }, - {"Insert", "\033[2~" }, - {"Remove", "\033[3~" }, - {"Select", "\033[4~" }, - {"Prior", "\033[5~" }, - {"Next", "\033[6~" }, - {"Macro", "\033[M" }, - {"Pause", "\033[P" }, - - {"Up", "\033[A" }, - {"Down", "\033[B" }, - {"Left", "\033[D" }, - {"Right", "\033[C" }, - - {NULL, NULL } -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun)(char *string); -}; - - -/*===================================================================*/ -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - int fd; - if (consolenr == 0) return 0; /* nothing to do */ - - fd=open_console(O_RDONLY); - if (fd < 0) return -1; - if (ioctl(fd, VT_ACTIVATE, consolenr)<0) {close(fd); return -1;} -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - extern struct options option; - switch(pid=fork()) { - case -1: return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV,O_RDONLY); - open(option.consolename,O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return(0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - { "Console", twiddler_console }, - { "Exec", twiddler_exec }, - { NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun)(char *s); - char *arg; - } twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; -static int active_fun_nr = 0; - - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - struct twiddler_map_struct *ptr; - - for (ptr = twiddler_map; ptr->table; ptr++) - if (ptr->modifiers == mod) return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - int i, retval = 0; - unsigned char pushthis, unblank=4; /* 4 == TIOCLINUX unblank */ - - /* a special function */ - /* a single byte */ - if (((unsigned long)item & 0xff) == (unsigned long)item) { - pushthis = (unsigned long)item & 0xff; - retval = ioctl(fd,TIOCSTI,&pushthis); - } else if(i = (struct twiddler_active_fun *)item - twiddler_active_funs, - i>=0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for (; *item!='\0' && retval==0; item++) retval = ioctl(fd,TIOCSTI,item); - - ioctl(fd,TIOCLINUX,&unblank); - if (retval) - gpm_report(GPM_PR_ERR,GPM_MESS_IOCTL_TIOCSTI, option.progname, strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - char *val; - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static unsigned long last_message; - static int marked; - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - static unsigned int nclick, last_pressed; -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if (!table) return 0; - message &= 0xff; - val = table[message]; - - if ((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if (last_pressed != last_message) { - nclick=1; GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if (message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* building up a chord or repeating */ - - if (message != last_pressed) { /* building up */ - marked=0; - last_message = message; - return 0; - } - - /* Hmmm... double click */ - if (message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1+ (DIF_TIME(tv1,tv2) < 300); /* if fast, counts as double */ - last_message = message; - if (nclick==1) GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* so, we are repeating... */ - if (nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if (DIF_TIME(tv2,tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - int len = strlen(mod); - - if (len == 0) return twiddler_map->table; - - for (ptr = twiddler_map; ptr->table; ptr++) { - if (!strncasecmp(mod,ptr->keyword,len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - char *tmp; - int result = 0; - int shift = 0; - - if (strlen(chord)!=4) return -1; - - while (*chord) { - if (!(tmp = strchr(convert, *chord))) return -1; - result |= (tmp-convert)<instring; sptr++) - if (!strcmp(ptr,sptr->instring)) return sptr->outstring; - - /* finally, look for special functions */ - for (fptr = twiddler_functions; fptr->name; fptr++) - if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) { - if (active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name)); - return (char *)(twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[]={TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL}; - int fileindex=0; - char s[128], buf[64]; /* buf is for the string */ - char mod[64], chord[64], *value; - int index, lineno=0, errcount=0; - char **table; - static int initcount=0; - - if (initcount) return 0; /* do it only once */ - initcount++; - - if (!(f = fopen(TW_SYSTEM_FILE,"r"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,TW_SYSTEM_FILE,strerror(errno)); - return -1; - } - - /* ok, go on reading all the files in files[]*/ - while (files[fileindex]) { - while (fgets(s,128,f)) { - lineno++; - - /* trim newline and blanks, if any */ - if (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0'; - while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0'; - - if (s[0]=='\0' || s[0]=='#') continue; /* ignore comment or empty */ - - if (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */ - mod[0]='\0'; /* no modifiers */ - else if (sscanf(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */; - else if (sscanf(s, "%s", buf)!= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_SYNTAX_1,option.progname,TW_SYSTEM_FILE - ,lineno); - errcount++; - continue; - } - - /* Ok, here we are: now check the parts */ - if (!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR,GPM_MESS_UNKNOWN_MOD_1,option.progname,TW_SYSTEM_FILE - ,lineno, mod); - errcount++; - continue; - } - if ((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_COORDS,option.progname, - TW_SYSTEM_FILE,lineno, chord); - errcount++; - continue; - } - if ((value = twiddler_rest_to_value(s))==s) { - gpm_report(GPM_PR_ERR,GPM_MESS_INCORRECT_LINE,option.progname,TW_SYSTEM_FILE - ,lineno,s); - errcount++; - continue; - } - - if (table[index]) { - gpm_report(GPM_PR_ERR,GPM_MESS_REDEF_COORDS,option.progname,TW_SYSTEM_FILE, - lineno, mod, " ", chord); - } - /* all done */ - if (value) - table[index]=value; - else - table[index]=""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while (files[++fileindex]) /* next file, optional */ - if ( (f=fopen(files[fileindex],"r")) ) break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/vsxxx_aa/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/vsxxx_aa/m.c deleted file mode 100644 index 9dd97a6f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/vsxxx_aa/m.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ -/* workstations */ -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ -/* modified (completion of the protocol specification and */ -/* corresponding correction of the protocol identification */ -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -int M_vsxxx_aa(Gpm_Event *state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0]&0x07; - state->dx = (data[0]&0x10) ? data[1] : -data[1]; - state->dy = (data[0]&0x08) ? -data[2] : data[2]; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/i.c deleted file mode 100644 index 2a51d306..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/i.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ -#include -#include /* select */ - -#include "mice.h" /* check_no_argv */ -#include "types.h" /* Gpm_type */ -#include "message.h" /* gpm_report */ -#include "wacom.h" /* wacom */ - - -Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* or switch to wacom IIs (wacomIV) */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - flags = 0; /* FIXME: 1.99.13 */ - - - void reset_wacom() - { - /* Init Wacom communication; this is modified from xf86Wacom.so module */ - /* Set speed to 19200 */ - setspeed (fd, 1200, 19200, 0, B19200|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Baudrate Command */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* Set speed to 9600bps */ - setspeed (fd, 1200, 9600, 0, B9600|CS8|CREAD|CLOCAL|HUPCL); - /* Send Reset Command */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() - { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - fd_set readfds; - int err; - FD_ZERO(&readfds); FD_SET(fd, &readfds); - timeout.tv_sec = 0; timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return((err>0)?1:err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) - { - int err; - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if (cmd) write(fd,cmd,strlen(cmd)); - memset(buffer,0,sizeof(buffer)); p=buffer; - err=wait_wacom(); - while (err != -1 - && err - && (p-buffer) < (int) (sizeof(buffer)-1)) { - p+= read(fd,p,(sizeof(buffer)-1)-(p-buffer)); - err=wait_wacom(); - } - /* return 1 for buffer full */ - return ((strlen(buffer) >= (sizeof(buffer)-1))? !0 :0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* accept boolean options absolute and relative */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: !0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value: 0}, - {"", ARGV_END, u: {iptr: &WacomAbsoluteWanted}, value: 0} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* "Flush" input queque */ - while(RequestData(NULL)) ; - - /* read WACOM-ID */ - RequestData(UD_FIRMID); - - /* Search for matching modell */ - for(WacomModell=0; - WacomModell < (int) (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++ ) { - if (!strncmp(buffer+2,wcmodell[WacomModell].magic, 2)) { - /* Magic matches, modell found */ - wmaxx=wcmodell[WacomModell].maxX; - wmaxy=wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (int) (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell=-1; - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MOD, type->absolute? 'A':'R', - (WacomModell==(-1))? "Unknown" : wcmodell[WacomModell].name, - buffer+2); - - /* read Wacom max size */ - if(WacomModell!=(-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer+2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx-wcmodell[WacomModell].border); - wmaxy = (wmaxy-wcmodell[WacomModell].border); - } - write(fd,UD_SENDCOORDS,4); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/m.c deleted file mode 100644 index df1043e8..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/m.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* strcmp */ - -#include "types.h" /* Gpm_type */ -#include "wacom.h" /* wacom */ -#include "daemon.h" /* which_mouse */ -#include "mice.h" /* REALPOS */ - - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ -/* for relative and absolute : */ -int WacomModell =-1; /* -1 means "dont know" */ -int WacomAbsoluteWanted=0; /* Tell Driver if Relative or Absolute */ -int wmaxx, wmaxy; -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL wcmodell[3] = { - /* ModellName Magic MaxX MaxY Border Tresh */ - { "UltraPad" , "UD", 0, 0, 250, 20 }, - /* { "Intuos" , "GD", 0, 0, 0, 20 }, not supported */ - { "PenPartner", "CT", 0, 0, 0, 20 }, - { "Graphire" , "ET", 5103, 3711, 0, 20 } - }; - - -int M_wacom(Gpm_Event *state, unsigned char *data) -{ - static int ox=-1, oy; - int x, y; - int macro=0; /* macro buttons from tablet */ - - /* Bit [0]&64 seems to have different meanings - - * graphire: inside of active area; - * Ultrapad: Pen in proximity (means: pen detected) - * Penpartner: no idea... - * this may be of worth sometimes, but for now, we can say, that - * if the graphire tells us that we are in the active area, we can tell - * also that the graphire has the pen in proximity. - */ - - if (!(data[0]&64)) { /* Tool not in proximity or out of active area */ - /* handle Ultrapad macro buttons, if we get a packet without - * proximity bit but with the buttonflag set, we know that we have - * a macro event */ - if (IsA(UltraPad)) { - if (data[0]&8) { /* here: macro button has been pressed */ - if (data[3]&8) macro=(data[6]); - if (data[3]&16) macro=(data[6])+12; - if (data[3]&32) macro=(data[6])+24; /* rom-version >= 1.3 */ - - state->modifiers=macro; - /* Here we simulate the middle mousebutton */ - /* with ultrapad Eprom Version 1.2 */ - /* WHY IS THE FOLLOWING CODE DISABLE ? FIXME - gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); - if (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } /* end if ultrapad */ - - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; - state->dx=state->dy=0; - } - - return 0; /* nothing more to do so leave */ - } /* end if Tool out of active area*/ - - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if (WacomAbsoluteWanted) { /* Absolute Mode */ - if (x>wmaxx) x=wmaxx; if (x<0) x=0; - if (y>wmaxy) y=wmaxy; if (y<0) y=0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* Treshold; if greather then treat tool as first time in proximity */ - if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold) - || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y; - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox=x; oy=y; - - state->buttons= /* for Ultra-Pad and graphire */ - !!(data[3]&8) * GPM_B_LEFT + - !!(data[3]&16) * GPM_B_RIGHT + - !!(data[3]&32) * GPM_B_MIDDLE; /* UD: rom-version >=1.3 */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/wacom.h b/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/wacom.h deleted file mode 100644 index a82b4e90..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wacom/wacom.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_WACOM_H -#define _GPM_WACOM_H - -struct WC_MODELL { - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -}; - -extern int WacomModell; -extern int WacomAbsoluteWanted; -extern int wmaxx; -extern int wmaxy; -extern char upmbuf[25]; - -extern struct WC_MODELL wcmodell[3]; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wp/i.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/wp/i.c deleted file mode 100644 index 20c69928..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wp/i.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ - -extern int wizardpad_width; -extern int wizardpad_height; - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -Gpm_Type *I_wp(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) -{ - struct termios tty; - char tablet_info[256]; - int count, pos, size; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Reset the tablet (':') and put it in remote mode ('S') so that - it isn't sending anything to us. */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* Query the model of the tablet */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* The tablet information should start with "KW" followed by the rest of - the model number. If it isn't there, it probably isn't a WizardPad. */ - if(count < 2) return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') return NULL; - - /* Now, we want the width and height of the tablet. They should be - of the form "X###" and "Y###" where ### is the number of units of - the tablet. The model I've got is "X130" and "Y095", but I guess - there might be other ones sometime. */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + - (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* Set the tablet to stream mode with 180 updates per sec. ('O') */ - write(fd, "O", 1); - - return type; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wp/m.c b/software/gpm/browse_source/gpm-1.99.6/src/drivers/wp/m.c deleted file mode 100644 index 7db2679b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/drivers/wp/m.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ -#include "mice.h" /* REALPOS */ - - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -int wizardpad_width = -1; -int wizardpad_height = -1; -int M_wp(Gpm_Event *state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons= - (pressure >= 0x20) * GPM_B_LEFT + - !!(data[1] & 0x02) * GPM_B_RIGHT + - /* the 0x08 bit seems to catch either of the extra buttons... */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/check_no_argv.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/check_no_argv.c deleted file mode 100644 index b711bf90..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/check_no_argv.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* NULL */ -#include "mice.h" /* daemon internals */ - -/*========================================================================*/ -/* Provide a common error engine by parsing with an empty option-set */ -/*========================================================================*/ -int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END, {NULL}, 0} - }; - return parse_argv(optioninfo, argc, argv); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/getsym.c deleted file mode 100644 index d152c405..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/getsym.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "daemon.h" - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - char c; - - c = *p++; - if (c == '\\' && *p) { - c = *p++; - if (isodigit(c)) { - c -= '0'; - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - if (isodigit(*p)) c = 8*c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/isodigit.c deleted file mode 100644 index 951c11a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/limit_delta.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/limit_delta.c deleted file mode 100644 index 7810d176..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/limit_delta.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/*========================================================================*/ -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ -/*========================================================================*/ - -int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : - delta < min ? min : delta; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/m_listtypes.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/m_listtypes.c deleted file mode 100644 index 4ef02a0d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/m_listtypes.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ -#include "message.h" /* texts */ -#include "daemon.h" /* mice */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for (type=mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/option_modem_lines.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/option_modem_lines.c deleted file mode 100644 index c3142923..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/option_modem_lines.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "message.h" /* messaging in gpm */ -#include "mice.h" /* daemon internals */ -#include "daemon.h" /* option */ - -/*========================================================================*/ -/* Parse the "old" -o options */ -/*========================================================================*/ -int option_modem_lines(int fd, int argc, char **argv) -{ - static int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value: TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END, u: {iptr: &lines}, 0} - }; - - if (argc<2) return 0; - if (argc > 2) { - gpm_report(GPM_PR_ERR,GPM_MESS_TOO_MANY_OPTS,option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) return 0; /* a message has been printed, but go on as good */ - - /* ok, move the lines */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/parse_argv.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/parse_argv.c deleted file mode 100644 index fb50dcfa..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/parse_argv.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isalnum */ -#include /* fprintf */ -#include /* strtol */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int parse_argv(argv_helper *info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - long l; - argv_helper *p; - char *s, *t; - int base = 0; /* for strtol */ - - - for (i=1; itype != ARGV_END; p++) { - j = strlen(p->name); - if (strncmp(p->name, argv[i], j)) - continue; - if (isalnum(argv[i][j])) - continue; - break; - } - if (p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* Found. Look for trailing stuff, if any */ - s = argv[i]+j; - while (*s && isspace(*s)) s++; /* skip spaces */ - if (*s == '=') s++; /* skip equal */ - while (*s && isspace(*s)) s++; /* skip other spaces */ - - /* Now parse what s is */ - switch(p->type) { - case ARGV_BOOL: - if (*s) { - gpm_report(GPM_PR_ERR,GPM_MESS_OPTION_NO_ARG, option.progname,p->name,s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if (*t) { - gpm_report(GPM_PR_ERR,GPM_MESS_INVALID_ARG, option.progname, s, p->name); - errors++; - break; - } - *(p->u.iptr) = (int)l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if (errors) gpm_report(GPM_PR_ERR,GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/read_mouse_id.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/read_mouse_id.c deleted file mode 100644 index 783b4d6b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/read_mouse_id.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read/write */ -#include "mice.h" /* Gpm_type */ - - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) { - return(GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return(id); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/setspeed.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/setspeed.c deleted file mode 100644 index d499de8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/setspeed.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ - - -int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags) -{ - struct termios tty; - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: tty.c_cflag = flags | B19200; break; - case 9600: tty.c_cflag = flags | B9600; break; - case 4800: tty.c_cflag = flags | B4800; break; - case 2400: tty.c_cflag = flags | B2400; break; - case 1200: - default: tty.c_cflag = flags | B1200; break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: c = "*r"; tty.c_cflag = flags | B19200; break; - case 9600: c = "*q"; tty.c_cflag = flags | B9600; break; - case 4800: c = "*p"; tty.c_cflag = flags | B4800; break; - case 2400: c = "*o"; tty.c_cflag = flags | B2400; break; - case 1200: - default: c = "*n"; tty.c_cflag = flags | B1200; break; - } - - if (needtowrite) write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/generic/write_to_mouse.c b/software/gpm/browse_source/gpm-1.99.6/src/generic/write_to_mouse.c deleted file mode 100644 index 54bd88d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/generic/write_to_mouse.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep */ -#include /* tcflush */ - -#include "mice.h" /* ‘GPM_AUX_ACK’ */ - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - unsigned int i; - int error = 0; - for (i = 0; i < len; i++) { - unsigned char c; - write(fd, &data[i], 1); - read(fd, &c, 1); - if (c != GPM_AUX_ACK) error++; - } - - /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); - return(error); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/daemon.h deleted file mode 100644 index 0e803a2d..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/daemon.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include "types.h" /* Internal types */ -#include /* fd_set */ - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); - -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -unsigned char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int isodigit(const unsigned char c); - -int limit_delta(int delta, int min, int max); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm-proto.h deleted file mode 100644 index fe53a6c3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm.h deleted file mode 100644 index 1d73ece5..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm.h +++ /dev/null @@ -1,301 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - - /* displacement x,y for this event, and absolute x,y */ - short dx, dy, x, y; - enum Gpm_Etype type; - - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - - - /* FIXME: this seems to be unused. if so, remove it */ - enum Gpm_Margin margin; - - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm2-import.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm2-import.h deleted file mode 100644 index 9ca1ae0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm2-import.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * Import stuff from gpm2 - */ - -#ifndef _GPM2_IMPORT_H -#define _GPM2_IMPORT_H - -int become_daemon(); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm2-messages.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm2-messages.h deleted file mode 120000 index 4bb5fe1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpm2-messages.h +++ /dev/null @@ -1 +0,0 @@ -gpm-1.99.6/../../gpm2/include/gpm2-messages.h \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/gpmCfg.h deleted file mode 100644 index 5d96a8f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpmCfg.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/gpmInt.h deleted file mode 100644 index 05ed6341..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/gpmInt.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*....................................... Structures */ - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/message.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/message.h deleted file mode 100644 index 83441637..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "Ooo.ps(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " PACKAGE_VERSION " git:" GPM_RELEASE_GIT ", " GPM_RELEASE_DATE -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mice. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/mice.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/mice.h deleted file mode 100644 index 982f1d09..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/mice.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Mice related - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_MICE_H -#define _GPM_MICE_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include "types.h" /* Gpm_Type */ - - -/************************************************************************* - * Macros - */ - -#define STD_FLG (CREAD|CLOCAL|HUPCL) -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ - -/*** mouse commands ***/ -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -#define abs(value) ((value) < 0 ? -(value) : (value)) - -/************************************************************************* - * Global variables - */ -extern int realposx; -extern int realposy; - - -/************************************************************************* - * Mice functions - */ - -int check_no_argv(int argc, char **argv); -int option_modem_lines(int fd, int argc, char **argv); -int parse_argv(argv_helper *info, int argc, char **argv); -int read_mouse_id(int fd); -int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags); -int write_to_mouse(int fd, unsigned char *data, size_t len); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/synaptics.h deleted file mode 100644 index 1c4c869f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/twiddler.h deleted file mode 100644 index 642651de..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/twiddler.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_TWIDDLER_H -#define _GPM_TWIDDLER_H - -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/headers/types.h b/software/gpm/browse_source/gpm-1.99.6/src/headers/types.h deleted file mode 100644 index 4e18bab1..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/headers/types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Types used by gpm internally only - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_TYPE_H -#define _GPM_TYPE_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Connect */ - -/************************************************************************* - * Types / structures - */ - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence, - *opt_calib, - *opt_options; /* extra textual configuration */ - int fd, - opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap, - opt_dminx, - opt_dmaxx, - opt_dminy, - opt_dmaxy, - opt_ominx, - opt_omaxx, - opt_ominy, - opt_omaxy; - Gpm_Type *m_type; -}; - -/*======================================================================== - * Parsing argv: helper dats struct function - *========================================================================*/ -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.6/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.99.6/src/lib/libcurses.c deleted file mode 100644 index 6cbff15f..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/lib/libcurses.c +++ /dev/null @@ -1,200 +0,0 @@ - -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "gpmInt.h" - -#ifdef HAVE_NCURSES_H -# include -#else -# ifdef HAVE_NCURSES_CURSES_H -# include -# else -# ifdef HAVE_CURSES_H -# include -# endif /* HAVE_CURSES_H */ -# endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW * win) -{ - fd_set selSet; - int max, flag, result; - int fd = STDIN_FILENO; - static Gpm_Event ev; - - if(!gpm_flag || gpm_fd == -1) - return GET(win); - if(gpm_morekeys) - return (*gpm_handler) (&ev, gpm_data); - gpm_hflag = 0; - - max = (gpm_fd > fd) ? gpm_fd : fd; - -/*...................................................................*/ - if(gpm_fd >= 0) /* linux */ - while(1) { - if(gpm_visiblepointer) - GPM_DRAWPOINTER(&ev); - do { - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - FD_SET(gpm_fd, &selSet); - gpm_timeout.tv_sec = SELECT_TIME; - flag = - select(max + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &gpm_timeout); - } - while(!flag); - - if(FD_ISSET(fd, &selSet)) - return GET(win); - - if(flag == -1) - continue; - - if(Gpm_GetEvent(&ev) && gpm_handler - && (result = (*gpm_handler) (&ev, gpm_data))) { - gpm_hflag = 1; - return result; - } - } else - -/*...................................................................*/ - if(gpm_fd == -2) { /* xterm */ -#define DELAY_MS 100 - static struct timeval to = { 0, DELAY_MS * 1000 }; - static fd_set selSet; - -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar = 0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(unsigned char *data, Gpm_Event * event); - int c; - unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if(nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - -/* if ungetc() didn't suffice... */ - -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) { - do { - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - gpm_timeout.tv_sec = SELECT_TIME; - flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &gpm_timeout); - } - while(!flag); - - if((c = GET(win)) != 0x1b) - return c; - - /* - * escape: go on - */ - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - to.tv_usec = DELAY_MS * 1000; - if((flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &to)) == 0) - return c; - if((c = GET(win)) != '[') { - prevchar[nbprevchar++] = c; - return 0x1B; - } - - /* - * patche par JD 11/08/1998 - */ - /* - * {ungetc(c,stdin); return 0x1B;} - */ - /* - * '[': go on - */ - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - to.tv_usec = DELAY_MS * 1000; - - if((flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &to)) == 0) { - prevchar[nbprevchar++] = c; - return 0x1B; - } - - /* - * patche par JD 11/08/1998 - */ - /* - * {ungetc(c,stdin); return 0x1B;} - */ - if((c = GET(win)) != 'M') - /* - * patche par JD 11/08/1998 NOTICE: prevchar is a lifo ! - */ - { - prevchar[nbprevchar++] = c; - prevchar[nbprevchar++] = '['; - return 0x1B; - } - /* - * {ungetc(c,stdin);prevchar='['; return 0x1B;} - */ - - /* - * now, it surely is a mouse event - */ - - for(c = 0; c < 3; c++) - mdata[c] = GET(win); - gpm_convert_event(mdata, &ev); - - if(gpm_handler && (result = (*gpm_handler) (&ev, gpm_data))) { - gpm_hflag = 1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.99.6/src/lib/libhigh.c deleted file mode 100644 index c1dcd119..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/lib/libhigh.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "gpmInt.h" - -Gpm_Roi *gpm_roi=NULL; -Gpm_Roi *gpm_current_roi=NULL; -Gpm_Handler *gpm_roi_handler=NULL; -void *gpm_roi_data; - - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata) -{ -Gpm_Roi *new; - - /* create a Roi and push it */ - new=(Gpm_Roi *)malloc(sizeof(Gpm_Roi)); - if (!new) return NULL; - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - new->xMin=x; new->xMax=X; - new->yMin=y; new->yMax=Y; - new->minMod=0; new->maxMod=~0; - new->prev = new->next=NULL; - new->eventMask=mask; - new->owned=0; /* use free() */ - new->handler=fun; - new->clientdata = xtradata ? xtradata : (void *)new; - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi *new) -{ - /* use a Roi by pushing it */ - new->prev = new->next=NULL; - new->owned=1; /* don't free() */ - - /* use the roi handler, if still null */ - if (!gpm_roi && !gpm_handler) - gpm_handler=Gpm_HandleRoi; - - return Gpm_RaiseRoi(new,NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi *which) -{ - /* extract the Roi and remove it */ - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - if (which->owned==0) free(which); - if (gpm_current_roi==which) - gpm_current_roi=NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before) -{ - /* raise a Roi above another, or to top-of-stack */ - if (!gpm_roi) - return gpm_roi=which; - if (!before) before=gpm_roi; - if (before==which) return gpm_roi; - - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->prev=before->prev; before->prev=which; - which->next=before; - - if (which->prev) which->prev->next=which; - else gpm_roi=which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after) -{ - /* lower a Roi below another, or to bottom-of-stack */ - if (!after) - for (after=gpm_roi; after->next; after=after->next) - ; - if (after==which) return gpm_roi; - if (which->prev) which->prev->next = which->next; - if (which->next) which->next->prev = which->prev; - if (gpm_roi==which) gpm_roi=which->next; - - which->next=after->next; after->next=which; - which->prev=after; - - if (which->next) which->next->prev=which; - - return gpm_roi; /* return the new top-of-stack */ -} - - - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -{ - static Gpm_Event backEvent; - Gpm_Roi *roi=gpm_current_roi; - - clientdata = NULL; /* FIXME: gpm 1.99.13 */ - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if (ePtr->type&(GPM_MOVE|GPM_DOWN)) - for (roi=gpm_roi; roi; roi=roi->next) - { - if (roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if (roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if ((roi->minMod & ePtr->modifiers) < roi->minMod) continue; - if ((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if (roi!=gpm_current_roi) - { - if (gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) - { - backEvent.type=GPM_LEAVE; - (*(gpm_current_roi->handler))(&backEvent,gpm_current_roi->clientdata); - } - if (roi && (roi->eventMask & GPM_ENTER)) - { - backEvent.type=GPM_ENTER; - (*(roi->handler))(&backEvent,roi->clientdata); - } - } - gpm_current_roi=roi; - - /* - * events not requested are discarded - */ - if (roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent=*ePtr; /* copy it, so the main one is unchanged */ - if (!roi) - { - if (gpm_roi_handler) - return (*gpm_roi_handler)(&backEvent,gpm_roi_data); - return 0; - } - - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler))(&backEvent,roi->clientdata); -} - diff --git a/software/gpm/browse_source/gpm-1.99.6/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.99.6/src/lib/liblow.c deleted file mode 100644 index c0f085aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/lib/liblow.c +++ /dev/null @@ -1,661 +0,0 @@ -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -#include -#include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "gpmInt.h" -#include "message.h" - -#ifndef min -#define min(a,b) ((a)<(b) ? (a) : (b)) -#define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag=0; /* almost unuseful now -- where was it used for ? can - we remove it now ? FIXME */ -int gpm_tried=0; -int gpm_fd=-1; -int gpm_hflag=0; -Gpm_Stst *gpm_stack=NULL; -struct timeval gpm_timeout={10,0}; -Gpm_Handler *gpm_handler=NULL; -void *gpm_data=NULL; -int gpm_zerobased=0; -int gpm_visiblepointer=0; -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6*sizeof(short)]; -unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -int gpm_consolefd=-1; /* used to invoke ioctl() */ -int gpm_morekeys=0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect *what) -{ -#ifdef GPM_USE_MAGIC - static int magic=GPM_MAGIC; - - if (write(where,&magic,sizeof(int))!=sizeof(int)) { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } -#endif - if (write(where,what,sizeof(Gpm_Connect))!=sizeof(Gpm_Connect)) - { - gpm_report(GPM_PR_ERR,GPM_MESS_WRITE_ERR,strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook (int signum) -{ - struct winsize win; - - if (SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ - if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { - win.ws_col=80; win.ws_row=25; - } /*if*/ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook (int success) /* misuse the parameter */ -{ - Gpm_Connect gpm_connect; - sigset_t old_sigset; - sigset_t new_sigset; - struct sigaction sa; - - - sigemptyset (&new_sigset); - sigaddset (&new_sigset, SIGTSTP); - sigprocmask (SIG_BLOCK, &new_sigset, &old_sigset); - - /* Open a completely transparent gpm connection */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* cannot do this under xterm, tough */ - success = (Gpm_Open (&gpm_connect, 0) >= 0); - - /* take the default action, whatever it is (probably a stop :) */ - sigprocmask (SIG_SETMASK, &old_sigset, 0); - sigaction (SIGTSTP, &gpm_saved_suspend_hook, 0); - kill (getpid (), SIGTSTP); - - /* in bardo here */ - - /* Reincarnation. Prepare for another death early. */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction (SIGTSTP, &sa, 0); - - /* Pop the gpm stack by closing the useless connection */ - /* but do it only when we know we opened one.. */ - if (success) { - Gpm_Close (); - } /*if*/ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect *conn, int flag) -{ - char *tty = NULL; - char *term = NULL; - int i; - struct sockaddr_un addr; - struct winsize win; - Gpm_Stst *new = NULL; - char* sock_name = 0; - static char *consolename = NULL; - - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; - } - /*....................................... No xterm, go on */ - - /* check whether we know what name the console is: what's with the lib??? */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if (!gpm_flag && gpm_tried) return -1; - gpm_tried=1; /* do or die */ - - if ((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next=gpm_stack; - gpm_stack=new; - - conn->pid=getpid(); /* fill obvious values */ - - if (new->next) - conn->vc=new->next->info.vc; /* inherit */ - else { - conn->vc=0; /* default handler */ - if (flag > 0) { /* forced vc number */ - conn->vc=flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ - if (tty == NULL) { - gpm_report(GPM_PR_ERR,"checking tty name failed"); - goto err; - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); - } else /* a default handler -- use console */ - tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,tty,strerror(errno)); - goto err; - } - } - - new->info=*conn; - - /*....................................... Get screen dimensions */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col=80; win.ws_row=25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /*....................................... Connect to the control socket */ - - if (!(gpm_flag++)) { - if ( (gpm_fd=socket(AF_UNIX,SOCK_STREAM,0))<0 ) { - gpm_report(GPM_PR_ERR,GPM_MESS_SOCKET,strerror(errno)); - goto err; - } - -#ifndef SO_PEERCRED - memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); - goto err; - } - strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path)); - if (bind (gpm_fd, (struct sockaddr*)&addr, - sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); - - if(connect(gpm_fd,(struct sockaddr *)(&addr),i)<0 ) { - struct stat stbuf; - - gpm_report(GPM_PR_INFO,GPM_MESS_DOUBLE_S,GPM_NODE_CTL,strerror(errno)); - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) { - gpm_report(GPM_PR_ERR,GPM_MESS_DOUBLE_S,GPM_NODE_DEV - ,strerror(errno)); - goto err; - } - if (fstat(gpm_fd,&stbuf)==-1 || (stbuf.st_mode&S_IFMT)!=S_IFCHR) { - goto err; - } - } - } - /*....................................... Put your data */ - - if (putdata(gpm_fd,conn)!=-1) { - /* itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old - code caused a signal loop under XEmacs */ - struct sigaction sa; - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* And the winch hook .. */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if (gpm_flag == 1) { - /* Install suspend hook */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* if signal was originally ignored, job control is not supported */ - if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; - } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag=0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried=0; /* reset the error flag for next time */ - if (gpm_fd==-2) /* xterm */ - GPM_XTERM_OFF; - else /* linux */ - { - if (!gpm_flag) return 0; - next=gpm_stack->next; - free(gpm_stack); - gpm_stack=next; - if (next) - putdata(gpm_fd,&(next->info)); - - if (--gpm_flag) return -1; - } - - if (gpm_fd>=0) close(gpm_fd); - gpm_fd=-1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd=-1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event *event) -{ - int count; - MAGIC_P((int magic)); - - if (!gpm_flag) return 0; - -#ifdef GPM_USE_MAGIC - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d",count,__FILE__,__LINE__); - return -1; - } -#endif - - if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) - { -#ifndef GPM_USE_MAGIC - if (count==0) - { - gpm_report(GPM_PR_INFO,"Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if (count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO,"Read too few bytes (%i) at %s:%d", - count,__FILE__,__LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued () -{ - return nbprevchar; -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE *f) -{ - fd_set selSet; - int max, flag, result; - static Gpm_Event ev; - int fd=fileno(f); - static int count; - - /* Hmm... I must be sure it is unbuffered */ - if (!(count++)) - setvbuf(f,NULL,_IONBF,0); - - if (!gpm_flag) return getc(f); - - /* If the handler asked to provide more keys, give them back */ - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); - gpm_hflag=0; - - max = (gpm_fd>fd) ? gpm_fd : fd; - - /*...................................................................*/ - if (gpm_fd>=0) /* linux */ - while(1) - { - if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); - do - { - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - if (gpm_fd>-1) - FD_SET(gpm_fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if (flag==-1) - continue; - - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - - if (Gpm_GetEvent(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } - else - /*...................................................................*/ - if (gpm_fd==-2) /* xterm */ - { -#define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; - extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) - { - do - { - FD_ZERO(&selSet); FD_SET(fd,&selSet); - gpm_timeout.tv_sec=SELECT_TIME; - flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); - } - while (!flag); - - if ((c=fgetc(f))!=0x1b) return c; - - /* escape: go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - return c; - if ((c=fgetc(f))!='[') - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - - /* '[': go on */ - FD_ZERO(&selSet); FD_SET(fd,&selSet); to.tv_usec=DELAY_MS*1000; - if ((flag=select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to))==0) - {prevchar[nbprevchar++]=c; return 0x1B;} /* patche par JD 11/08/1998 */ - if ((c=fgetc(f))!='M') - /* patche par JD 11/08/1998 NOTICE: prevchar is a lifo !*/ - {prevchar[nbprevchar++]=c; prevchar[nbprevchar++]='['; return 0x1B;} - - /* now, it surely is a mouse event */ - - for (c=0;c<3;c++) mdata[c]=fgetc(f); - gpm_convert_event(mdata,&ev); - - if (gpm_handler && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; - return result; - } - } /* while(1) */ - } - - /*...................................................................*/ - else return fgetc(f); /* no mouse available */ -} - - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to={0,1000*msec}; - int fd; - fd_set selSet; - fd=gpm_fd>=0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd,&selSet); - return (select(fd+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&to)==0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if (margin==-1) - { - *x = min( max(*x,!gpm_zerobased), gpm_mx); - *y = min( max(*y,!gpm_zerobased), gpm_my); - return 0; - } - switch(margin) - { - case GPM_TOP: (*y)++; break; - case GPM_BOT: (*y)--; break; - case GPM_RGT: (*x)--; break; - case GPM_LFT: (*x)++; break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -{ - static struct timeval tv1={0,0}, tv2; - static int clicks=0; - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - - /* Variable btn has following meaning: */ - c = mdata[0]-32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if (c==3) - { - ePtr->type = GPM_UP | (GPM_SINGLE<buttons = 0; */ /* no, keep info from press event */ - GET_TIME (tv1); - clicks = 0; - } - else - { - ePtr->type = GPM_DOWN; - GET_TIME (tv2); - if (tv1.tv_sec && (DIF_TIME(tv1,tv2)<250)) /* 250ms for double click */ - {clicks++; clicks%=3;} - else clicks = 0; - - switch (c) - { - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; - default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ - /* Transform them to 1-based */ - ePtr->x = mdata[1]-32-gpm_zerobased; - ePtr->y = mdata[2]-32-gpm_zerobased; - return 0; -} - -/* Local Variables: */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.99.6/src/lib/libxtra.c deleted file mode 100644 index fa5471a9..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "gpmInt.h" -#include "message.h" - - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -static char *gpml_ver_s=PACKAGE_VERSION; -static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - int i,j,k=0; - - if (!gpml_ver_i) - { - sscanf(gpml_ver_s,"%d.%d.%d",&i,&j,&k); - gpml_ver_i=i*10000+j*100+k; - } - if (where) *where=gpml_ver_i; - return gpml_ver_s; -} - -static char gpm_ver_s[16]; -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - FILE *f; - int i,j,k=0; - - if (!gpm_ver_s[0]) - { - f=popen(SBINDIR "/gpm -v","r"); - if (!f) return NULL; - fgets(line,128,f); - if (pclose(f)) return 0; - sscanf(line,"%*s %s",gpm_ver_s); /* "gpm-Linux 0.98, March 1995" */ - gpm_ver_s[strlen(gpm_ver_s)-1]='\0'; /* cut the ',' */ - - sscanf(gpm_ver_s,"%d.%d.%d",&i,&j,&k); - gpm_ver_i=i*10000+j*100+k; - } - - if (where) *where=gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event *ePtr) -{ - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; - - if (!gpm_ver_i) { - if (0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN,"can't get gpm server version"); - } /*if*/ - gpm_report(GPM_PR_INFO,"libgpm: got server version as %i",gpm_ver_i); - } - if (gpm_ver_i<9802) { - gpm_report(GPM_PR_INFO,"gpm server version too old to obtain status info"); - return -1; /* error */ - } - if (gpm_fd <=0) - { - gpm_report(GPM_PR_INFO,"gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid=0; /* this signals a request */ - if (ePtr) - conn.vc=GPM_REQ_SNAPSHOT; - else - { - conn.vc=GPM_REQ_BUTTONS; - ePtr=&event; - } - - if (gpm_fd==-1) return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd,&sillySet); - if (select(gpm_fd+1,&sillySet,NULL,NULL,&to)==1) - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - - if ((i=Gpm_GetEvent(ePtr))!=1) - return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ -} - - -/* Local Variables: */ -/* c-indent-level: 2 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.99.6/src/lib/report-lib.c deleted file mode 100644 index b4ec783b..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/lib/report-lib.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "message.h" - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - char *string = NULL; - int log_level = LOG_DEBUG; - va_list ap; - - line = 0; /* FIXME: gpm 1.99.13 */ - file = NULL; - - va_start(ap,text); - - switch(stat) { - case GPM_STAT_INFO : string = GPM_TEXT_INFO ; - log_level = LOG_INFO; break; - case GPM_STAT_WARN : string = GPM_TEXT_WARN ; - log_level = LOG_WARNING; break; - case GPM_STAT_ERR : string = GPM_TEXT_ERR ; - log_level = LOG_ERR; break; - case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; break; - case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/mice.c b/software/gpm/browse_source/gpm-1.99.6/src/mice.c deleted file mode 100644 index 9288d8fe..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/mice.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * mice.c - table of mice for gpm - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* for FLAGS */ - - -#include "mice.h" -#include "drivers.h" - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to mice.h and drivers/ - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * - * Finally, a pointer to a repeater function, if any. - * - */ - -Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, - {"evabs", "Linux Event Device - absolute mode", - "", M_evabs, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -}; diff --git a/software/gpm/browse_source/gpm-1.99.6/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.99.6/src/prog/disable-paste.c deleted file mode 100644 index b2dacae0..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/prog/disable-paste.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "gpm.h" -#include "gpmInt.h" - -int main() -{ - Gpm_Connect conn; - const int len = sizeof(Gpm_Connect); - int exit_status = 0; - conn.eventMask = (unsigned short)(-1); conn.defaultMask = 0; - conn.minMod = 0; conn.maxMod = (unsigned short)(-1); - - if (0 > Gpm_Open(&conn,0)) { - fprintf(stderr,"disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if (len > write(gpm_fd, &conn, len)) { - fprintf(stderr,"disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/prog/display-buttons.c b/software/gpm/browse_source/gpm-1.99.6/src/prog/display-buttons.c deleted file mode 100644 index 64ef1635..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/prog/display-buttons.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-buttons -lgpm display-buttons.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * left/middle/right button - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%ld] delta: %ds",now,delta); - - /* display mouse information */ - printf(": p=%d, l=%1d, m=%1d, r=%1d, clicks=%d\n", - event->type & GPM_DOWN, - event->buttons & GPM_B_LEFT, - event->buttons & GPM_B_MIDDLE, - event->buttons & GPM_B_RIGHT, - event->clicks); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_DRAG | GPM_DOWN | GPM_UP; - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - printf("\tp=pressed (0=release)\n\tl=left\n\tm=middle\n\tr=right\n"); - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/prog/display-coords.c b/software/gpm/browse_source/gpm-1.99.6/src/prog/display-coords.c deleted file mode 100644 index b03eb701..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/prog/display-coords.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-coords -lgpm display-coords.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * x/y coords on the screen - * dx, dy: deltas - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event *event) -{ - static time_t last = 0; - time_t now = time(NULL); - int delta; - - delta = now - last; - last = now; - - /* display time, delta time */ - printf("[%ld] delta: %ds",now,delta); - - /* display mouse information */ - printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - Gpm_Connect conn; /* connection to gpm */ - fd_set fds; - - /* select virtual console, 0 if not set */ - vc = (argc == 2) ? strtol(argv[1],NULL,10) : 0; - - conn.eventMask = GPM_MOVE; /* read only moves */ - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn,vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if (select(gpm_fd+1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - display_data(&evt); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.99.6/src/prog/gpm-root.y deleted file mode 100644 index 84ed58de..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/prog/gpm-root.y +++ /dev/null @@ -1,1321 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* OPEN_MAX */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "message.h" -#include "gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ - return 0; /* just a placeholder, recursion is performed in main() */ -} - - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - uid = 0; /* FIXME: gpm 1.99.13 */ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > (int) strlen(item->name) ? wid : (int) strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - f = NULL; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - f = NULL; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS((unsigned char *)draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS((unsigned char *)item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - signo = 0; /* FIXME in 1.99.13 */ - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.99.6/src/prog/hltest.c deleted file mode 100644 index 805b332e..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/prog/hltest.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpm.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - - - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei,wid; - Gpm_Roi *roi; - } WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[]={0x40,0x60,0x20,0x30,0x47,0x67,0x27,0x37}; -#define NR_COLORS 8 -#define LEFTWID 22 -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs=-1; -int wid,hei,vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return read(dev_vcs,buf,vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fileno(stdin),TIOCLINUX,clear_sel_arg); - lseek (dev_vcs, 0, SEEK_SET); - return write(dev_vcs,buf,vcsize); -} - - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag &= ~(ICANON); -it.c_lflag &= ~(ECHO); -it.c_iflag &= ~(INPCK|ISTRIP|IXON); -it.c_oflag &= ~(OPOST); -it.c_cc[VMIN] = 1; -it.c_cc[VTIME] = 0; - -tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -static void noraw(void) -{ -struct termios it; - -tcgetattr(fileno(stdin),&it); -it.c_lflag |= ICANON; -it.c_lflag |= ECHO; -it.c_iflag |= IXON; -it.c_oflag |= OPOST; - -tcsetattr(fileno(stdin),TCSANOW,&it); -} - - - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr,"hltest: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -char *dumpbuf; -char *dumpbuf_clean; -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi *which) -{ -char *curr; -char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int attrib=((WinInfo *)which->clientdata)->color; -int i,j; - - /* top border */ - GOTO(which->xMin,which->yMin); - PUTC(ULCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(URCORNER,attrib); - - /* sides and items */ - for (j=which->yMin+1;jyMax;j++) - { - GOTO(which->xMin,j); - PUTC(VERLINE,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(' ',attrib); - PUTC(VERLINE,attrib); - } - - /* bottom border */ - GOTO(which->xMin,which->yMax); - PUTC(LLCORNER,attrib); - for (i=which->xMin+1; ixMax; i++) - PUTC(HORLINE,attrib); - PUTC(LRCORNER,attrib); - - /* name */ - sprintf(name,"%3i",((WinInfo *)which->clientdata)->number); - GOTO(which->xMin+1,which->yMin+1); - for (i=0;name[i];i++) - PUTC(name[i],attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi *this) -{ - if (this->next) - drawthemall(this->next); - else - memcpy(dumpbuf,dumpbuf_clean,vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data=NULL; - static char **strings; - static int current, last; - static time_t t; - int i,j; - - /* first time, alloc material */ - if (!data) - { - data=malloc((LEFTWID-2)*(hei-2)); - strings=malloc(hei*sizeof(char *)); - if(!data || !strings) { perror("malloc()"); exit(1); } - memset(data,' ',(LEFTWID-2)*(hei-2)); - for (i=0;inumber; -int delta; - - if (ePtr->type&GPM_ENTER) - { newmsg(number,"enter"); return 0; } - if (ePtr->type&GPM_LEAVE) - { newmsg(number,"leave"); return 0; } - if (ePtr->type&GPM_MOVE) - { newmsg(number,"move"); return 0; } - - if (ePtr->type&GPM_DOWN) - {newmsg(number,"press"); return 0; } - if (ePtr->type&GPM_DRAG) - { - newmsg(number,"drag"); - if (!(ePtr->buttons&GPM_B_LEFT)) return 0; - - /* - * Implement window motion - */ - delta=0; - if (ePtr->dx < 0) delta=max(ePtr->dx,LEFTWID-info->roi->xMin); - else if (ePtr->dx > 0) delta=min(ePtr->dx,wid-1 - info->roi->xMax); - if (delta) { info->roi->xMin+=delta; info->roi->xMax+=delta; } - - delta=0; - if (ePtr->dy < 0) delta=max(ePtr->dy,0 - info->roi->yMin); - else if (ePtr->dy > 0) delta=min(ePtr->dy,hei-1 - info->roi->yMax); - if (delta) { info->roi->yMin+=delta; info->roi->yMax+=delta; } - Gpm_RaiseRoi(info->roi,NULL); - dorefresh(); return 0; - } - - newmsg(number,"release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if (!(ePtr->type&GPM_SINGLE)) return 0; - if (ePtr->x<0 || ePtr->y<0) return 0; - if (ePtr->x>info->wid-1 || ePtr->y>info->hei-1) return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch(ePtr->buttons) - { - case GPM_B_LEFT: Gpm_RaiseRoi(info->roi,NULL); break; - case GPM_B_MIDDLE: Gpm_LowerRoi(info->roi,NULL); break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); free(info); break; - } - dorefresh(); - return 0; -} - - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno=0; - Gpm_Roi*roi; - WinInfo *cldata; - int tmp; - - if (X=wid) X=wid-1; - if (Y>=hei) Y=hei-1; - if (xmaxMod=0; - - /* put a backpointer */ - cldata->roi=roi; - - /* init the window */ - winno++; - cldata->number=winno; - cldata->color=colors[winno%NR_COLORS]; - cldata->wid=X-x+1; - cldata->hei=Y-y+1; - dorefresh(); -return 0; -} - - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event *ePtr, void *clientdata) -{ -static int x=0,y=0; -int back=0; -char msg[32]; - -msg[0]='\0'; -if (ePtr->type==GPM_MOVE) return 0; -if (!clientdata) - strcpy(msg,"bg"),back++; - -if (ePtr->type&GPM_DOWN) - { - strcat(msg," down"); - if (back) x=ePtr->x,y=ePtr->y; - } -if (ePtr->type&GPM_UP) - { - strcat(msg," up"); - if (back) wincreate(x,y,ePtr->x,ePtr->y); - } - -newmsg(0,msg); -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ -return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char *s, t[4]; - char devname[32]; /* very secure buffer ... */ - int c; - int vc; - struct winsize win; - - if (argc>1) { - fprintf(stderr,"%s: This program is meant to be interactive, " - "no option is needed\n",argv[0]); - exit(1); - } - - if (!(s=ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* retrieve everything */ - conn.eventMask=~0; - conn.defaultMask=GPM_MOVE|GPM_HARD; - conn.maxMod=~0; - conn.minMod=0; - - if (sscanf(s,"/dev/tty%d%s",&vc,t)!=1) { - if (sscanf(s,"/dev/vc/%d%s",&vc,t)!=1) { - fprintf(stderr,"stdin: not a system console\n"); - exit(1); - } - } - - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcs%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - sprintf(devname,"/dev/vcc/%i",vc); - if ((dev_vcs=open(devname,O_RDWR))<0) { - perror(devname); - exit(1); - } - } - - if (Gpm_Open(&conn,0) == -1) { - fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH,killed); /* don't handle winchange */ - signal(SIGINT,killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n" - ); - - /* Ok, now retrieve window info, go to raw mode, and start it all */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid=win.ws_col; hei=win.ws_row; - vcsize=hei*wid*2+4; - dumpbuf=malloc(vcsize); dumpbuf_clean=malloc(vcsize); - if (!dumpbuf || ! dumpbuf_clean) - { perror("malloc()"); exit(1); } - scrdump(dumpbuf_clean); - - gpm_zerobased=1; gpm_visiblepointer=1; - if (Gpm_Open(&conn,0)==-1) - { fprintf(stderr,"%s: Can't open mouse connection\n",argv[0]); exit(1); } - - /* Prepare the leftish roi, and the catch-all on the background */ - left_cldata.color=0x07; left_cldata.number=0; - left_cldata.hei=hei; left_cldata.wid=LEFTWID; - Gpm_PushRoi(0,0,LEFTWID-1,hei-1, - GPM_DOWN|GPM_DRAG|GPM_UP|GPM_ENTER|GPM_LEAVE, - xhandler,&left_cldata); - gpm_roi_handler=xhandler; - gpm_roi_data=NULL; - - raw(); - newmsg(0,NULL); /* init data structures */ - while((c=Gpm_Getchar())!=EOF) { - char s[32]; - Gpm_Roi *roi; - - roi=gpm_current_roi; - sprintf(s,"0x%x",c); - if (c>0x1f && c<0x7f) - sprintf(s+strlen(s)," ('%c')",c); - newmsg(roi ? ((WinInfo *)roi->clientdata)->number : 0,s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/prog/mev.c b/software/gpm/browse_source/gpm-1.99.6/src/prog/mev.c deleted file mode 100644 index 8a5c78da..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/prog/mev.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event *event, void *data) -{ - int i,j; - static int dragX, dragY; - static char buffer[64]; - - data = NULL; /* FIXME: unused */ - - /* itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - alphabetical order, so I'll use a lookup table instead of a loop; it - is faster anyways */ - /* static char *s_mod[]={"S-","M-","C-","M-",NULL}; */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* idea: maybe we should map AltGr to Emacs Alt instead of Meta? */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event - is our `up' event with coordinates different from the `down' - event. What gpm calls `drag' is just `mouse-movement' to emacs. */ - - static char *s_type[]={"mouse-movement", "mouse-movement","down-mouse-","mouse-",NULL}; - static char *s_button[]={"3","2","1",NULL}; - static char *s_multi[]={"double-", "triple-", 0}; - static char s_count[]="23"; - char count = '1'; - struct timeval tv_cur; - long timestamp; - static long dragTime; - - /* itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even - if the final coordinates of a drag are identical to the initial - ones, it is still a drag if there was any movement in between. Sigh. */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short)tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if (opt_fit) Gpm_FitEvent(event); - buffer[0]=0; - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) { - /* modifiers */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* multiple */ - for (i=0, j=GPM_DOUBLE; s_multi[i]; i++, j<<=1) - if (event->type & j) { - count = s_count[i]; - strcat(buffer,s_multi[i]); - } /*if*/ - } /*if*/ - - if (event->type & GPM_DRAG) { - dragFlag = 1; - } /*if*/ - - /* itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. */ - if ((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } /*if*/ - - /* type */ - for (i=0, j=GPM_MOVE; s_type[i]; i++, j<<=1) - if (event->type & j) - strcat(buffer,s_type[i]); - - /* itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand - modifiers on motion events. */ - if (!(event->type & (GPM_MOVE|GPM_DRAG))) - /* button */ - for (i=0, j=GPM_B_RIGHT; s_button[i]; i++, j<<=1) - if (event->buttons & j) - strcat(buffer,s_button[i]); - - if ((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, - count, - dragX, dragY, dragTime); - } else if (event->type & (GPM_DOWN|GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if (event->type & (GPM_MOVE|GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", - buffer, event->x, event->y, timestamp); - } /*if*/ - - if (event->type & GPM_DOWN) { - dragX=event->x; - dragY=event->y; - dragTime=timestamp; - dragFlag = 0; - } /*if*/ - - if (event->type & (GPM_DRAG|GPM_DOWN)) { - if (0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /*if*/ - } /*if*/ - - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - //printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf( "(" GPM_NAME ") , " GPM_DATE "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n" - ); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int* where) -{ - int last=0, value=0; - char *cur; - struct node *table, *n; - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if ('+' == arg[0]) { - mode = 1; - ++arg; - } else if ('-' == arg[0]) { - mode = 2; - ++arg; - } - - if (isdigit(arg[0])) { - switch(mode) { - case 0: *where = atoi(arg); break; - case 1: *where |= atoi(arg); break; - case 2: *where &= ~atoi(arg); break; - } /*switch*/ - return; - } /*if*/ - - table= (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while (1) - { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) - { - value |= n->flag; - break; - } - if (!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - - cur++; arg=cur; - } - - switch(mode) { - case 0: *where = value; break; - case 1: *where |= value; break; - case 2: *where &= ~value; break; - } /*switch*/ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while ((opt = getopt(argc, argv, options)) != -1) - { - switch (opt) - { - /* itz Tue Mar 24 17:11:52 PST 1998 i hate options that do - too much. Made them orthogonal. */ - - case 'C': sscanf(optarg,"%x",&opt_vc); break; - case 'd': getmask(optarg, PARSE_EVENTS, &opt_default); break; - case 'e': getmask(optarg, PARSE_EVENTS, &opt_mask); break; - case 'E': opt_emacs = 1; break; - case 'i': opt_intrct=1; break; - case 'f': opt_fit=1; break; - case 'm': getmask(optarg, PARSE_MODIFIERS, &opt_minMod); break; - case 'M': getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); break; - case 'p': opt_pointer =1; break; - case 'u': opt_emacs=0; break; - default: return 1; - } - } - return 0; -} - -void -do_snapshot() -{ - Gpm_Event event; - int i=Gpm_GetSnapshot(&event); - char *s; - - if (-1 == i) { - fprintf(stderr,"Warning: cannot get snapshot!\n"); - fprintf(stderr,"Have you run \"configure\" and \"make install\"?\n"); - return; - } /*if*/ - - fprintf(stderr,"Mouse has %d buttons\n",i); - fprintf(stderr,"Currently sits at (%d,%d)\n",event.x,event.y); - fprintf(stderr,"The window is %d columns by %d rows\n",event.dx,event.dy); - s=Gpm_GetLibVersion(&i); - fprintf(stderr,"The library is version \"%s\" (%i)\n",s,i); - s=Gpm_GetServerVersion(&i); - fprintf(stderr,"The daemon is version \"%s\" (%i)\n",s,i); - fprintf(stderr,"The current console is %d, with modifiers 0x%02x\n", - event.vc,event.modifiers); - fprintf(stderr,"The button mask is 0x%02X\n",event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) /* returns 0 on success and !=0 on error */ -{ - Gpm_Connect conn; - int argc=0; - char *argv[20]; - - if (*cmd && cmd[strlen(cmd)-1]=='\n') - cmd[strlen(cmd)-1]='\0'; - if (!*cmd) return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while (argc<19) - { - while(isspace(*cmd)) cmd++; - argv[argc++]=cmd; - while (*cmd && isgraph(*cmd)) cmd++; - if (!*cmd) break; - *cmd=0; - cmd++; - } - argv[argc]=NULL; - - if (!strcmp(argv[0],"pop")) { - return (Gpm_Close()==0 ? 1 : 0); /* a different convention on ret values */ - } /*if*/ - - if (!strcmp(argv[0],"info")) { - fprintf(stderr,"The stack of connection info is %i depth\n",gpm_flag); - return 0; - } /*if*/ - - if (!strcmp(argv[0],"quit")) { - exit(0); - } /*if*/ - - if (!strcmp(argv[0],"snapshot")) { - do_snapshot(); - return 0; - } /*if*/ - - optind=0; /* scan the entire line */ - if (strcmp(argv[0],"push") || cmdline(argc,argv,"d:e:m:M:")) { - fprintf(stderr,"Syntax error in input line\n"); - return 0; - } /*if*/ - - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc)==-1) - { - fprintf(stderr,"%s: Can't open mouse connection\r\n",argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - char cmd[128]; - Gpm_Handler* my_handler; /* not the real gpm handler! */ - fd_set readset; - - prgname=argv[0]; - - if (cmdline(argc,argv,"C:d:e:Efim:M:pu")) exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask=opt_mask; - conn.defaultMask=opt_default; - conn.maxMod=opt_maxMod; - conn.minMod=opt_minMod; - - if (Gpm_Open(&conn,opt_vc) == -1) { - gpm_report(GPM_PR_ERR,"%s: Can't open mouse connection\n",prgname); - exit(1); - } else if (gpm_fd == -2) { - gpm_report(GPM_PR_OOPS,"%s: use rmev to see gpm events in xterm or rxvt\n",prgname); - } - - gpm_report(GPM_PR_DEBUG,"STILL RUNNING_1"); - - my_handler= opt_emacs ? emacs_handler : user_handler; - - /* itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if (opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if (select(gpm_fd+1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if (FD_ISSET(STDIN_FILENO, &readset)) { - if (0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - if (Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } /*if*/ - - } /*while*/ - - /*....................................... Done */ - - while (Gpm_Close()); /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.99.6/src/prog/mouse-test.c deleted file mode 100644 index 5569d8d3..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/prog/mouse-test.c +++ /dev/null @@ -1,744 +0,0 @@ -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "message.h" /* to print */ -#include "gpmInt.h" /* to get mouse types */ -#include "daemon.h" /* FIXME: do not use that..rewrite mouse-test, anyway */ -#include "drivers.h" - -#ifndef min -#define min(a,b) ((a)>(b)?(b):(a)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -Gpm_Type *(*mt_I_serial)(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv); - -int realposx=-1; -int realposy=-1; - - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - (char *)NULL /* extra */, - -1 /* fd */, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, - DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (Gpm_Type *)NULL -}; - -/* and this is a workaroud */ -struct winsize win; -/* this too */ -struct options option; - -struct mouse_features *which_mouse=&mymouse; - -char *progname; -char *consolename; -int devcount=0; -int typecount=0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ -printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); -printf("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); -printf("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); -return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK|ISTRIP|IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin),TCSANOW,&it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin),&it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin),TCSANOW,&it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr,"mouse-test: killed by signal %i\r\n",signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; int modes; - if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if (0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current=malloc(sizeof(struct device)); - if (!*current) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->name=strdup(name); - if (!(*current)->name) gpm_report(GPM_PR_OOPS,"malloc()"); - (*current)->fd=fd; - (*current)->next=NULL; - devcount++; - return &((*current)->next); -} - - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type *type) -{ - int fd; - if (!type) type=mice+1; /* ms */ - close(oldfd); - usleep(100000); - fd=open(name,O_RDWR); - if (fd < 0) gpm_report(GPM_PR_OOPS,name); - (*mt_I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, unsigned char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - struct timeval to; - int active=0; - int pending; - int got=0; - - FD_ZERO(&readySet); - FD_SET(fd,&readySet); - FD_SET(fileno(stdin),&readySet); - to.tv_sec=to.tv_usec=0; - - switch(test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet=readySet; - if ((pending=select(fd+1,&selSet,NULL,NULL,&to)) < 0) continue; - if (pending==0 && !active) { - active++; - to.tv_sec=10; - continue; - } - if (pending==0) return got; /* timeout */ - - if (FD_ISSET(0,&selSet)) { - getchar(); - if (active) return got; - } - if (FD_ISSET(fd,&selSet)) { - if (active) got+=read(fd,buff+got,readstep); - else read(fd,buff,buflen); - } - if (got>buflen-readstep) - readstep=buflen-got; - if (readstep==0) - got--,readstep++; /* overwrite last char forever */ - - to.tv_sec=30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list=NULL; - struct item **nextitem; - struct device *devlist=NULL; - struct device **nextdev; - Gpm_Type *cursor; - int i, mousefd; - char *mousename; -#define BUFLEN 512 - unsigned char buf[BUFLEN]; - struct timeval timeout; - fd_set checkSet; - int pending, maxfd; - int trial, readamount,packetsize,got; - int baudtab[4]={1200,9600,4800,2400}; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if (!isatty(fileno(stdin))) { - fprintf(stderr,"%s: stdin: not a tty\n",argv[0]); - exit(1); - } - - progname=argv[0]; - message(); - - /* init the list of possible devices */ - - for (nextdev=&devlist, i=1; iinit; /* the first one has I_serial */ - - signal(SIGINT,killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial=0; - while (devcount > 1) { - fd_set devSet, gotSet,savSet; - struct device *cur; - int gotthem; - - /* BUG */ /* Logitech initialization is not performed */ - - (which_mouse->opt_baud)=BAUD(trial); - printf("\r\nTrying with %i baud\r\n",(which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); FD_ZERO(&gotSet); - FD_SET(fileno(stdin),&devSet); maxfd=fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd,&devSet); - maxfd=max((*nextdev)->fd,maxfd); - (*mt_I_serial)((*nextdev)->fd,(mice+1)->flags,mice+1, - 1, &(mice+1)->name); /* try ms mode */ - } - - savSet=devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ - gotthem=0; - while (1) { /* extract files from the list */ - devSet=savSet; - if ((pending=select(maxfd+1,&devSet,NULL,NULL,&timeout)) < 0) - continue; - if (pending==0 || FD_ISSET(fileno(stdin),&devSet)) { - getchar(); - break; - } - for (nextdev=&devlist; *nextdev; nextdev=&((*nextdev)->next)) - if (FD_ISSET((*nextdev)->fd,&devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd,&savSet); - FD_SET((*nextdev)->fd,&gotSet); - } - } - if (gotthem) for (nextdev=&devlist; *nextdev; /* nothing */ ) { - cur=*nextdev; - if (!FD_ISSET(cur->fd,&gotSet)) { - printf("removing \"%s\" from the list\r\n",cur->name); - *nextdev=cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd,buf,80); /* flush */ - nextdev=&(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd=devlist->fd; - mousename=devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n",mousename); - - /* now close and reopen it, complete with initialization */ - (which_mouse->opt_baud)=BAUD(0); - mousefd=mousereopen(mousefd,mousename,NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd,&checkSet); - FD_SET(fileno(stdin),&checkSet); - maxfd=max(mousefd,fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* init the list of possible types */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for (nextitem=&list, cursor=mice; cursor->fun; cursor++) { - if (cursor->absolute) continue; - *nextitem=malloc(sizeof(struct item)); - if (!*nextitem) gpm_report(GPM_PR_OOPS,"malloc()"); - (*nextitem)->this=cursor; (*nextitem)->next=NULL; - printf("\t%s",cursor->name); - if (cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)",cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem=&((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i=read(mousefd,buf,1); - if (i==-1 && errno==EINVAL) - readamount=3; - else - readamount=1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - - if (readamount!=cur->this->howmany) - REMOVETYPE(cur,"different read() semantics"); - else - nextitem=&(cur->next); - } - read(mousefd,buf,BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if (readamount==1) readamount=10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize=1; - trial=0; - while (packetsize==1) { - int success3=0,success5=0; - - (which_mouse->opt_baud)=BAUD(trial); - printf("\tBaud rate is %i\r\n",(which_mouse->opt_baud)); - mousefd=mousereopen(mousefd,mousename,NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_LEFT,readamount); - - /* try three -- look at repeating arrays of 6 bytes */ - for (i=0;i5 && success5==0) - packetsize=3; - if (success5>5 && success3==0) - packetsize=5; - if (packetsize==1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - int packetheads=0; - int match=0; - Gpm_Event event; - - if (packetsize!=cur->this->packetlen) { - REMOVETYPE(cur,"different packet lenght"); - continue; - } - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - packetheads++; - if ((*(cur->this->fun))(&event,buf+i)==-1) { - packetheads--; - continue; - } - i+=packetsize-1; /* skip packet */ - if (event.dx || event.dy) continue; - if (event.buttons==GPM_B_LEFT) - match++; - else if (event.buttons) - match--; - } - } - if (match<=0) { - REMOVETYPE(cur,"incorrect button detected"); - continue; - } - if (packetheadsthis->name); - nextitem=&(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* why checking and not using return value ??? */ - if(typecount == 0) noneofthem(); - if (typecount==1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename,list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i=getchar()); printf("\r\n"); - } while(i!='y' && i!='n'); - - if (i=='n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got=eventlist(mousefd,buf,BUFLEN,0,readamount); - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons) pending--; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - if(typecount == 0) noneofthem(); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd=mousereopen(mousefd,mousename, mice /* mman */); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 4-byte protocol, find it in a rude way */ - for (pending=0,i=0;i 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename,pending); - exit(0); - } - - pending=0; - for (nextitem=&list; *nextitem; /* nothing */) { - struct item *cur=*nextitem; - Gpm_Event event; - - /* try to decode button press and release */ - for (i=0;ithis->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i+1]&(cur->this->proto)[2]) == (cur->this->proto)[3]) ) { - if ((*(cur->this->fun))(&event,buf+i)==-1) continue; - i+=packetsize-1; - if (event.buttons && event.buttons!=GPM_B_MIDDLE) pending--; - if (event.buttons==GPM_B_MIDDLE) pending++; - } - } - if (pending<0) { - REMOVETYPE(cur,"spurious button reported"); - continue; - } - if (pending>3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name,mousename,pending); - exit(0); - } - printf("** type '%s' still possible\r\n",cur->this->name); - nextitem=&(cur->next); - } - if(typecount == 0) noneofthem(); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3]={TIOCM_DTR|TIOCM_RTS, TIOCM_DTR,TIOCM_RTS}; - char *tognames[3]={"both","dtr","rts"}; - char *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; - int alllines,lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for (index=0;index<3;index++) { - mousereopen(mousefd,mousename,NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n",tognames[index]); - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index],Xtognames[index],mousename); - exit(0); - } - } - } -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got=eventlist(mousefd,buf,BUFLEN,GPM_B_MIDDLE,readamount); - - /* if it uses the 5-byte protocol, find it in a rude way */ - for (pending=0,i=0;i3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n",mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.99.6/src/prog/open_console.c deleted file mode 100644 index 3fc09227..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/prog/open_console.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - if ((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.6/src/report.c b/software/gpm/browse_source/gpm-1.99.6/src/report.c deleted file mode 100644 index 6e144357..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/report.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" /* FIXME: this is wrong; we need report fpr lib und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ... ) -{ - FILE *console = NULL; - va_list ap, ap3; -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap,text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - exit(1); /* we should have a oops()-function,but this works,too*/ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch(stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch(stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console,GPM_STRING_INFO); break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console,GPM_STRING_WARN); break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console,GPM_STRING_ERR); break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console,GPM_STRING_DEBUG); break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console,GPM_STRING_OOPS); break; - } - - vfprintf(console,text,ap); - fprintf(console,"\n"); - - if(stat == GPM_STAT_OOPS) exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.99.6/src/tools.c b/software/gpm/browse_source/gpm-1.99.6/src/tools.c deleted file mode 100644 index 52b81023..00000000 --- a/software/gpm/browse_source/gpm-1.99.6/src/tools.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "gpmInt.h" /* only used for some defines */ -#include "message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console( void ) -{ - - char *back = NULL, *tmp = NULL; - struct stat buf; - - /* first try the devfs device, because in the next time this will be - * the preferred one. If that fails, take the old console */ - - /* Check for open new console */ - if (stat(GPM_DEVFS_CONSOLE,&buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* Failed, try OLD console */ - else if(stat(GPM_OLD_CONSOLE,&buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL) - strcpy(back,tmp); - - return(back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) val = 1; - else if(pot_y < 0) val = 0; /* ugly hack ;) */ - else while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* 0-9 = 1 10^0 <-> (10^1)-1 - * 10 - 99 = 2 10^1 <-> (10^2)-1 - * 100 - 999 = 3 10^2 <-> (10^3)-1 - * 1000 - 9999 = 4 ... */ - - int ret = 0, num = 0; - - /* non negative, please */ - if(number < 0) number *= -1; - else if(number == 0) ret = 1; - else while(number > num) { - ret++; - num = (Gpm_x_high_y(10,ret) - 1); - } - - return(ret); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/.gitignore b/software/gpm/browse_source/gpm-1.99.7/.gitignore deleted file mode 100644 index 41d5e2af..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/.gitignore +++ /dev/null @@ -1,59 +0,0 @@ -.depend -*~ -*.o -*.lo -*.a -*.d -*.P -.*.swp - -Makefile -Makefile.include -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/config - -/contrib/Makefile - -/src/headers/config.h -/src/headers/config.h.in -/src/headers/drivers.h -/src/prog/gpm-root.c -/src/subdirs-exist -/src/headers/config.h.in -/src/gpm -/src/gpm2/tmp -/src/gpm2/out -/src/lib/libgpm.so.* -/src/prog/disable-paste -/src/prog/display-buttons -/src/prog/display-coords -/src/prog/gpm-root.c -/src/prog/gpm-root -/src/prog/get-versions -/src/prog/hltest -/src/prog/mev -/src/prog/mouse-test -/src/Makefile.drivers.generated -/src/subdirs-exist - -/doc/doc.gpm -/doc/gpm-root.1 -/doc/gpm-types.7 -/doc/gpm.8 -/doc/gpm.info -/doc/gpm.man -/doc/mev.1 -/doc/mouse-test.1 - -/.gitversion - -# gpm2 -/gpm2/out/* -/gpm2/tmp/* -/src/gpm2 -/.gitversion.m4 -/.releasedate diff --git a/software/gpm/browse_source/gpm-1.99.7/Changes b/software/gpm/browse_source/gpm-1.99.7/Changes deleted file mode 100644 index f98835f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/Changes +++ /dev/null @@ -1 +0,0 @@ -Can now be found in doc/changes/* diff --git a/software/gpm/browse_source/gpm-1.99.7/Makefile.in b/software/gpm/browse_source/gpm-1.99.7/Makefile.in deleted file mode 100644 index 78bc0cba..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/Makefile.in +++ /dev/null @@ -1,186 +0,0 @@ -# -*-makefile-*- (gpm/main) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = . - -include Makefile.include - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. -# missing ? - -SUBDIRS = src doc contrib gpm2 - - -### simple, but effective rules - -all: do-all - -check: all - -uninstall: do-uninstall -clean: do-clean - rm -f config.status.lineno - - -versionfiles = .gitversion .gitversion.m4 .releasedate -dotfiles = .gitignore .git/HEAD $(versionfiles) -distfiles = configure - -# regen, if it changed; ignore if git is missing / fails -versioncheck: - @v1="$$(git-describe 2>/dev/null)"; \ - if [ -z "$$v1" ]; then \ - echo "No git available, not updating version"; \ - exit 0; \ - fi; \ - v2="$$(cat .gitversion)"; \ - if [ "$$v1" != "$$v2" ]; then \ - echo "updating versionfiles"; \ - date="$$(date +%Y%m%d\ %T\ %z)"; \ - version="$$v1"; \ - echo "define([AC_PACKAGE_VERSION], [$${version} $${date}])" > .gitversion.m4; \ - echo "$${version}" > .gitversion; \ - echo "$${date}" > .releasedate; \ - fi - -$(versionfiles): .git/HEAD versioncheck - -aclocal.m4: acinclude.m4 - $(MKDIR_P) config - aclocal -I config - -configure: configure.ac aclocal.m4 $(versionfiles) - libtoolize --force --copy `libtoolize -n --install >/dev/null 2>&1 && echo --install` - autoheader - autoconf - -config.status: configure - if [ -f config.status ]; then $(SHELL) ./config.status --recheck; \ - else $(SHELL) ./configure; fi - -Makefile: config.status $(srcdir)/Makefile.in Makefile.include - ./config.status -Makefile.include: config.status $(srcdir)/Makefile.include.in - ./config.status - -### INSTALL - -install: check installdirs do-install - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -install-exec: installdirs - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install - -installdirs: - $(MKDIR_P) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x$(ELISP)" != "x" ; then \ - $(MKDIR_P) $(lispdir) ; \ - fi - -### GENERIC - -# do-all goes to all subdirectories and does all -do-%: - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ - for i in $(SUBDIRS) ; do \ - if test -f ./$$i/Makefile ; then \ - $(MAKE) -C ./$$i $${target} || exit 1 ;\ - fi; \ - done - - -# Configure & unconfigure - -# Maintainer portion, use at your own risk - -barf: - @echo 'This command is intended for maintainers to use; it' - @echo 'deletes files that may need special tools to rebuild.' - @echo 'If you want to continue, please press return.' - @echo -n "Hit Ctrl+C to abort." - @read somevar - - -# who / what does need tags -TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS - cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y - -### RELEASE STUFF -TARS :=../gpm-$(release).tar.gz -TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma -CHKSUMS := $(TARS:=.sha512sum) -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=$(D_BASE)/archives/ -D_SOURCE=$(D_BASE)/browse_source/ - -M_HOST=arcana.linux.it -M_DIR=gpm/ - -tars: $(TARS) - -# configure headers, produce new configure script -distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles) - -../gpm-$(release).tar: $(srcdir) distclean distconf - # no exclude possible of .git with pax it seems, so the following is not possible: - #pax -w -x ustar -s '/^\./gpm-$(release)/' -w . -f $@ - pax -w -x ustar -s ';^;gpm-$(release)/;' -f $@ -w $(dotfiles) * - -../gpm-$(release).tar.gz: ../gpm-$(release).tar - gzip -9 -c $< > $@ - -../gpm-$(release).tar.bz2: ../gpm-$(release).tar - bzip2 -9 -c $< > $@ - -../gpm-$(release).tar.lzma: ../gpm-$(release).tar - lzma -9 -c $< > $@ - -$(CHKSUMS): $(TARS) - for file in $^; do sha512sum $$file > $${file}.sha512sum; done - -# Release -dist: disttest distclean distconf nicotest $(CHKSUMS) - chmod 0644 $(TARS) $(CHKSUMS) - chmod 0644 $(TARS) - scp $(TARS) $(CHKSUMS) $(D_HOST):$(D_DIR) - scp $(TARS) $(CHKSUMS) $(M_HOST):$(M_DIR) - ssh "$(D_HOST)" "tar xvfz $(D_DIR)/gpm-$(release).tar.gz -C $(D_SOURCE)" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type f -exec chmod 0644 {} \\;" - ssh "$(D_HOST)" "find \"$(D_SOURCE)/\" -type d -exec chmod 0755 {} \\;" - - -### TEST: on nicos machine: not to be used anywhere else currently -# create / update configure, delete other parts from earlier build -disttest: distconf clean - ./configure - make all - -TESTBUILDDIR=~/temp/gpm-build-test -nicotest: $(TARS) - rm -rf $(TESTBUILDDIR) - $(MKDIR_P) $(TESTBUILDDIR) - cp $(TARS) $(TESTBUILDDIR) - cd $(TESTBUILDDIR); tar xvfj gpm-$(release).tar.bz2; - cd $(TESTBUILDDIR)/gpm-$(release); ./configure && make && ./src/gpm -v - -### CLEANUP -distclean: clean do-clean do-distclean - rm -f config.log config.status* config.cache Makefile Makefile.include - rm -rf autom4te.cache - -allclean: do-allclean distclean - rm -f configure $(versionfiles) aclocal.m4 diff --git a/software/gpm/browse_source/gpm-1.99.7/Makefile.include.in b/software/gpm/browse_source/gpm-1.99.7/Makefile.include.in deleted file mode 100644 index b2736d15..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/Makefile.include.in +++ /dev/null @@ -1,67 +0,0 @@ -# -*-makefile-*- (gpm/include) -# -# Copyright (C) 2001-2008 Nico Schottelius -# - -# set root, if you want to install to a virtual root -ROOT = -ifndef ROOT -ROOT = $(DESTDIR) -endif - -SHELL = /bin/sh - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -# directories -libdir = $(ROOT)@libdir@ -datadir = $(ROOT)@datadir@ -bindir = $(ROOT)@bindir@ -sbindir = $(ROOT)@sbindir@ -includedir = $(ROOT)@includedir@ -sysconfdir = $(ROOT)@sysconfdir@ -mandir = $(ROOT)@mandir@ -man1dir = $(mandir)/man1 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -infodir = $(ROOT)@infodir@ - -# autconf wants this, otherwise issues this warning: -# config.status: WARNING: Makefile.include.in seems to ignore the --datarootdir setting -datarootdir = @datarootdir@ - -# it would be nice to figure this out automatically, but the Emacs -# load path often has many elements, most of them reserved for -# specialised packages like w3 and auctex. -lispdir = @lispdir@ - -# programs -MKDIR_P = @MKDIR_P@ -CC = @CC@ -CFLAGS = -Wall -Wextra -Werror -pipe @CFLAGS@ -MAKEDEPEND = $(CC) -M $(CPPFLAGS) -o $*.d $< -RANLIB = @RANLIB@ -YACC = @YACC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -LN_S = @LN_S@ -EMACS = @EMACS@ -ELISP = @ELISP@ -SHLIB = @SHLIB@ -SED = @SED@ -DIFF = @DIFF@ -TEX = @TEX@ -TEXINDEX = @TEXINDEX@ -DVIPS = @DVIPS@ -MAKEINFO = @MAKEINFO@ -TEXI2HTML = texi2html -STRIP = -s - -AR = ar -ETAGS = etags -AWK = awk -CP = cp -a -RM = rm -release = @release@ diff --git a/software/gpm/browse_source/gpm-1.99.7/README b/software/gpm/browse_source/gpm-1.99.7/README deleted file mode 100644 index dd5afc5b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/README +++ /dev/null @@ -1,345 +0,0 @@ -/* - * README -- gpm 1.xx - * - * Copyright 1995-2000 rubini@linux.it (Alessandro Rubini) - * Copyright 2001-2008 nico-gpm2008 at schottelius.org (Nico Schottelius) - * - *******/ - -The gpm (general purpose mouse) daemon tries to be a useful mouse -server for applications running on the Linux console. Its roots are -in the "selection" package, by Andrew Haylett, and the original code -comes from selection itself. This package is intended as a replacement -for "selection", to provide additional facilities. From 0.18 onward -gpm supports xterm as well, so you can run mouse-sensitive -applications under X, and you can easily write curses applications -which support the mouse on both the Linux console and xterm. The xterm -code is portable to any U*x flavour (look at sample/README). - -The first clients have been "The Midnight Commander", by Miguel de -Icaza and an emacs library included in this release. Recent dialog -distributions and the Jed editor use gpm as well, and the same do -several custom applications. - -There are still some new features to add (f.i. clean devfs support). -Some of gpm's code needs a cleanup. - -If you want to make a patch to gpm, please read doc/HACK_GPM. - -For additionally documentation and other READMEs have a look into doc/. - -=========== REPORT SUCCESS - -As it is always nice to see as an author of FOSS that the software is -used and alive und which options are used, you can send a success -report to me via ./scripts/report_success.sh. - - -=========== MAINTENANCE - -As of 1.19.4, gpm is officially maintained again. Most of the README is written -by Alessandro Rubine, only minor changes are made by me. - - -=========== MAILING LIST - -The mailing list devoted to gpm is "gpm@lists.linux.it" -The list is managed by Mailman and is currently open, -so non-subscribers are allowed to post. - -In order to subscribe to the mailing list, visit - http://lists.linux.it/listinfo/gpm - -or send a message with "subscribe" in its body to - gpm-request@lists.linux.it. - -For example: - echo subscribe | mail gpm-request@lists.linux.it - - -=========== DOWNLOAD / HOMEPAGE - -The latest releases can always be found in one of the following place: - - http://unix.schottelius.org/gpm/archives/ - http://unix.schottelius.org/gpm/browse_source/ - - Mirror: - - ftp://arcana.linux.it/pub/gpm/ - http://www.ar.linux.it/pub/gpm/ - -The homepage of gpm can be found at - - http://unix.schottelius.org/gpm/ - -You can get the latest development tree of gpm via git: - - git-clone http://unix.schottelius.org/git/gpm - -There are three branches available: - - master: - Contains the latest gpm1 code, may be broken. - This is were untested code for gpm1 should go to. - gpm-1-stable: - Contains the latest stable source code of gpm1. - Always compiles and runs, code is tested. - Contents of this branch should always be merged - from the master branch. - gpm-2-dev: - Contains work that heads to gpm2. - It is not stable, does not need to compile. - gpm-2-stable: - Same as gpm-1-stable for gpm2 and mergebase is - gpm-2-dev. - -You can browse the git-tree via gitweb: - - http://unix.schottelius.org/cgi-bin/gitweb.cgi?p=gpm;a=summary - - -=========== COMPILING AND INSTALLING - -The package uses autoconf as of 2.12. Use "./configure && make" to -compile the gpm suite. To install "make install". This installs -everything under the "prefix" directory, which by default is -/usr/local. - -Use "./configure --prefix=/usr" if you want to install under /usr -instead of /usr/local. - -Exectuable files are installed in $(prefix)/bin (except the gpm daemon -in $(prefix)/sbin), libraries in $(prefix)/lib, man pages in -$(prefix)/man, the lisp library in the proper location for emacs-list -files (detected during the "configure" step); info files are installed -under $(prefix)/info. - -If you would like to 'clean'up very tidy, use distclean. Don't forget to use -make distclean config! Otherwise there will be no configure script! - -If any errors occur, please report them to me. Something like this -could be an easy (though brutal) way to do it: - make clean;(uname -a; make) | mail -s "gpm compile err." nicos-gpm@pcsystems.de - -What remains to do after installation is a little configuration - - -=========== CONFIGURING - -Configuration is optional... - -* You would like to tell emacs to use t-mouse.el when appropriate. Add - the following lines to your own .emacs (in your home - directory), or in the /usr/lib/emacs/site-lisp/default - - (if (and (string-match ".*-linux" system-configuration) - (not window-system) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) - -* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc - directory, test it out and then edit it to suit your feels. - -* You'd like to name the gpm info file inside /usr/info/dir. Just insert - the line - * gpm: (gpm.info). A mouse server for the Linux console - at the proper place. Note that this is usually automatically - performed if you install a package prepared for your own - distribution. - -* To invoke gpm (and gpm-root) at system boot, add something like this - to your /etc/rc.d/rc.local - - /usr/sbin/gpm -t msc -m /dev/tts/0 & - /usr/bin/gpm-root & - - If you are running the new setup of SysVinit, you should better - add a "gpm" script in /etc/rc.d/rc.init and install it in your - runlevels in the usual way (this is usually included in your - distribution as well) - - You may want to put the mouse server at a higher priority: in - this case invoke instead "/usr/bin/nice -n -20 /usr/sbin/gpm -t - msc" - - The program goes to the background by itself, unless - it is run with debuging enabled (see the -D option in the - documentation). - - -========== DOCS - -The directory "./doc" holds the documentation. The release embeds a -postscript file, slightly reduced to save paper (doc/gpm2.ps), an info -one (doc/gpm.info) and a text-only version (doc/gpmdoc.txt -- but -without table of contents, for now). Man pages are automatically -extracted from the info file, and are installed with "make install" - - -=========== BUG REPORTS - -Before sending bug reports, please look at the file "FAQ", -which outlines some known problems, and how to deal with them. - -If your bug isn't fixed by reading there, please report it to me, -without getting angry with me if things don't work at first trial -(but they usually work). - -Bug reports are best sent to the gpm mailing list (see above) or to me -via email, if you use personal mail please include the string "gpm" -somewhere in the subject line. This will help my filters in sorting -things out. - -* When compilation fails I need your kernel version ("uname -a"), the -compiler version ("gcc -v") and the library version ("ls -l /lib" or, -better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - -* When a program hangs or segfaults, please reinvoke the program under strace: - strace -tf -o /tmp/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. -Then send me /tmp/trace.gpm* (they may be one or two files, according -to the strace version), and a description of how you reproduce the problem. - -The last resort is a core dump, but I'll ask it personally if I have real -difficulties in tracing out your problem. - - -=========== CREDITS - -The following people contributed to gpm, in chronological order. This -list used to reside in a different file, but it's better for it to stand -out in the README - -Andrew Haylett (ajh@gec-mrc.co.uk) - donated "selection" to the linux community, so I could get - the idea and the code. A few others contributed to selection, - but I lost track of their contributions and names. - -Steven S. Dick (ssd@nevets.oau.org) - fixed a pair of bugs in early gpm versions. - -Miguel de Icaza (miguel@roxanne.nuclecu.unam.mx) - helped fixing some bugs and provided a good client to test - my server. He helped a lot in testing the various pre-releases. - -Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de) - fixed 0.10 with MouseSystems compatible mice. - -Janne Kukonlehto (jtklehto@stekt.oulu.fi) - provided xterm mouse decoding to be stolen by me. - -Rick Lyons (rick@razorback.brisnet.org.au) - fixed a bug in gpm-0.9. - -Reuben Sumner (rasumner@undergrad.math.uwaterloo.ca) - helped fixing behaviour with "-t bm". - -Larry Bartholdi (lbartho@scsun.unige.ch) - pinpointed an error in t-mouse-suspend - and provided good suggestions for 0.97. - -Mark Lord (mlord@bnr.ca) - ported to Dexxa/Logitech mice and gave feedback several times. - -Stefan Giessler (stg@gandalf.han.de) - fixed some problems with gpm-root and - suggested to put gpm in the background (0.97). - -Roman Shapiro - helped with the Logitech MouseMan. - -Andries Brouwer (aeb@cwi.nl) - Provided a Latin-1 LUT for chars, and enhanced - lut-loading code (0.98). - -Adrian Johnson (ajohnson@apanix.apana.org.au) - Gave good feedback and ideas for the 0.98's - -Stephen Lee (sl14@crux1.cit.cornell.edu) - Helped a lot with the damned MouseMan protocol (0.98 and 1.0) - -John van Leeuwen (johnvl@einstein.et.tudelft.nl) - Outlined and fixed a pair of bugs in gpm-root 0.98 - -Alvar Bray (alvar@meiko.co.uk) - Pointed out an error with awk (0.99) - -David A. van Leeuwen (david@tm.tno.nl) - Helped with chord-middle protocols (1.0) - -Pavel Kankovsky (KAN@frode.dcit.cz) - Open /dev/ttyxx instead of /dev/console in the lib (1.01) - -Mark Shadley (shadcat@catcher.com) - Helped in turning to ELF (1.01 and 1.02) and in fixing - horrible bugs of mine. Without his help 1.03 wouldn't be there. - -Lou Sortman (lou@lounix4.conc.tdsnet.com) - Added support for glidepoint mice within "-t mman". (1.05) - -Marc Meis (100334.1426@compuserve.com) - Provided support for absolute pointing devices, and in - particular for the ncr3125 pen. (1.05) - -Michael Plass (Michael_Plass.PARC@xerox.com) - Fixed a damned bug in middle button decoding (M_ms) (1.07) - -Markus Gutschke (gutschk@uni-muenster.de) - Provided a better re-encoding for "-R" (1.10) - -Karsten Ballueder (Karsten@piobelix.physik.uni-karlsruhe.de) - Suggested the reboot compile-time option (1.10) - -John Davis (davis@space.mit.edu) - Found and fixed a buglet in liblow.c for some jed users (1.10) - -Julian Thompson (jrt@miel.demon.co.uk) - Fixed a buglet in gpm-root (1.10) - -Dave Flater (dave@universe.digex.net) - Removed a typo in the disabled decoder for ms-3b (1.11) - -Thomas E. Dickey (dickey@clark.net) - Ported to autoconf (1.11) - -Pavel Machek (pavel@ucw.cz) - New mode "logim" (1.11) and NetMouse (1.14) - -Matthias Grimrath (y0001032@rzserv8.rz.tu-bs.de) - Be c++ compliant in gpm.h (1.11) - -Stephen Tell (tell@cs.unc.edu) - Patch for the ps2 decoder to support misbehaving devices (1.11) - -Francois Chastrette (no-email) - Great help to support plugnpray mice (1.13) - -Steve Bennett (s.bennett@lancaster.ac.uk) - Support for the intellimouse serial devices. (1.13) - -Jan Daciuk (jandac@pg.gda.pl) - t-mouse: yet another regexp possibility - -Ian Zimmerman is now actively cooperating in maintaining gpm, so -he'll no longer appear in the acknowledgements ;-) - -David Given (dg@tao.co.uk) - Offered support for joystick mouse emulation (1.14) - -Tim Goodwin (tgoodwin@cygnus.co.uk) -Colin Plumb (colin@nyx10.nyx.net) -Ben Pfaff (pfaffben@pilot.msu.edu) -Ian and Iris (brooke@jump.net) - All of them sent in support for ps2 intellimouse (1.14) - -Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" - -Stefan Runker (runkeledv@t-online.de) - Contributed a new Wacom decoder - -Alessandro Rubini (rubini@linux.it) - He's done a lot of work on gpm and maintained it. - He's still helping me a lot to understand all parts of gpm. diff --git a/software/gpm/browse_source/gpm-1.99.7/README.gpm2 b/software/gpm/browse_source/gpm-1.99.7/README.gpm2 deleted file mode 100644 index 2f2171be..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/README.gpm2 +++ /dev/null @@ -1,32 +0,0 @@ -I am thinking about restructing gpm, for the following reasons: - -- the code is old -- the code is huge -- the code is next to unmaintainable -- the code is linux specific - -What I think one could reach: - -- create gpm, that runs on any Unix? -- create gpm that is easy to extend -- create gpm that is easy to maintain - -What ways are possible? - -- rewrite everything from scratch - * takes a long time and much motivitation -- migrate old code to clean codebase - * takes some time to analyse old code - * seems to me some way one could go - -How to do it? - -- new functions / code references 'gpm2' instead of gpm -- perhaps some people want to sponsor me for creating a clean - mouse driver for the console? - => thus I got more time to focus on gpm2 -- motivate other foss developers to take part into it - -Let's see what happens! - - -- Nico Schottelius, 2007-05-11 2245 CEST in a train in Zurich diff --git a/software/gpm/browse_source/gpm-1.99.7/README.versions b/software/gpm/browse_source/gpm-1.99.7/README.versions deleted file mode 100644 index d4d5f0e4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/README.versions +++ /dev/null @@ -1,29 +0,0 @@ -Dear gpm README reader, - - this letter is to you, as I have to tell you about my idea of versioning - of gpm. Traditionally, there were 1.19.x releases. That was, before the gpm - source code and I met. After that, there was 1.20.x, indicating a new - maintainer, but continuing with the old naming versioning. Today, on the - 19th of February 2008, I decided to give gpm a real chance of getting a - "second life" under the name of "gpm2" (as described in README.gpm2). It - seems that the best effort for creating gpm2 is to rewrite everything, but - to migrate the logic from the old code (as in: how to handle the individual - mouse). - - So, how does that relate to the versions of gpm? Let us have a look at it: - - 1.19.x: old versions, not continued - 1.20.x: current stable versions: no new features. - - 1.99.x: versions that move to 2.x, but contain much 1.20.x code. - includes new features. - - 2.0.x: future stable versions - 2.1.x: future testing versions - - Perhaps you have some comments to tell me? If so, just drop me a letter to - nico-gpm-versions at schottelius.org. - -Yours, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.7/TODO b/software/gpm/browse_source/gpm-1.99.7/TODO deleted file mode 100644 index d5ed76f5..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/TODO +++ /dev/null @@ -1,117 +0,0 @@ -================================================================================ -= /------\ /-----\ |----\ /-----\ = -= || | | | | | | = -= || | | | | | | thanks for every help. ;) = -= || \-----/ |____/ \-----/ = -================================================================================ - -Last edited: -Nico Schottelius , 24 Dec 2002 - -Intro: - -Welcome to the todo list. You are invited to help me. Select something -you wanna fix/introduce and I will tell you how you can add it. -items marked with a 'D' are done. - -Tasks: - -2002-12-24 Nico Schottelius - * -D must be checked before calling anything else. - Currently, -m mousedev -D -t ps2 calls add_mouse first without debug - -2002-11-21 Nico Schottelius - * remove -M, allow multiply -m,-t; -> allow n mice and cleaner code - --> means use of add_mouse(), init_mice() - * remove old opt_* -D * cleanup gpn.c/cmdline to its real purpose - * make protocol / port autodection: gpm -u [later...] - => ONLY FOR DEVFS! - -2002-11-09 Nico Schottelius -D * cleanup gpm further: main.c - * do init,protocol,disable functions forced -D * introducte global option structure - -2002-03-10 Nico Schottelius - * make buffer accessable from X and vice versa - -2002-03-02 Nico Schottelius -D * remove large messages: (just cd $srcdir...) - /home/user/nico/computer/sources/linux/gpm/gpm-1.20.1/src/mice.c -> - src/mice.c or mice.c - - It's a problem with gcc's command line: - gcc -o file filename.c -> filename.c - gcc -o file /path/to/filename.c -> /path/to/filename.c - -2002-02-20 Nico Schottelius - * add contrib/other/TPdetect.cc [Allan Sandfeld Jensen - ] to the gpm source. - -2002-02-08 Nico Schottelius - * fix problems with the following clients: - - gpm-root complains about /dev/vcs0 in devfs - - disable-past: segmenatation fault - - mev: segmenatation fault - - hltest: stdin: not a system console [ devfs problem ? ] - - mouse-test does not work (does not do anything after key pressed) -D * add better ps2 initialization: after mouse is screwed up with synps2 - data, the init of ps2 should be able to get the mouse work again... - [ btw, currenty I_empty is used :( ] -D * update documentation and MANIFEST - -2002-02-04 Nico Schottelius - * use gpm_report in all gpm sources. Check for run_status. - [ report_lib does not need run_status! ] - * export synaptic.c messages to message.h - * cleanup debugging support in synaptics.c - * remove all strings in c files and place them into message.h - -2002-01-07 Nico Schottelius - * cleanup gpm-root (it will not run currently with devfs) -D * add pseudo root support -D * add protocol reset (after synps2 i.e.) - * add serial console support into gpm_report - * add howtos: - - add a protocol (?) - - add a messsage (message.h) - * remove hardwired names in sample clients. -D * cleanup Gpm_Open (problem with devfs still exists) - * remove dirty gotos - -2001-09-29 Frédéric L. W. Meunier <0@pervalidus.net> - * Add GNU screen support to libgpm. - -2001-09-23 Nico Schottelius -D * put dependings from sources to src/.depend -D * set version _everywhere_ via configure (doc.gpm and others) -D * really remove oops() output, add clearer text to the user(also use stderr) -D * remove more hardwired things in gpm ! [partly solved. gpm-root is missing] -D * oops rewrite or use another function for rep_err() - --> calls oops() of we need to exit. Give oops() a va_* type, Filename,line - --> normally report(STATUS, text, ... ) --> - --> STATUS = (char * filename(__FILE__), int line(__LINE__), int status) - --> status: WARN, CRIT(or ABRT) - -D * 27th of July 2k+1: - - report(char *filename, int line, int status, char *text, ... ) - Destinations: - * stderr -> startup - * current console (/dev/tty, /dev/vc/0) -> debug, daemon - * console (/dev/console) -> running, daemon - * syslogd -> running, daemon - Status: - * LOG_INFO - * LOG_WARN - * LOG_ERR - * LOG_DEBUG - - -D * 7th of July 2k+1: [partly done. many patches left] - - analysing patches - - applying patches - - detail stuff: - - message function: - destination depend on current state - change debuglevel by using SIGUSR1/SIGUSR2 diff --git a/software/gpm/browse_source/gpm-1.99.7/acinclude.m4 b/software/gpm/browse_source/gpm-1.99.7/acinclude.m4 deleted file mode 100644 index 8e9d9192..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/acinclude.m4 +++ /dev/null @@ -1,75 +0,0 @@ -dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -AC_DEFUN([ITZ_SYS_ELF], -[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -[AC_EGREP_CPP(win, -[#ifdef __ELF__ -win -#else -lose -#endif -],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - PICFLAGS="-DPIC -fPIC" - SOLDFLAGS="-fPIC -shared -Wl,-soname," -else - PICFLAGS= - SOLDFLAGS= -fi -]) -AC_DEFUN([ITZ_PATH_SITE_LISP], -[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -sed -e '/^$/d' | sed -n -e 2p` -case x${itz_cv_path_site_lisp} in -x*site-lisp*) ;; -x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -esac]) -]) -AC_DEFUN([ITZ_CHECK_TYPE], -[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -AC_TRY_COMPILE([ -#include <$2> -],[ -$1 dummy; -return 0; -],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -]) - -# -# Fix autoconf: They don't allow shell variables in AC_INIT -# So we have to define them via m4 to be accepted.... -# -# What I simply wanted todo is -# -# AC_INIT([gpm],["$revgit"],[http://unix.schottelius.org/gpm/]) -# -# As neither -# -# revgit="`cat $srcdir/.gitversion`" -# m4_define([AC_PACKAGE_VERSION], [$revgit]) -# -# nor -# -# m4_define([AC_PACKAGE_VERSION], include(.gitversion)) -# -# work, I generate an m4 define in .gitversion, which is called by -# autogen.sh: -# -# [13:59] denkbrett:gpm% cat .gitversion -# define([AC_PACKAGE_VERSION], [1.99.6-83-gd80571b 20080611 13:56:54 +0200]) -# -# This works in general, because if AC_PACKAGE_VERSION is set before running -# AC_INIT, it will not overwrite it, as seen in /usr/share/autoconf/autoconf/general.m4: -# -# m4_ifndef([AC_PACKAGE_VERSION], -# [m4_define([AC_PACKAGE_VERSION], [$2])]) -# -# -# So effectively, to change the version of gpm to something dynamically, it goes this way: -# -# autogen.sh -> .gitversion -> acinclude.m4 -> auto* -> configure.ac -> configure -# -# Perhaps someone could simply this a bit? -# - -m4_include(.gitversion.m4) diff --git a/software/gpm/browse_source/gpm-1.99.7/autogen.sh b/software/gpm/browse_source/gpm-1.99.7/autogen.sh deleted file mode 100644 index 9763ada2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/autogen.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -e - -set -x - -[ -d config ] || mkdir config - -# -# Generate version in m4 format, because the following two in acinclude.m4 -# do not work: -# -# revgit="`cat $srcdir/.gitversion`" -# m4_define([AC_PACKAGE_VERSION], [$revgit]) -# -# and -# m4_define([AC_PACKAGE_VERSION], include(.gitversion)) -# -version="$(git-describe)" -date="$(date +%Y%m%d\ %T\ %z)" -echo "define([AC_PACKAGE_VERSION], [${version} ${date}])" > .gitversion.m4 -echo "${version}" > .gitversion -echo "${date}" > .releasedate - -${ACLOCAL-aclocal} -I config -${LIBTOOLIZE-libtoolize} -n --install 2>/dev/null && LIBTOOL_FLAGS="--install" || LIBTOOL_FLAGS="" -${LIBTOOLIZE-libtoolize} --force --copy ${LIBTOOL_FLAGS} -${AUTOHEADER-autoheader} -${AUTOCONF-autoconf} diff --git a/software/gpm/browse_source/gpm-1.99.7/build-from-git.sh b/software/gpm/browse_source/gpm-1.99.7/build-from-git.sh deleted file mode 100644 index 7c40be9e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/build-from-git.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico - -./autogen.sh && ./configure && make diff --git a/software/gpm/browse_source/gpm-1.99.7/configure.ac b/software/gpm/browse_source/gpm-1.99.7/configure.ac deleted file mode 100644 index a34f5318..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/configure.ac +++ /dev/null @@ -1,156 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -dnl written jan/1997 - T.E.Dickey - -AC_PREREQ(2.61) - -AC_INIT([gpm],["version-set-in-.gitversion-via-acinclude.m4"],[http://unix.schottelius.org/gpm/]) - -AC_CONFIG_SRCDIR([src/daemon/main.c]) -AC_CONFIG_AUX_DIR([config]) -AC_CONFIG_HEADER([src/headers/config.h]) - -AC_CANONICAL_HOST - -AC_DEFINE_UNQUOTED([GPM_ABI_LEV], [$abi_lev], [Library level]) -AC_DEFINE_UNQUOTED([GPM_ABI_AGE], [$abi_age], [Library age]) -AC_DEFINE_UNQUOTED([GPM_ABI_REV], [$abi_rev], [Library revision]) -AC_DEFINE_UNQUOTED([GPM_ABI_FULL],["$abi_full"],[Full library version]) - -dnl Make srcdir an absolute path. -if test x$srcdir = x ; then - srcdir = `pwd` -else - srcdir=`cd $srcdir && pwd` -fi - -# -# Versioning stuff -# -abi_lev="2" -abi_age="1" -abi_rev="0" -abi_full="${abi_lev}.${abi_age}.${abi_rev}" - -AC_DEFINE_UNQUOTED([GPM_ABI_LEV], [$abi_lev], [Library level]) -AC_DEFINE_UNQUOTED([GPM_ABI_AGE], [$abi_age], [Library age]) -AC_DEFINE_UNQUOTED([GPM_ABI_REV], [$abi_rev], [Library revision]) -AC_DEFINE_UNQUOTED([GPM_ABI_FULL],["$abi_full"],[Full library version]) - -releasedate="`cat $srcdir/.releasedate`" -release="`cat $srcdir/.gitversion`" - - -# -# Find programs -# - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL -AC_PROG_MKDIR_P -AC_PROG_YACC -AC_PROG_LN_S - -# check for programs. -AC_PATH_PROG(DVIPS,dvips,no) -AC_PATH_PROG(TEXI2HTML,texi2html,no) -AC_PATH_PROG(TEX,tex,no) -AC_PATH_PROG(TEXINDEX,texindex,no) -AC_PATH_PROG(MAKEINFO,makeinfo,no) -AC_PATH_PROG(DIFF,diff,no) -AC_PATH_PROG(SED,sed,no) -AC_PATH_PROG(emacs,emacs,no) - -if test ${ac_cv_path_emacs} = no ; then - EMACS=: - ELISP= -else - EMACS=${ac_cv_path_emacs} - ELISP="emacs/t-mouse.el emacs/t-mouse.elc" -fi - -if test $EMACS != : ; then - ITZ_PATH_SITE_LISP - lispdir=${itz_cv_path_site_lisp} -else - lispdir='${datadir}/emacs/site-lisp' -fi - -# Header-checks -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) - -# Required headers -AC_CHECK_HEADERS(sys/socket.h,,[AC_MSG_ERROR([Required header file missing])]) - -AC_ARG_WITH(curses, -[ --without-curses disable curses support even if curses found]) - -CURSES_OBJS= - -case $with_curses in -No|no|N|n) : ;; - *) if test ${ac_cv_header_ncurses_h} = yes || - test ${ac_cv_header_ncurses_curses_h} = yes || - test ${ac_cv_header_curses_h} = yes ; then - CURSES_OBJS=lib/libcurses.o ; fi ;; -esac - - -ITZ_CHECK_TYPE(__u32,linux/types.h) -if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then - AC_DEFINE(HAVE___U32, 1, [define if the __u32 type exists either in sys/types.h or in linux/types.h]) -fi - -ITZ_SYS_ELF -if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then - SHLIB=libgpm.so -else - SHLIB= -fi - -AC_CHECK_FUNCS(vsyslog syslog) -AC_FUNC_ALLOCA - -case $with_curses in -No|no|N|n) SHARED_LIBS=-lc ;; -*) - SAVELIBS=$LIBS - LIBS= - for i in tinfo ncurses termcap termlib; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, tputs) - else :; fi - done - TERMLIBS=$LIBS - LIBS= - for i in ncurses curses; do - if test x$LIBS = x; then - AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) - else :; fi - done - SHARED_LIBS="$LIBS $TERMLIBS -lc" - LIBS=$SAVELIBS ;; -esac - -GPMXTERM= -AC_SUBST(GPMXTERM) -AC_SUBST(abi_lev) -AC_SUBST(abi_full) -AC_SUBST(EMACS) -AC_SUBST(ELISP) -AC_SUBST(SHLIB) -AC_SUBST(PICFLAGS) -AC_SUBST(SOLDFLAGS) -AC_SUBST(CURSES_OBJS) -AC_SUBST(SHARED_LIBS) -AC_SUBST(lispdir) -AC_SUBST(release) -AC_SUBST(release_date) - -CPPFLAGS="$CPPFLAGS "'$(DEFS) -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" -include headers/config.h -I$(srcdir) -I$(srcdir)/headers -I$(srcdir)/../gpm2/include -I$(builddir)/headers ' -LDFLAGS="$LDFLAGS "'-L$(srcdir)' - -dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -dnl AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir") -AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm) diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/Makefile.in b/software/gpm/browse_source/gpm-1.99.7/contrib/Makefile.in deleted file mode 100644 index af9a7ce4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -# -*-makefile-*- (gpm/contrib) -# -# Copyright (C) 2001 Nico Schottelius -# - - -srcdir = @srcdir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -all: $(srcdir)/$(ELISP) - -install: all - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - $(INSTALL_DATA) $(srcdir)/$$i $(lispdir)/`basename $$i` ;\ - done; fi - -%.elc: %.el - $(EMACS) -batch -l $(srcdir)/emacs/exec.el -exec '(byte-compile-file "$<")' - -uninstall: - if [ -n "$(ELISP)" ]; then for i in `echo $(ELISP)`; do \ - rm -f $(lispdir)/$$i ;\ - done; fi - -dist: - $(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -clean distclean: - $(RM) -f $(srcdir)/emacs/*.elc Makefile diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/emacs/exec.el b/software/gpm/browse_source/gpm-1.99.7/contrib/emacs/exec.el deleted file mode 100644 index 923e5b3f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/emacs/exec.el +++ /dev/null @@ -1,7 +0,0 @@ -(setq command-switch-alist '( - ("-exec" . cmdline-exec))) - -(defun cmdline-exec (name) - (eval (car (read-from-string (car command-line-args-left)))) -) - \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/emacs/t-mouse.el b/software/gpm/browse_source/gpm-1.99.7/contrib/emacs/t-mouse.el deleted file mode 100644 index 88f6ef1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/emacs/t-mouse.el +++ /dev/null @@ -1,342 +0,0 @@ -;;; t-mouse.el --- mouse support within the text terminal - -;;; Copyright (C) 1994,1995 Alessandro Rubini -;;; parts are by Ian T Zimmermann , 1995,1998 - -;; Maintainer: gpm mailing list: gpm@prosa.it -;; Keywords: mouse gpm linux - -;;; 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 GNU Emacs; see the file COPYING. If not, write to -;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - -;;; Commentary: - -;; This package provides access to mouse event as reported by the -;; gpm-Linux package. It uses the program "mev" to get mouse events. -;; It tries to reproduce the functionality offered by emacs under X. -;; The "gpm" server runs under Linux, so this package is rather -;; Linux-dependent. - -;; Developed for GNU Emacs 19.34, likely won't work with many others -;; too much internals dependent cruft here. - - -(require 'advice) - -(defvar t-mouse-process nil - "Embeds the process which passes mouse events to emacs. -It is used by the program t-mouse.") - -(defvar t-mouse-filter-accumulator "" - "Accumulates input from the mouse reporting process.") - -(defvar t-mouse-debug-buffer nil - "Events normally posted to command queue are printed here in debug mode. -See `t-mouse-start-debug'.") - -(defvar t-mouse-current-xy '(0 . 0) - "Stores the last mouse position t-mouse has been told about.") - -(defvar t-mouse-drag-start nil - "Whenever a drag starts in a special part of a window -(not the text), the `translated' starting coordinates including the -window and part involved are saved here. This is necessary lest they -get re-translated when the button goes up, at which time window -configuration may have changed.") - -(defvar t-mouse-prev-set-selection-function 'x-set-selection) -(defvar t-mouse-prev-get-selection-function 'x-get-selection) - -(defvar t-mouse-swap-alt-keys nil - "When set, Emacs will handle mouse events with the right Alt -(a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. -Useful for people who play strange games with their keyboard tables.") - -(defvar t-mouse-fix-21 nil - "Enable brain-dead chords for 2 button mice.") - - -;;; Code: - -;; get the number of the current virtual console - -(defun t-mouse-tty () - "Returns number of virtual terminal Emacs is running on, as a string. -For example, \"2\" for /dev/tty2." - (let ((buffer (generate-new-buffer "*t-mouse*"))) - (call-process "ps" nil buffer nil "h" (format "%s" (emacs-pid))) - (prog1 (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (if (or - ;; Many versions of "ps", all different.... - (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) - (re-search-forward "p \\([0-9a-f]\\)" nil t) - (re-search-forward "v0\\([0-9a-f]\\)" nil t) - (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) - (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t)) - (buffer-substring (match-beginning 1) (match-end 1)))) - (kill-buffer buffer)))) - - -;; due to a horrible kludge in Emacs' keymap handler -;; (read_key_sequence) mouse clicks on funny parts of windows generate -;; TWO events, the first being a dummy of the sort '(mode-line). -;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for -;; the modeline, for instance. - -;; now get this: the Emacs C code that generates these fake events -;; depends on certain things done by the very lowest level input -;; handlers; namely the symbols for the events (for instance -;; 'C-S-double-mouse-2) must have an 'event-kind property, set to -;; 'mouse-click. Since events from unread-command-events do not pass -;; through the low level handlers, they don't get this property unless -;; I set it myself. I imagine this has caused innumerable attempts by -;; hackers to do things similar to t-mouse to lose. - -;; The next page of code is devoted to fixing this ugly problem. - -;; WOW! a fully general powerset generator -;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) -(defun t-mouse-powerset (l) - (if (null l) '(nil) - (let ((l1 (t-mouse-powerset (cdr l))) - (first (nth 0 l))) - (append - (mapcar (function (lambda (l) (cons first l))) l1) l1)))) - -;; and a slightly less general cartesian product -(defun t-mouse-cartesian (l1 l2) - (if (null l1) l2 - (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) - (t-mouse-cartesian (cdr l1) l2)))) - -(let* ((modifier-sets (t-mouse-powerset '(control meta shift))) - (typed-sets (t-mouse-cartesian '((down) (drag)) - '((mouse-1) (mouse-2) (mouse-3)))) - (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) - (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) - (while all-sets - (let ((event-sym (event-convert-list (nth 0 all-sets)))) - (if (not (get event-sym 'event-kind)) - (put event-sym 'event-kind 'mouse-click))) - (setq all-sets (cdr all-sets)))) - - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen -;; This is basically a feeble attempt to mimic what the c function -;; buffer_posn_from_coords in dispnew.c does. I wish that function -;; were exported to Lisp. - -(defun t-mouse-lispy-buffer-posn-from-coords (w col line) - "Return buffer position of character at COL and LINE within window W. -COL and LINE are glyph coordinates, relative to W topleft corner." - (save-window-excursion - (select-window w) - (save-excursion - (move-to-window-line line) - (move-to-column (+ col (current-column) - (if (not (window-minibuffer-p w)) 0 - (- (minibuffer-prompt-width))) - (max 0 (1- (window-hscroll))))) - (point)))) - -;; compute one element of the form (WINDOW BUFFERPOS (COL . ROW) TIMESTAMP) - -(defun t-mouse-make-event-element (x-dot-y-avec-time) - (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) - (x (car x-dot-y)) - (y (cdr x-dot-y)) - (timestamp (nth 1 x-dot-y-avec-time)) - (w (window-at x y)) - (left-top-right-bottom (window-edges w)) - (left (nth 0 left-top-right-bottom)) - (top (nth 1 left-top-right-bottom)) - (right (nth 2 left-top-right-bottom)) - (bottom (nth 3 left-top-right-bottom)) - (coords-or-part (coordinates-in-window-p x-dot-y w))) - (cond - ((consp coords-or-part) - (let ((wx (car coords-or-part)) (wy (cdr coords-or-part))) - (if (< wx (- right left 1)) - (list w - (t-mouse-lispy-buffer-posn-from-coords w wx wy) - coords-or-part timestamp) - (list w 'vertical-scroll-bar - (cons (1+ wy) (- bottom top)) timestamp)))) - ((eq coords-or-part 'mode-line) - (list w 'mode-line (cons (- x left) 0) timestamp)) - ((eq coords-or-part 'vertical-line) - (list w 'vertical-line (cons 0 (- y top)) timestamp))))) - -;;; This fun is partly Copyright (C) 1994 Per Abrahamsen - -(defun t-mouse-make-event () - "Makes a Lisp style event from the contents of mouse input accumulator. -Also trims the accumulator by all the data used to build the event." - (let (ob (ob-pos (condition-case nil - (read-from-string t-mouse-filter-accumulator) - (error nil)))) - (if (not ob-pos) nil - (setq ob (car ob-pos)) - (setq t-mouse-filter-accumulator - (substring t-mouse-filter-accumulator (cdr ob-pos))) - - ;;now the real work - - (let ((event-type (nth 0 ob)) - (current-xy-avec-time (nth 1 ob)) - (type-switch (length ob))) - - (if t-mouse-fix-21 - (let - ;;Acquire the event's symbol's name. - ((event-name-string (symbol-name event-type)) - end-of-root-event-name - new-event-name-string) - - (if (string-match "-\\(21\\|\\12\\)$" event-name-string) - - ;;Transform the name to what it should have been. - (progn - (setq end-of-root-event-name (match-beginning 0)) - (setq new-event-name-string - (concat (substring - event-name-string 0 - end-of-root-event-name) "-3")) - - ;;Change the event to the symbol that corresponds to the - ;;name we made. The proper symbol already exists. - (setq event-type - (intern new-event-name-string)))))) - - ;;store current position for mouse-position - - (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) - - ;;events have many types but fortunately they differ in length - - (cond - ;;sink all events on the stupid text mode menubar. - ((and menu-bar-mode (eq 0 (cdr t-mouse-current-xy))) nil) - ((= type-switch 4) ;must be drag - (let ((count (nth 2 ob)) - (start-element - (or t-mouse-drag-start - (t-mouse-make-event-element (nth 3 ob)))) - (end-element - (t-mouse-make-event-element current-xy-avec-time))) - (setq t-mouse-drag-start nil) - (list event-type start-element end-element count))) - ((= type-switch 3) ;down or up - (let ((count (nth 2 ob)) - (element - (t-mouse-make-event-element current-xy-avec-time))) - (if (and (not t-mouse-drag-start) - (symbolp (nth 1 element))) - ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! - (setq t-mouse-drag-start (copy-sequence element)) - (setq t-mouse-drag-start nil)) - (list event-type element count))) - ((= type-switch 2) ;movement - (list (if (eq 'vertical-scroll-bar - (nth 1 t-mouse-drag-start)) 'scroll-bar-movement - 'mouse-movement) - (t-mouse-make-event-element current-xy-avec-time)))))))) - - -(defun t-mouse-process-filter (proc string) - (setq t-mouse-filter-accumulator - (concat t-mouse-filter-accumulator string)) - (let ((event (t-mouse-make-event))) - (while event - (if (or track-mouse - (not (eq 'mouse-movement (event-basic-type event)))) - (setq unread-command-events - (nconc unread-command-events (list event)))) - (if t-mouse-debug-buffer - (print unread-command-events t-mouse-debug-buffer)) - (setq event (t-mouse-make-event))))) - - -;; this overrides a C function which stupidly assumes (no X => no mouse) -(defadvice mouse-position (around t-mouse-mouse-position activate) - "Return the t-mouse-position unless running with a window system. -The (secret) scrollbar interface is not implemented yet." - (if (not window-system) - (setq ad-return-value - (cons (selected-frame) t-mouse-current-xy)) - ad-do-it)) - -(setq mouse-sel-set-selection-function - (function (lambda (type value) - (if (not window-system) - (if (eq 'PRIMARY type) (kill-new value)) - (funcall t-mouse-prev-set-selection-function - type value))))) - -(setq mouse-sel-get-selection-function - (function (lambda (type) - (if (not window-system) - (if (eq 'PRIMARY type) - (current-kill 0) "") - (funcall t-mouse-prev-get-selection-function type))))) - -;; It should be possible to just send SIGTSTP to the inferior with -;; stop-process. That doesn't work; mev receives the signal fine but -;; is not really stopped: instead it returns from -;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up -;; itz Tue Mar 24 14:27:38 PST 1998. - -(add-hook 'suspend-hook - (function (lambda () - (and t-mouse-process - ;(stop-process t-mouse-process) - (process-send-string - t-mouse-process "push -enone -dall -Mnone\n"))))) - -(add-hook 'suspend-resume-hook - (function (lambda () - (and t-mouse-process - ;(continue-process t-mouse-process) - (process-send-string t-mouse-process "pop\n"))))) - - -;;; User commands - -(defun t-mouse-stop () - "Stop getting mouse events from an asynchronous process." - (interactive) - (delete-process t-mouse-process) - (setq t-mouse-process nil)) - -(defun t-mouse-run () - "Starts getting a stream of mouse events from an asynchronous process. -Only works if Emacs is running on a virtual terminal without a window system. -Returns the newly created asynchronous process." - (interactive) - (let ((tty (t-mouse-tty)) - (process-connection-type t)) - (if (or window-system (not (stringp tty))) - (error "Run t-mouse on a virtual terminal without a window system")) - (setq t-mouse-process - (start-process "t-mouse" nil - "mev" "-i" "-E" "-C" tty - (if t-mouse-swap-alt-keys - "-M-leftAlt" "-M-rightAlt") - "-e-move" "-dall" "-d-hard" - "-f"))) - (setq t-mouse-filter-accumulator "") - (set-process-filter t-mouse-process 't-mouse-process-filter) - (process-kill-without-query t-mouse-process) - t-mouse-process) - -(provide 't-mouse) - -;;; t-mouse.el ends here diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/init/gpm.init b/software/gpm/browse_source/gpm-1.99.7/contrib/init/gpm.init deleted file mode 100644 index f5fef0b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/init/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:51 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/other/README b/software/gpm/browse_source/gpm-1.99.7/contrib/other/README deleted file mode 100644 index 4b6c8f9f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/other/README +++ /dev/null @@ -1,4 +0,0 @@ -Have a look into MANIFEST for more informations. - -README - this file -TPdetect.cc - sample TP detection diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/other/TPdetect.cc b/software/gpm/browse_source/gpm-1.99.7/contrib/other/TPdetect.cc deleted file mode 100644 index 5ca26c1e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/other/TPdetect.cc +++ /dev/null @@ -1,283 +0,0 @@ -#include -#include -#include -#include -#include - -unsigned char* inbuffer; -unsigned char* outbuffer; - -// wait for up to 0.1seconds for an acknowledgement -int getack(int fd) { - fd_set set; - timeval timeout; - FD_ZERO(&set); - FD_SET(fd,&set); - timeout.tv_sec=0; - timeout.tv_usec=100000; - if (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - int b=read(fd,inbuffer,1); - if(b==1) { - if(inbuffer[0]==0xfa) { - //printf("<< Acknowledged\r\n"); - return 1; - } - else if (inbuffer[0]=0xfe) - printf("<- PS/2: Error\r\n"); - else - printf("<- Not an acknowledgement:%02x\r\n",inbuffer[0]); - }; - }; - return 0; -}; - -// Try to receive n bytes -int receive(int fd,int n) { - int a=0,b; - while(a TP: Send extended ID\r\n"); - command(fd,0xe1); - if (! getack(fd)) - { - if(inbuffer[0]==0xfe) { // give it a second try - command(fd,0xe1); - if(getack(fd)) goto ack; - } - printf("No trackpoint controller detected\r\n"); - return 0; - - } - ack: - int a=0; - while(select(FD_SETSIZE,&set,NULL,NULL,&timeout)) { - read(fd,inbuffer+a,1); - a++; - } - char * version; - if(inbuffer[0]==0x01) { - switch(inbuffer[1]) { - case 0x01: - version = "8E/98"; - break; - case 0x02: - version = "A4"; - break; - case 0x03: - version = "AB"; - break; - case 0x04: - version = "03"; - break; - case 0x05: - version = "B2/B4"; - break; - case 0x06: - version = "B1/B3/B5/B8/2B"; - break; - case 0x07: - version = "?"; - break; - case 0x08: - version = "?"; - break; - case 0x09: - version = "?"; - break; - case 0x0A: - version = "35"; - break; - case 0x0B: - version = "3A/3B"; - break; - case 0x0C: - version = "3C"; - break; - case 0x0D: - version = "3D"; - break; - case 0x0E: - version = "3E"; - break; - default: - printf("Unrecognized ID: %02x\n",inbuffer[1]); - return 0; - } - printf("IBM Trackpoint controller detected. Version %s \r\n",version); - return 1; - } else { - printf("No IBM trackpoint controller detected\r\n"); - printf("Extended ID: %02x %02x\r\n",inbuffer[0],inbuffer[1]); - return 0; - } -} - - -// Reset PS/2 device -int reset(int fd) { - command(fd,0xff); - printf("-> PS/2: Reset\r\n"); - getack(fd); - receive(fd,2); - if(inbuffer[0]==0xaa && inbuffer[1]==0x00) { - printf("<- PS/2: Succesfull initialization\r\n"); - return 1; - } else - return 0; -} - -// Get PS/2 ID -int getdeviceid(int fd) { - command(fd,0xf2); - getack(fd); - printf("-> PS/2: Get device ID\r\n"); - if(receive(fd,1)==1) { - printf("<- PS/2: Device ID: %02x\n",inbuffer[0]); - return inbuffer[0]; - } -} - -void enabledatareport(int fd) { - command(fd, 0xf4); - printf("-> PS/2: (re)Enable data-reporting\r\n"); - getack(fd); -} - -void disabledatareport(int fd) { - command(fd, 0xf5); - printf("-> PS/2: Disable data-reporting\r\n"); - getack(fd); -} - -void setsamplerate(int fd, int rate) { - command(fd,0xf3); - printf("-> PS/2: Set sample rate: %u\r\n",rate); - getack(fd); - command(fd,rate); - getack(fd); -} - -void setresolution(int fd, int res) { - command(fd,0xe8); - printf("-> PS/2: Set resolution: %u\r\n",res); - getack(fd); - command(fd,res); - getack(fd); -} - -void getstatus(int fd) { - command(fd,0xe9); - printf("-> Send status\r\n"); - receive(fd,3); - printf("<- Status is: 0x%02x,0x%02x,0x%02x\n",inbuffer[0],inbuffer[1],inbuffer[2]); -} - -void getlogiid(int fd) { - receive(fd,3); - unsigned char a = inbuffer[0]; - unsigned char id = ((a >> 4) & 0x07) | ((a<<3) & 0x78); - printf("Logi-id: %d\r\n", id); -}; - - -// Put trackpoint device into transparent mode -void enabletransparent(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x4e); - getack(fd); - printf("-> TP: Set soft-transparent\r\n"); -} - -// Get trackpoint device out of transparent mode -// Notice the command gives not-ack because its in transparent mode, -// just ignore these. After the command finishes to acknowledges are sent. -void disabletransparent(int fd) { - command(fd,0xe2); - //getack(fd); - command(fd,0xb9); - getack(fd); - printf("-> TP: Cancel soft-transparent\r\n"); -} - -// Detect external device on trackpoint controller -bool detectExternal(int fd) { - command(fd,0xe2); - getack(fd); - command(fd,0x21); - getack(fd); - receive(fd,1); - if(inbuffer[0] && 8) { - printf("<- TP: External device present\r\n"); - return true; - } - else { - printf("<- TP: No external device\r\n"); - return false; - } -} - -// IMPS/2 magic-initialization and detection -bool detectIMPS(int fd) { - setsamplerate(fd,200); - setsamplerate(fd,100); - setsamplerate(fd,80); - if(getdeviceid(fd)==3) { - printf("IMPS/2 mouse detected\r\n"); - } -} - - -int main() { - inbuffer = new unsigned char[200]; - outbuffer = new unsigned char[200]; - int fd = open("/dev/psaux", O_RDWR); - reset(fd); - // If kernel<2.4.9 remember to disable datareport, - // in later kernels reset is enough - disabledatareport(fd); - sleep(1); // make sure we dont get any more confusing datareports. - if(detectTP(fd)) { - if(detectExternal(fd)) { - enabletransparent(fd); - if(! detectIMPS(fd)) disabletransparent(fd); - setsamplerate(fd,200); - } - } else - detectIMPS(fd); - - enabledatareport(fd); - - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/create_vcs b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/create_vcs deleted file mode 100644 index 6670c413..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/create_vcs +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# -# Script by Jakub Jelinek -# Modified by Ian Zimmerman to reflect names from -# kernel device list -# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -if test -e /dev/vcs0 || test -e /dev/vcs -then - exit -fi - -I=0 -while [ $I -lt 25 ] -do - mknod /dev/vcs$I c 7 $I - chmod 622 /dev/vcs$I - chown root.tty /dev/vcs$I - mknod /dev/vcsa$I c 7 `expr $I + 128` - chmod 622 /dev/vcsa$I - chown root.tty /dev/vcsa$I - I=`expr $I + 1` -done -ln -s vcs0 /dev/vcs -ln -s vcsa0 /dev/vcsa diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/debug_to_report b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/debug_to_report deleted file mode 100644 index d7b7a266..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/debug_to_report +++ /dev/null @@ -1,7 +0,0 @@ - -cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp -cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp -cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2 -cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp -echo "done:" $1.tmp diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/gpm_release b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/gpm_release deleted file mode 100644 index d4ff8257..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/gpm_release +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Date: 26th of September 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001 -# Copying: GPL 2.0 -# - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to release ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! DIRECTORY! We need a gpm directory!' - exit 1 -fi - -version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'` -echo -n "Releasing gpm-$version ..." - -cd $1 - -cat configure.in | sed "s/release=.\*/release=$version/" > configure.on -mv configure.on configure.in -autoconf - -cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h - -cd .. - -tar cfz gpm-$version.tar.gz $1 -tar cfI gpm-$version.tar.bz2 $1 - -echo done. diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/gunze-setup b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/gunze-setup deleted file mode 100644 index 517f4715..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/gunze-setup +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/sh -# -# gunze-setup, copied and adapted from microtouch-setup. -# Most of this code is duplicated, this is definitely not good. -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -# The Gunze touchscreens don't adapt their output to calibration, so -# we must save calibration information somewhere... -set datafile /etc/gpm-calibration - -puts "Calibration program for Gunze touch-screens" - -# check generic permission -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - -# check if we can access this file -if [catch {set F [open $datafile a]} err] { - puts stderr "$argv0: Can't open $datafile: $err" - exit 1 -} -close $F - -# Look for /dev/touchscreen or /dev/mouse -if [file exists /dev/mouse] { - set dev /dev/mouse -} -if [file exists /dev/touchscreen] { - set dev /dev/touchscreen -} -if ![info exists dev] { - puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse" - exit 1 -} - -# horrible, for the linux console -proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] -} - -# an abort procedure, and one to read touchscreen data -proc do_abort {msg} { - if ![string compare $env(TERM) linux] { - goto 0 $env(LINES)-2 - } else { - wm withdraw . - } - puts stderr $msg - killall -CONT gpm - exit 1 -} - -proc get_position file { - global dev - while 1 { - gets $file string - if [scan $string %c%d,%d cmd x y]!=3 { - do_abort "Received wrong data \"$string\" from $dev" - } - # If release ('R') it's done - if $cmd==0x52 { - return "$sx $sy" - } - # If a touch event ('T'), save it - if $cmd==0x54 { - set sx $x; set sy $y - } else { - do_abort "Received wrong data \"$string\" from $dev" - } - } -} - - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - - # To calibrate, draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse - fconfigure $F -buffering none -translation auto - - # Draw the target - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - # Read coordinates - set first [get_position $F] - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - # Read coordinates - set second [get_position $F] - - # remove the target - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - # Now save the coordinates - set F [open $datafile w] - puts $F "# Calibration coordinates for Gunze device" - puts $F "$first $second" - close $F - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse -fconfigure $F -buffering none -translation auto - -.m.s configure -text "Calibration started" -update - -# Read coordinates -set first [get_position $F] - -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -# Read coordinates -set second [get_position $F] - -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm - -# Now save the coordinates -set F [open $datafile w] -puts $F "# Calibration coordinates for Gunze device" -puts $F "$first $second" -close $F - -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 - diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/make_diff b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/make_diff deleted file mode 100644 index 6f6cf0af..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/make_diff +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Date: 3rd of October 2001 -# Description: still missing -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# - -diff -u --recursive --new-file $@ diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/microtouch-setup b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/microtouch-setup deleted file mode 100644 index 30a7769c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/microtouch-setup +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# -# This program is execute by tclsh if we are in the console, and by wish -# otherwise (assuming we are under a graphic environment - -#the following is a comment for tcl \ -if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi - -#the following is another comment for tcl \ -exec wish $0 $* - -########### That's Tcl... - -puts "Calibration program for Microtouch screens" - -set who [exec whoami] -if [string compare $who root] { - puts stderr "you must be root to be able to run this program" -} - - -if ![string compare $env(TERM) linux] { - - # Text-mode calibration - - if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} { - puts stderr "Please set COLUMNS and LINES in your environment" - puts stderr " for example, you can issue" - puts stderr " eval `resize`" - puts stderr " in your shell before running this program" - exit 1 - } - fconfigure stdout -buffering none - exec clear > /dev/tty - - proc goto {x y} { - set x [expr $x] - set y [expr $y] - puts -nonewline [format "\x1B\[%03i;%03iH" $y $x] - } - - # To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y - set x [expr $env(COLUMNS)/8] - set y [expr $env(LINES)/8] - set X [expr $env(COLUMNS) - $x] - set Y [expr $env(LINES) - $y] - - # half x and y - set hx [expr $env(COLUMNS)/2] - set hy [expr $env(LINES)/2] - - goto $hx-10 $hy-1; puts -nonewline "Please touch the lower" - goto $hx-10 $hy-0; puts -nonewline "left target, then the" - goto $hx-10 $hy+1; puts -nonewline "upper right target." - - exec killall -STOP gpm - set F [open /dev/mouse r+] - fconfigure $F -buffering none - puts $F "\1CX\r" - - set ack [gets $F]; # Acknowledge - goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start" - - goto $x $Y-1; puts -nonewline "|" - goto $x-1 $Y; puts -nonewline "-+-" - goto $x $Y+1; puts -nonewline "|" - - set ack [gets $F]; # First calibration point - goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on" - - #remove the target, draw the other - goto $x $Y-1; puts -nonewline " " - goto $x-1 $Y; puts -nonewline " " - goto $x $Y+1; puts -nonewline " " - - goto $X $y-1; puts -nonewline "|" - goto $X-1 $y; puts -nonewline "-+-" - goto $X $y+1; puts -nonewline "|" - - set ack [gets $F]; # Next calibration point - goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok" - - goto $X $y-1; puts -nonewline " " - goto $X-1 $y; puts -nonewline " " - goto $X $y+1; puts -nonewline " " - close $F - - exec killall -CONT gpm - goto 0 $env(LINES)-2 - - puts "Done" - exit 0 - -} - -# X calibration. This is Tk, so we can use the canvas items. -# However, there is uncertainty about the absolute X and Y... - -set wid [winfo screenwidth .] -set hei [winfo screenheight .] -wm geometry . ${wid}x${hei}+0+0 - -set x [expr $wid/8] -set y [expr $hei/8] -set X [expr $wid - $x] -set Y [expr $hei - $y] -set hx [expr $wid/2] -set hy [expr $hei/2] -set cwid [expr 2*$x] -set chei [expr 2*$y] - -# The offset variables account for window manager borders etc -set xoff1 0 -set yoff1 0 -set xoff2 0 -set yoff2 0 - -proc recanvas {} { - global x y X Y xoff1 xoff2 yoff1 yoff2 - catch {.l.c delete line} - catch {.r.c delete line} - - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line -} - - -pack [frame .l] -side left -expand true -fill both -pack [frame .m] -side left -expand true -fill both -pack [frame .r] -side left -expand true -fill both -pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side bottom -pack [frame .l.f] -expand true -fill both; #filler -pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \ - ] -side top -pack [frame .r.f] -expand true -fill both; #filler - -pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40 -pack [label .m.l -bd 5 -relief raised] -expand true -fill both -pack [label .m.s] -expand true -fill both - -bind .l.c { - set xoff1 [expr %X - %x] - set yoff1 [expr %Y - %y] - set x1 [expr $x-$xoff1] - set y1 [expr $Y-$yoff1] - - catch {.l.c delete line} - - .l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \ - -width 3 -fill red -tag line - .l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \ - -width 3 -fill red -tag line - - set done1 1 - update -} -bind .r.c { - set xoff2 [expr %X - %x] - set yoff2 [expr %Y - %y] - set x2 [expr $X-$xoff2] - set y2 [expr $y-$yoff2] - - catch {.r.c delete line} - - .r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \ - -width 3 -fill red -tag line - .r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \ - -width 3 -fill red -tag line - - set done2 1 - update -} - -set done1 0; set done2 0 - -update - -.m.l config -text "Please move the mouse towards\n\ - the lower left corner, until a cross\n\ - appears (there's no need to click)" -vwait done1 - -update - -if !$done2 { - .m.l config -text "Please move the mouse towards\n\ - the upper right corner, until a cross\n\ - appears (there's no need to click)" - vwait done2 -} - -.m.l config -text "\nWait....\n" -after 1000 - -.m.l config -text "Please touch the lower-left taget\n\ - and then the upper-right target\n\ - to calibrate the touch screen" -update - -exec killall -STOP gpm -set F [open /dev/mouse r+] -fconfigure $F -buffering none -puts $F "\1CX\r" - -set ack [gets $F]; # Acknowledge -.m.s configure -text "Calibration started" -update - -set ack [gets $F]; # First calibration point -.l.c itemco line -fill green -.m.s configure -text "First target ok" -update - -set ack [gets $F]; # Next calibration point -.r.c itemco line -fill green -.m.s configure -text "Second target ok" -update - -close $F - -exec killall -CONT gpm -after 1000 -.m.s configure -text "" -pack [button .m.b -text Ok -command exit] - -exit 0 diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/mkinstalldirs b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/mkinstalldirs deleted file mode 100644 index 695bc75a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/replace_2_with_3_spaces b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/replace_2_with_3_spaces deleted file mode 100644 index 66592597..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/replace_2_with_3_spaces +++ /dev/null @@ -1,9 +0,0 @@ -# 8 -> 2*4 --> 4*3 = 12 -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 6=3*2 --> 3*3=9 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 4=2*2 --> 2*3=6 -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 2=1*2 --> 1*3=3 -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/replace_tab_with_3_spaces b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/replace_tab_with_3_spaces deleted file mode 100644 index 80e5ff29..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/replace_tab_with_3_spaces +++ /dev/null @@ -1,10 +0,0 @@ -# 4 tabs -cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 3 tabs -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -# 2 tabs -cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp -# 1 tab -cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2 -rm $1.tmp -echo done: $1.tmp2 diff --git a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/test_gpm b/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/test_gpm deleted file mode 100644 index c31d5ba2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/contrib/scripts/test_gpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Date: 18th of September 2001 -# Description: Test gpm with this script :) -# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001 -# Copying: GPL 2.0 -# Version: 0.2 -# - -PREFIX=test- -POSTFIX= - -if [ $# -ne 1 ]; then - echo `basename $0`': dir' - echo 'Hey, hey guy, what to test ?' - exit 1 -fi - -if [ ! -d $1 ]; then - echo `basename $0`': dir' - echo 'HEY! I need a DIRECTORY! Not something else!' - exit 1 -fi - -echo rm -rf $PREFIX`basename $1`$POSTFIX -r -rm -rf $PREFIX`basename $1`$POSTFIX -r -echo cp $1 $PREFIX`basename $1`$POSTFIX -r -cp $1 $PREFIX`basename $1`$POSTFIX -r - -echo rm -rf mkdir objdir -rm -rf objdir/ && mkdir -p objdir && cd objdir -echo configure -../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys -echo make -make diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/COPYING b/software/gpm/browse_source/gpm-1.99.7/doc/COPYING deleted file mode 100644 index e77696ae..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/FAQ b/software/gpm/browse_source/gpm-1.99.7/doc/FAQ deleted file mode 100644 index 90b8626a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/FAQ +++ /dev/null @@ -1,197 +0,0 @@ - -This file tries to summarize the questions that I've been responding over -and over. It is meant to save some time to both you and me :) - -If your problem with gpm isn't described here, feel free to ask me by -Email. - --- - __ o La forza dei forti sta nel traversare le traversie con occhio sereno - _`\<, (Paperino) -__( )/( )__ rubini@prosa.it +39-382-529554 - - -1. Installation / Compiling -2. Running problems -3. other questions - -=========================================================================== - -1. Installation / Compiling - -=========================================================================== -Q: Compilation fails with - - yacc gpm-root.y - make: /usr/bin/make: cannot execute binary file - make: *** [gpm-root.c] Error 126 - -A: This is a typical error (I've got several of them reported), though - not related to gpm. - - It looks like you have an old slackware installation, like mine, or - another faulty setup. I've been reported that slackware-3 is wrong - as well. - - The 'yacc' executable is a shell script that calls bison, and it - lacks the '#!/bin/sh' line (or has it incorrect, missing the - '!'). I don't remember the details, but while it runs under your - shell, it can't be executed under make. I looked in the binfmt - sources in the kernel, and /bin/sh doesn't appear explicitly, so - you must fix the first line in the 'yacc' script, and everything - should go fine. - - Note however that the server has already been compiles. Only the - gpm-root client, written with yacc, is affected by this problem. - -=========================================================================== - -2. Running problems - -=========================================================================== - -Q: My serial mouse works in X with ms protocol, but behaves erratically - with gpm on the text console, and I get involuntary pastes. - -A: Many ms protocol mice equipped with three buttons use an extension - to the protocol, which consists in repeating events (thus with no - effect under the normal protocol) to signal a change in the middle - button. Unfortunately, some old true-ms protocol mice do repeat - events, thus triggering the middle-button in gpm. - - If you're running your mouse with ``-t ms'', you'd better try ``-t - bare'', which is the unadorned ms protocol of the old days. My - choice to use the third-button extension as the default, was taken - because a true ms protocol doesn't repeat event notification, and - because many three button mice feature the extension. - ---------------------------------------------------------------------------- -Q: I have a serial mouse. It works fine except that when I try to drag - the mouse with the middle button pressed, gpm assumes that the middle - button has been released. Dragging with the other buttons works just - fine. - -A: You are probably running your mouse with ``-t ms''. In this mode - dragging with the middle button has been deliberately disabled in - order to prevent problems with faulty mice that fail to report - middle-button events during mouse motion. - - Try using ``-t ms+'' or ``-t ms+lr'' instead. - ---------------------------------------------------------------------------- -Q: My mouse gets into a state where it thinks the middle button is up - when it's down and vice versa. - -A: Your mouse uses an extension to the m$ protocol in order to report - the middle button. It sends empty events (i.e., no-motion & - no-button-change) in order to report a change in the status of the - middle button. - - Unfortunately many devices that report middle-button events in this - way often fail miserably to report them correctly during mouse - motion. Since the protocol does not distinguish between the button - going up and the button going down it can easily get out of step - with reality. - - There are two solutions: either use ``-t ms'', which disallows - dragging with the middle button, so you can get back to normal - simply by moving the mouse without any buttons pressed; or (probably - better) use ``-t ms+lr'', which allows you to reset the state of - the middle button by pressing the other two buttons together. (If - you want you can also deliberately get gpm out of step with reality - by pressing the left and right buttons while holding the middle - button!) - - Note that there are many more faulty mice in the world than - non-faulty ones so you will probably will have to use ``-t ms+lr'' - rather than ``-t ms+''. - - Note also that most 3-button mice that use the microsoft protocol can - be made to use the MouseSystems protocol instead. You might want to - read about this in the ``3 Button Serial Mouse mini-HOWTO''. - ---------------------------------------------------------------------------- -Q: My mouse doesn't sense the middle button in X, while it works with - gpm. - -A: Gpm uses a different decoder (see the previous two answers). You - can use the ``-R'' option to repeat mouse data to X (look at the man - page). - ---------------------------------------------------------------------------- -Q: I have a busmouse, and I have the single-open problem. Is there any - way around it? - -A: Try the -R option of gpm (look at the man page) - ---------------------------------------------------------------------------- -Q: I run "-t ms", and I get double-paste when I press the middle button. - Is there any workaround? - -A: Try "-t mman" instead. - ---------------------------------------------------------------------------- -Q: I have one of the new devices of old dear Bill, and gpm doesn't work any - more. What can I do? - -A: Bill chose to use its own Plug-and-Pray specification, which finally - managed to break what worked painlessly for ages. The decoder for - any gpm up to 1.12 (and also any X version being used at the time) - is unable to deal with the new devices, which claim to be designed - to work with older drivers. Try to use "-t pnp" instead of "-t ms" - and see if it works with this gpm version. Actually, this version - might even work with "-t ms" or "-t bare", but I'm not sure about - it. If the version of X you run has problems, while gpm now works, - try passing the "-R" option to gpm (see the man page). Note that - "-t pnp" is strongly discouraged, as any time the serial port is - opened (for example when switching from X to text mode if "-R" is - not active) it will take several seconds to be initialized -- a - design misfeature of pnp. If either "-t ms" or "-t bare" work use - them instead. - - If you are in the software field, you can enjoy the inaccuracies of - the specs and design bugs directly from the originators: - http://www.microsoft.com/hwdev/download/pnpcom.exe. You'll find the - following, and more: - - no support for real multitasking (the mouse driver must be able - to keep hold of processor time for at least 1 second). - - no pnp vendor will be able to support three buttons any more (no - more mouse protocols, all mice must behave the same). - - similary, only 1200 baud devices (any serial device) are supported, - because the initialization string of pnp devices only tells - the vendor and release, with no information about required - port configuration. - - people with UPS will have great troubles with ms software - because the pnp probing sequence plays with DTR, and w95 - probes all serial ports. This funny idea might turn off - the UPS connected with your computer just after booting w95. - - Don't despair. They will manage to make worse designs later on. - ---------------------------------------------------------------------------- -Q: I have an old 386 computer around here and gpm is _really_ slow. Is there - any way I can make it faster ? - -A: Go into src/headers/gpmCfg.h and look for DEF_CLUSTER. Change its values from - 0 to 10. - ---------------------------------------------------------------------------- -Q: gpm.conf is not accepted / does not work, but gpm works from command line. - -A: gpm.conf is not from gpm itself. Please contact your distrubtion support - to clearify whats wrong. - -=========================================================================== - -3. other questions - -=========================================================================== - -Q: I am gonna buy computer X, do I have any chance getting gpm running on it? -A: - a) If it does not work, you could at least try to port it ;) - - b) As report by a friend, gpm currently runs on Linux on - - i386 - Alpha - ARM - PA-RISC - ia64 (Itanium) - PPC - m68k - MIPS - SPARC - - It's possible that you need some patches for some architecture. diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/Makefile.in b/software/gpm/browse_source/gpm-1.99.7/doc/Makefile.in deleted file mode 100644 index 3ef6bc3e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/Makefile.in +++ /dev/null @@ -1,188 +0,0 @@ -# -*-makefile-*- (gpm/doc) -# -# Copyright (C) 1994 Alessandro Rubini -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001 Nico Schottelius -# -# -# Do you ever got headache from reading Makefiles ? I will help you and -# me to understand this Makefile: -# -# The main file is doc.gpm (which is generated by configure from doc.gpm.in). -# -# doc.gpm is not 'real' texinfo, real texinfo is generated by infofilter -# to gpm.texinfo. -# -# gpm.texinfo is the source of all other formats. -# -# info is generated by makeinfo (I make that for you). -# -# man pages are generated with the help of manpager. -# -# dvi is generated from texinfo with a small block in this Makefile. -# -# ps is generated from dvi source. -# - -SHELL = /bin/sh -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -builddir = @builddir@ -top_builddir = .. - -include $(top_builddir)/Makefile.include - -MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -all: gpm.info gpm.man - -# HTML (texi2html) -%.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) -monolithic $< ;fi - -# TEXINFO (-) -%.texinfo: doc.% Makefile $(srcdir)/infofilter - @rm -f $@ # correct here ? - $(SED) -f $(srcdir)/infofilter $< > $@ - chmod 400 $@ - -# PS (dvips) -%.ps: %.dvi - if [ $(DVIPS) != "no" ]; then $(DVIPS) -f $< > $@; fi - -# INFO (makeinfo) -%.info: %.texinfo - if [ "$(MAKEINFO)" != "no" ]; then $(MAKEINFO) --no-split $< -o $@; fi - -# TXT (-) -%.txt: %.info $(srcdir)/mktxt - $(AWK) -f $(srcdir)/mktxt $< > $@ - -# MAN (-) -$(MANPAGES): gpm.man -gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager $< - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; - touch gpm.man - - -# DVI -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -%.dvi: %.texinfo - -# create a spurious index file to please silly sh (bash will work anyway) -# is this still needed for someone ? - touch $*.oo - -# get the index list, but only if tex is installed -# check the file list, the file and if needed run TeX again -# -# can somebody tell me in a very short way what format dvi is and why we -# cannot generate ps directly ? - - if [ -n "`ls $*.?? $*.aux 2>/dev/null`" -a "$(TEX)" != "no" -a \ - "$(TEXINDEX)" != "no" ]; then \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do cp $$i $$i~; done; \ - $(TEX) $< \ - old="`ls $*.??~ $*.aux~ 2>/dev/null | $(SED) 's/~//g'`"; \ - new="`ls $*.?? $*.aux 2>/dev/null`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $*.?? $*.aux 2>/dev/null`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - $(TEXINDEX) $*.?? && $(TEX) $<; \ - fi; \ - fi - -# why gpmdoc.ps and gpm.ps?? -# there is no gpm.ps in my tree and no rule to generate gpm.ps. -gpmdoc.ps: gpm.ps - -$(CP) $< $@ - -# install & uninstall - -installdirs: - $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) - -install: all installdirs - $(INSTALL_DATA) -m 644 mev.1 $(man1dir) - $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) - $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) - $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) - $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) - # Use install-info if available - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ - fi; \ - fi - #itz Sat Dec 26 23:21:05 PST 1998 - #i keep all my infopages compressed and i'm tired to do it by - #hand, so check if there are any compressed pages and do this - #one too - -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ - && gzip -f $(infodir)/gpm.info - # Hmm.... shouldn't man pages be compressed too? - # maybe they should, but at least at my system they are not. - -# This potentially leaves around cached manpages, -# e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, -# but the job of the man program on the host. -uninstall: - cd $(man1dir) && rm -f mev.1 mouse-test.1 gpm-root.1 - rm -f $(man7dir)/gpm-types.7 $(man8dir)/gpm.8 - rm -f $(infodir)/gpm.info $(infodir)/gpm.info.gz - -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - if [ -f $(infodir)/dir ] ; then \ - install-info --dir-file=$(infodir)/dir \ - --remove $(infodir)/gpm.info; \ - fi; \ - fi - -# configure & unconfigure - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) && $(SHELL) config.status - -## CLEANUP section -# normal cleanup -clean: - rm -f gpmdoc.ps gpmdoc.txt $(MANPAGES) *~ - rm -f gpm.?? gpm.??? - rm -f gpm.texinfo - -# for creating distribution -distclean: clean - rm -f Makefile doc.gpm - -# to even remove things we leave for end-users -allclean: distclean - rm -f gpm.info - -# Maintainer portion, use at your own risk - -# ignore this: -TAGS: - -## DIST section -# when we cleaned it, we can securely copy us. -dist: distclean - # unneeded now: using pax + -s option and create tars in .. - #$(CP) -r $(srcdir) $(top_builddir)/gpm-$(release)/ - -.INTERMEDIATE: gpm.ps -.SECONDARY: %.ps %.texinfo %.dvi - -gs: gpm.ps - gs -sDEVICE=linux -r640x480x2 $< - -gv: gpm.ps - ghostview gpm.ps -magstep -1 -a4 diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/README.1.20.2 b/software/gpm/browse_source/gpm-1.99.7/doc/README.1.20.2 deleted file mode 100644 index 882a70f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/README.1.20.2 +++ /dev/null @@ -1,54 +0,0 @@ - - - Dear reader, - - - you are reading this document, because you saw that there is a new - release of gpm available, gpm 1.20.2. - - Unfortunately this release is broken, but that's not a big problem. - - gpm is broken for some time and I did not spent any time to the project - for about two years. - - Some weeks ago, I was contacted by someone asking me to write a very - small feature for gpm (a small client program, included in this - release). I answered the person that I do not have the time to code - that part, but if he really insists that I should write that code, - he should think about sponsoring me [0]. - - Some days later I recieved an email that he wanted to sponsor me. - I was a little bit surprised, because it was the first person really - considering my sponsoring plans. - - So I coded that small program and had some views in the old code of - gpm. There's so much information in it, so many hacks, so many dirty - tricks and there are still many people using it. - - So I considered to try to spent more time to gpm, perhaps even creating - a more clean (and better maintainable) version of it. - - But I _am_ actually a pretty busy person, working almost all time, if not - doing sports (just about 6 hours a week) or sleeping. - - So I thought, perhaps you can help me to get more time for coding FOSS [1] - in general or gpm in specific: - - My idea is, that if you consider sponsoring my work, I can begin to work less - "traditionally" and also finance my second study in computer science, which - I will begin in autumn 2008, if I have the money to do it (living in - Switzerland is not that cheap). - - I am looking forward to get any feedback from you about this idea - at nico-gpm-sponsoring (at) schottelius.org. - - Thanks for reading, - - - Nico Schottelius, 12. May 2007 - - - P.S.: GPM is alive! - - [0]: Sponsoring information: http://nico.schottelius.org/about/support - [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.20.4 b/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.20.4 deleted file mode 100644 index e3d96da0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.20.4 +++ /dev/null @@ -1,4 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos - * Added automatic local build test - * Fixed SONAME (praise the Debian guys, Jonathan Nieder) diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.20.5 b/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.20.5 deleted file mode 100644 index 0f96524f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.20.5 +++ /dev/null @@ -1,13 +0,0 @@ -Released: 16th of June 2008 -Changes: - * Fix possible segfault (FD_SET/negative) (Guillem Jover) - * Move more messages to debug (Jonathan Nieder) - * Remove unecessary headers (Jonathan Nieder) - * Allow specifying ELISP variable on commandline (Ulrich Mueller) - * Fix broken code semantics (Mike Frysinger) - * Cleanup documentation (Nico Schottelius) - * Fix socklen_t issue: Require posix header (Mike Frysinger/Nico Schottelius) - * Fix building with glibc 2.8 (Mike Frysinger) - * Updated library to version 2.1.0 (Nico Schottelius) - Gpm_GetLibVersion behaves more consistent (all numbers are one or two digits) - * Including dynamically generated version from git (Nico Schottelius) diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.99.6 b/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.99.6 deleted file mode 100644 index afe22868..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.99.6 +++ /dev/null @@ -1,11 +0,0 @@ -2008-04-29: Nico Schottelius - * Merge changes from 1.20.3pre6 and 1.20.3 - * Make it compile again on Linux/ppc (-Werror broke it) (acrux) - * Add initial evabs documentation (name missing) - * Update much autoconf stuff, do not use acconfig.h anymore - * Add bugfixes (possible segfault) and cleanups (Bernhard Fischer) - * Whitespace cleanup (Bernhard Fischer) - * Fix memory clobbering in synaptics code (Pavel Semerad) - * Makefile and documentation updates (Mike Frysinger) - * Include automatic generation of checksum - * Include release date and git version diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.99.7 b/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.99.7 deleted file mode 100644 index 4517c11b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/changes/1.99.7 +++ /dev/null @@ -1,8 +0,0 @@ -Released: 24th of July 2008 -Changes: - * Merge changes from 1.20.4 and 1.20.5 - * Re-indent the whole sourcecode using indent_script from - http://unix.schottelius.org/cgi-bin/gitweb.cgi?p=nsbin;a=summary - * Remove unecessary GLIBC-hacks - * Apply some build cleanups (Bernhard Fischer) - * Add dynamic version include (Nico Schottelius) diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/changes/gpm-1-before-1.20.4 b/software/gpm/browse_source/gpm-1.99.7/doc/changes/gpm-1-before-1.20.4 deleted file mode 100644 index 2b2ece56..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/changes/gpm-1-before-1.20.4 +++ /dev/null @@ -1,66 +0,0 @@ -* From 1.20.3 to 1.20.4: - * Corrected typos - - pre1: - Possibly merge changes from 1.99.x to get tree up-to-date again - -* From 1.20.1 to 1.20.3: (bugfix/code cleanup) - o Applied many cleanups - o Added etouch support - o Added scripts/report_success.sh - o Updated README - - pre6: - Cleaned up "make dist" target - Added two debbugging programs: - src/prog/display-buttons.c: display pressed buttons - src/prog/display-coords.c: display mouse coordinates - Fixed Bug#474516: gpm: debug messages in syslog (Debian) - - pre5: - Fix default handler in liblow.c - pre4: - gpm.c and gpn.c were split off from each other. - Some Debian patches were applied. - pre3: - Many cleanups based on 1.20.1 were made, which should - make it usable for distributors and end-users. - pre2: - Pre-distributors release - pre1: - First compiling version made of 1.20.1 and bugfixes. - -* From 1.20.1 to 1.20.2: - * 1.20.2 does not exist as a real release, it is broken. - -* From 1.20.0 to 1.20.1: (bugfixes/code clean) - o synaptics ps2 touchpad support - o code cleanup in various main files - o prototype of mouse support for n-mice. expect final in 1.20.3. - -* From 1.19.6 to 1.20.0: (bugfix/new features/code clean release) - o removed compile problems - o objdir/ support without problems - o cleaned up internal message functions - o cleanup up most of tab/spaces mixture. Now we use 3 spaces for indention - o added more security bug fixing patches - o clean {g,m,}awk support - o clean ps2 initialization (allows using ps2 mouse after you used synps!) - o gpm clients can't cause gpm do die. - -* From 1.19.5 to 1.19.6: (just a bugfix release) - o bugfixes in Makefiles (now a 'make all install' should not make any errors) - o bugfix in libgpm, mouse-test, gpm - o doc/gpm.doc is up-to-date and the manfiles, too. info is still missing. - -* From 1.19.4 to 1.19.5: (minor fixes and one bugfix) - o libc5 and linux 2.0 support in again - o cleaned up the directory tree - o many small changes to the Makefiles - o devfs seperated into new file - o Synaptics 4 Button Touchpad support - o new daemon name - -* From 1.19.3 to 1.19.4: - o libc5 and linux 2.0 support removed unfortuanally! - o primary devfs support (broken) diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/changes/gpm-2-before-1.99.6 b/software/gpm/browse_source/gpm-1.99.7/doc/changes/gpm-2-before-1.99.6 deleted file mode 100644 index ddfa4280..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/changes/gpm-2-before-1.99.6 +++ /dev/null @@ -1,13 +0,0 @@ -1.99.6: - * Merge changes from 1.20.3pre6 and 1.20.3 - * Make it compile again on Linux/ppc (-Werror broke it) - * Add initial evabs documentation - * Update autoconf stuff, do not use acconfig.h anymore - * Add bugfixes (possible segfault) and cleanups from Bernhard Fischer -1.99.5: Nico Schottelius, 20080401 - * Removed all compiling warnings: -Werror, -Wall, -Wextra are on! -1.99.4: Nico Schottelius, 20080330 - * Complete splitoff of mice.c! - * Renamed conf/ to example-configurations -1.99.3: Nico Schottelius, 20080326 - * Added evabs support diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/devel/HACK_GPM b/software/gpm/browse_source/gpm-1.99.7/doc/devel/HACK_GPM deleted file mode 100644 index cb42f343..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/devel/HACK_GPM +++ /dev/null @@ -1,19 +0,0 @@ -Hello! - -Nice that you read this document, looks like someone wants to improve gpm again. -I assume you have a good idea or you did some good work you want to see in the -main gpm tree. To make life easy for you and me, please follow the instructions: - - * if you send a patch, explain why it's needed - * if possible, please patch against latest git sources (see README in top level directory) - * if the patch introduces generally new things, explain how it works - * use 3 spaces tabs in the source files (if you use tabs, look into - contrib/scripts/replace_tab_with_3_spaces) - * Coding style is defined by this indent_script: - http://unix.schottelius.org/cgi-bin/gitweb.cgi?p=misc/nico-bin.git;a=tree - * make small patch files - * include directory structure (src/mice.c and not mice.c) - -Thanks for your help, - -Nico diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/doc.gpm.in b/software/gpm/browse_source/gpm-1.99.7/doc/doc.gpm.in deleted file mode 100644 index 0dafb316..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/doc.gpm.in +++ /dev/null @@ -1,2296 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.gpm - main file for the documentation -% -% Copyright 1994,1995,1998 rubini@linux.it (Alessandro Rubini) -% Copyright (C) 1998 Ian Zimmerman -% Copyright (C) 2001-2008 Nico Schottelius -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ASCII, you should "make gpm.txt". -% -% Some strings maybe changed from the configure script. -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker ("\%" -> "%") -% - leading blanks are allowed (and removed) -% - -@comment %**start of header -@setfilename gpm.info -@settitle gpm @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@ifinfo -@format -@dircategory Miscellaneous -@direntry -* Gpm: (gpm). Text-mode (non-X) mouse library and server daemon. -@end direntry -@end format -@end ifinfo - -@setchapternewpage off - -@set version @release@ -@set update-month @release_date@ - -@finalout - -@ifinfo -%ASCII_BEGIN - -This file is a user's and programmer's manual for gpm @value{version}. - -Copyright (C) 1994,1995,1998 Alessandro Rubini -Copyright (C) 2001-2008 Nico Schottelius - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title gpm @value{version} -@subtitle A general purpose mouse server for the Linux console -@subtitle @value{update-month} - -@author by Nico Schottelius - -@end titlepage -@setchapternewpage off -@headings single - -@ifinfo -This file documents the @value{version} release of the "General Purpose -Mouse" (gpm) server for the Linux text console (@value{update-month}). - -@node Top, Overview, (dir), (dir) -@top gpm - -@menu -* Overview:: -* Server Invocation:: -* Gpm Internals:: -* The ClientLib:: -* Demo Clients:: -* Type Index:: -* Function Index:: -* Variable Index:: -@end menu - -@end ifinfo -%########################################################################## -%########################################################################## - -@node Overview, Server Invocation, Top, Top -@chapter Overview -@cindex Overview of Gpm -@cindex Gpm Overview - - -The @dfn{gpm} package is a mouse server for the Linux console. It is -meant to provide cooked mouse events to text-only applications, such as -editors and simple menu-based apps. The daemon is also able to repeat -packets in "msc" format to a graphic application. This last feature is -meant to override the single-open problem of busmice. The roots of -@code{gpm} come from the @file{selection-1.5} package, by Andrew Haylett. - -The first application to support the mouse has been The Midnight Commander, -by Miguel de Icaza. @file{mc-0.11} and later releases offer -mouse support if you have the mouse server running on your system. -The file @file{t-mouse.el} provides support for using the -mouse from within Emacs. @xref{Emacs Support}. - -As of release 0.96, a default-handler is released with gpm, and can be -used to handle Control-Mouse events to draw menus on the screen. -The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. -@xref{gpm-root}. - -Release 1.00 has been an incompatible one (is is incompatible with -releases older than 0.97), but is compatible with the kernel-level mouse -driver (available as @file{kmouse-?.??.tar.gz} from the mirrors of -@uref{ftp://tsx-11.mit.edu}. With 1.0 the high level library is available, -together with a demonstration/test program. A small utility to help in -detecting your mouse-type is also included. - -As of release 1.20.0 the default device is removed. Now -m is a must. - -Release 1.20.1 introduces the must for -t and a specific way to use -m,-t,-o: -Now you've got to use -m first, then -t and at last -o. -This seems to be more complex, but makes using of multiply mice possible with -clean code. - -@menu -* Building the Release:: -@end menu - -%========================================================================= -@node Building the Release, , Overview, Overview -@section Compiling and Installing -@cindex Building Gpm - -Just say @code{./configure && make && make install} to your -shell. You'll need gpm installed to compile the latest release of -The Midnight Commander with mouse support enabled. - -Binaries are not released with the package because it's safer for you to -compile the package by yourself. - -%========================================================================= -%@node Kernel Patches -%@section Kernel Patches -%@cindex Kernel Patches -%@cindex Patches to Apply -% -%Old Linux kernels need to be patched to provide features I rely on. As -%of 1.1.32, however, my patches are in the official release, so you won't -%need any kernel recompilation. Remember, anyway, to enable selection while -%compiling the kernel, or this package won't work. Refer to -%@file{kernel/README} to probe further. -% -%Other features are needed to run the @t{gpm-root} client. They are -%really functional only since 1.1.73. 1.1.68, however, should be sufficient. -% - -%########################################################################## -@node Server Invocation, Gpm Internals, Overview, Top -@chapter Server Invocation -@cindex The Server -@cindex Command Line (gpm) - -%MANPAGE gpm.8 -%M .TH GPM 8 "February 2002" -%M .UC 4 -%M .SH NAME -%M gpm \- a cut and paste utility and mouse server for virtual consoles -%M .SH SYNOPSIS -%M .B gpm -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION -%M This package tries to be a useful -%M mouse server for applications running on the Linux console. It is -%M based on the "selection" package, and some of its code -%M comes from selection itself. This package is intended as a replacement -%M for "selection" as a cut-and-paste mechanism; it also provides -%M additional facilities. The "selection" -%M package offered the first cut-and-paste implementation for Linux using -%M two mouse buttons, and the cut buffer is still called "selection buffer" -%M or just "selection" throughout this document. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The @code{gpm} executable is meant to act like a daemon (thus, @code{gpmd} -would be a better name for it). This section is meant to describe the -command-line options for @code{gpm}, while its internals are outlined in -the next section. -@xref{Gpm Internals}. - -Due to restrictions in the @code{ioctl(TIOCLINUX)} system call, @code{gpm} must -be run by the superuser. The restrictions have been added in the last 1.1 -kernels to fix a security hole related to selection and screen dumping. - -The server can be configured to match the user's taste, and any -application using the mouse will inherit the server's -attitude. From release 1.02 up to 1.19.2 is was possible -for any user logged on the system console to change the mouse @emph{feeling} -using the @t{-q} option. This is no longer possible for security -reasons. - -As of 0.97 the server program puts itself in the background. To kill -@code{gpm} you can just reinvoke it with the @samp{-k} cmdline switch, -although @code{killall gpm} can be a better choice. - -@menu -* Special Commands:: -* Command Line:: -* Bugs and Problems:: -* Mouse Types:: -@end menu - -%M .SH SPECIAL COMMANDS -%========================================================================== - -@node Special Commands, Command Line, Server Invocation, Server Invocation -@section Special Commands - -Version 1.10 adds the capability to execute @emph{special} commands on -certain circumstances. Special commands default to rebooting and halting -the system, but the user can specify his/her personal choice. The -capability to invoke commands using the mouse is a handy one for -programmers, because it allows to issue a clean shutdown when the -keyboard is locked and no network is available to restore the system to -a sane state. - -Special commands are toggled by triple-clicking the left and right button -- -an unlikely event during normal mouse usage. The easiest way to triple-click -is pressing one of the buttons and triple-click the other one. When special -processing is toggled, a message appears on the console (and the speaker -beeps twice, if you have a speaker); if the user releases all the buttons -and presses one of them again within three seconds, then the special -command corresponding to the button is executed. - -The default special commands are: - -@table @var -@item left button - Reboot the system by signalling the init process - -@item middle button (if any) - Execute @code{/sbin/shutdown -h now} - -@item right button - Execute @code{/sbin/shutdown -r now} -@end table - -The @samp{-S} command line switch enables special command processing and -allows to change the three special commands. To accept the default -commands use @samp{-S ""} (i.e., specify an empty argument). To specify -your own commands, use a colon-separated list to specify commands -associated to the left, middle and right button. If any of the commands -is empty, it is interpreted as `send a signal to the init process'. This -particular operation is supported, in addition to executing external -commands, because sometimes bad bugs put the system to the impossibility -to fork; in these rare case the programmer should be able to shutdown -the system anyways, and killing init from a running process is the only -way to do it. - -As an example, @samp{-S ":telinit 1:/sbin/halt"}, associates killing -init to the left button, going single user to the middle one, and halting -the system to the right button. - -System administrators should obviously be careful about special -commands, as gpm runs with superuser permissions. Special commands are -best suited for computers whose mouse can be physically accessed only by -trusted people. - -%M .SH COMMAND LINE OPTIONS -%========================================================================== -@node Command Line, Bugs and Problems, Special Commands, Server Invocation -@section Command Line Options - -Available command line options are the following: - -@table @code -@item -a @var{accel} - Set the acceleration value used when a single motion event is - longer than @var{delta} (see @samp{-d}). - -@item -A[@var{limit}] - Start up with selection pasting disabled. This is intended as a - security measure; a plausible attack on a system seems to be to - stuff a nasty shell command into the selection buffer - (@code{rm -rf /}) including the terminating line break, then all the - victim has to do is click the middle mouse button .. - As of version 1.17.2, this has developed - into a more general aging mechanism; the - gpm daemon can disable (@emph{age}) selection pasting - automatically after a period of inactivity. To enable this mode - just give the optional @var{limit} parameter (no space in between !) - which is interpreted as the time in seconds for which a selection is - considered valid and pastable. - As of version 1.15.7, a trivial program called - @code{disable-paste} is provided. The following makes a good - addition to @file{/etc/profile} if you allow multiple users to - work on your console. - - @code{case $( /usr/bin/tty ) in @* /dev/tty[0-9]*) /usr/bin/disable-paste ;; @* esac} - -@item -b @var{baud} - Set the baud rate. - -@item -B @var{sequence} - Set the button sequence. @samp{123} is the - normal sequence, @samp{321} can be used by left-handed people, - and @samp{132} can be useful with two-button mice (especially within - Emacs). All the button permutations are allowable. - -@item -d @var{delta} - Set the delta value. When a single motion event - is longer than @var{delta}, @var{accel} is used as a multiplying - factor. (Must be 2 or above) - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -g @var{number} - With glidepoint devices, emulate the specified button with tapping. - @var{number} must be @samp{1}, @samp{2}, or @samp{3}, and refers to the - button number @emph{before} the @samp{-B} button remapping is performed. - This option applies to the mman and ps2 decoding. No button is - emulated by default because the ps2 tapping is incompatible with - some normal ps2 mice - -@item -h - Print a summary of command line options. - -@item -i @var{interval} - Set @var{interval} to be used as an upper time limit - for multiple clicks. If the interval between button-up and - button-down events is less than @var{limit}, the press is considered - a double or triple click. Time is in milliseconds. - -@item -k - Kill a running gpm. This can be used by busmouse users to kill gpm - before running X (unless they use @samp{-R} or the single-open - limitation is removed from the kernel). - -@item -l @var{charset} - Choose the @code{inword()} look up table. The - @var{charset} argument is a list of characters. @samp{-} is used to - specify a range and @samp{\ } is used to escape the next character - or to provide octal codes. - Only visible character can appear in @var{charset} because control - characters can't appear in text-mode video memory, whence selection - is cut. - -@item -m @var{filename} - Choose the mouse file to open. Must be before -t and -o. - -@item -M - Enable multiple mode. The daemon will read two different mouse devices. - Any subsequent option will refer to the second device, while any - preceding option will be used for the first device. This option - automatically forces the @emph{repeater} (@samp{-R}) option on. - -@item -o @var{list-of-extra-options} - The option works similary to the ``-o'' option of mount; it is - used to specify a list of ``extra options'' that are specific - to each mouse type. The list is comma-separated. The options - @samp{dtr}, @samp{rts} or @samp{both} are used by the serial - initialization to toggle the modem lines like, compatibly with - earlier @i{gpm} versions; note however that using @t{-o dtr} - associated with non-plain-serial mouse types may now generate - an error. @xref{Mouse Types}. - And by the way, use -o after -m and after -t. - -@item -p - Forces the pointer to be visible while selecting. This is the - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - - -@item -r @var{number} - Set the responsiveness. A higher responsiveness is used for a faster - cursor motion. - -@item -R[@var{name}] - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}, given as an optional argument (no space in - between !). In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X - server to use its fifo as a mouse device. This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option - is forced on by the @samp{-M} option. - -@item -s @var{number} - Set the sample rate for the mouse device. - -@item -S @var{commands} - Enable special-command processing, and optionally specify custom - commands as a colon-separated list. See above for a detailed - description of special commands. - -@item -t @var{name} - Set the mouse type. Use @samp{-t help} to get a list - of allowable types. Since version 1.18.1, the list also shows - which protocols are available as repeaters (see @t{-R} above), - by marking them with an asterisk (``@t{*}''). - @xref{Mouse Types}. - Use -t after you selected the mouse device with -m. - -@item -v - Print version information and exit. - -@item -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. - -@item -3 - Force three buttons. By default the - mouse is considered to be a 2-buttons one, until the middle button - is pressed. If three buttons are there, the right one is used - to extend the selection, and the middle one is used to paste it. - Beware: if you use the @samp{-3} option with a 2-buttons mouse, you - won't be able to paste the selection. - -@end table - -@ignore -.SH OPERATION - -To select text press the left mouse button and drag the mouse. -To paste text in the same or another console, press the middle button. -The right button is used to extend the selection, like in `xterm'. - -Two-button mice use the right button to paste text. - -Double and triple clicks select whole word and whole lines. Use of -the `-p' option is recommended for best visual feedback. - -If a trailing space after the contents of a line is highlighted, and if -there is no other text on the remainder of the line, the rest of the -line will be selected automatically. If a number of lines are selected, -highlighted trailing spaces on each line will be removed from the -selection buffer. - -Any output on the virtual console holding the selection will clear the -highlighted selection from the screen, to maintain integrity of the -display, although the contents of the paste buffer will be unaffected. - -The selection mechanism is disabled if the controlling virtual console -is placed in graphics mode, for example when running X11, and is -re-enabled when text mode is resumed. (But see BUGS section below.) - -@end ignore - -%MSKIP -@menu -* Bugs and Problems:: -@end menu - -@node Bugs and Problems, Mouse Types, Command Line, Server Invocation -@section Bugs and Problems - -%M .SH BUGS -The @code{gpm} server may have problems interacting with X: if your -mouse is a single-open device (i.e. a bus mouse), you should kill -@code{gpm} before starting X, or use the @samp{-R} option (see -above). To kill @code{gpm} just invoke @code{gpm -k}. This problem doesn't -apply to serial mice. - -Two instances of gpm can't run on the same system. If you have two mice use -the @samp{-M} option (see above). - -While the current console is in graphic mode, @code{gpm} sleeps until -text mode is back (unless @samp{-R} is used). Thus, it won't reply to -clients. Anyways, it is unlikely that mouse-eager clients will spur -out in hidden consoles. - -The clients shipped out with gpm are not updated, thus there are potential -security risks when using them. - -@ignore - -.SH AUTHORS -.nf -Andrew Haylett (the original selection code) -Ian Zimmerman (old maintainer) -Alessandro Rubini (old maintainer (still helps a lot)) -Nico Schottelius (maintainer) - -Many many contributors, to both selection and gpm. -.fi - -.SH MAINTAINERS - -The current maintainer is Nico Schottelius. But without the help of -Alessandro Rubini and the mailing list it would be impossible for me to -maintain gpm. The development mailing list can be reached under -gpm@lists.linux.it. More information on the list is in the README file part of -the source distribution of gpm. - -.SH FILES -.nf -/var/run/gpm.pid The PID of the running gpm -/dev/gpmctl A control socket for clients -/dev/gpmdata The fifo written to by a \fBrepeater\fP (`-R') daemon. -.fi - -.SH SEE ALSO -.nf -\fB mev(1)\fP A sample client for the gpm daemon. -\fB gpm-root(1)\fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node Mouse Types, , Bugs and Problems, Server Invocation -@section Mouse Types - -%MANPAGE gpm-types.7 -%M .TH GPM-TYPES 7 "July 2000" -%M .UC 4 -%M .SH NAME -%M gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. -%M .br -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .SH DESCRIPTION -%MSKIP -This section of the gpm documentation manual -%M This manpage -describes the various pointer types currently available in @i{gpm}. If you -look at the source code, you'll find that pointer-specific code is -confined to @file{mice.c} (while it used to only include mouse decoders, -@i{gpm} now supports tablets and touchscreens as well). - -The mouse type is specified on command line with the @samp{-t} -option. The option takes an argument, which represents the name of a -mouse type. Each type can be associated to different names. For old -mouse types, one name is the old selection-compatible name, and another -is the XFree name. After version 1.18.1 of @i{gpm}, the number of -synonyms was made arbitrary and the actual name being used is made -available to the function responsible for mouse -initialization. Therefore it is possible for a mouse decoder to behave -slightly differently according to the name being used for the device (if -this feature was already present, we wouldn't have for example @t{ms+} -and @t{ms+lr} as different mouse types). - -The initialization procedure of each mouse type can also receive extra -option, by means of the @t{-o} command line option. Since -interpretation of the option string is decoder-specific, the allowed -options are described in association to each mouse type. When no -description of option strings is provided, that means the option -string is unused for that mouse type and specifying one generates an -error. When the document refer to ``standard serial options'' it means -that one of @t{-o dtr}, @t{-o rts}, @t{-o both} can be specified to -toggle the control lines of the serial port. - -The following mouse type are corrently recognized: - -@table @code -@item bare Microsoft - The Microsoft protocol, without any extension. It only reports - two buttons. If your device has three, you should either try - running the @t{mman} decoder or @t{msc}. In the latter case, - you need to tell the mouse to talk @t{msc} protocol by - toggling the DTR and RTS lines (with one of @t{-o drt}, @t{-o - rts} or @t{-o both}) or invoking @code{gpm -t msc} while - keeping the middle button pressed. Very annoying, indeed. - This mouse decoder accepts standard serial options, although they - should not be needed. - -@item ms - This is the original Microsoft protocol, with a middle-button - extension. Some old two-button devices send some spurious - packets which can be misunderstood as middle-button events. If - this is your case, use the @samp{bare} mouse type. Some new - two-button devices are ``plug and play'', and they don't play - fair at all; in this case try @t{-t pnp}. Many (most) - three-button devices that use the microsoft protocol fail to - report some middle-button events during mouse motion. Since - the protocol does not distinguish between the middle button - going up and the middle button going down it would be liable - to get out of step, so this decoder declares the middle button - to be up whenever the mouse moves. This prevents dragging with - the middle button, so you should probably use @samp{-t ms+lr} - instead of this decoder, especially if you want to use X. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms+ - This is the same as @samp{-t ms} except that the middle button - is not reset during mouse motion. So you can drag with the - middle button. However, if your mouse exhibits the usual buggy - behaviour the decoder is likely to get out of step with - reality, thinking the middle button is up when it's down and - vice versa. You should probably use @samp{-t ms+lr} instead - of this decoder. This mouse decoder accepts standard serial - options, although they should not be needed. - -@item ms+lr - This is the same as @samp{-t ms+} except that there is an - additional facility to reset the state of the middle button by - pressing the other two buttons together. Do this when the - decoder gets into a confused state where it thinks the middle - button is up when it's down and vice versa. (If you get sick - of having to do this, please don't blame gpm; blame your buggy - mouse! Note that most three-button mice that do the microsoft - protocol can be made to do the MouseSystems protocol - instead. The ``3 Button Serial Mouse mini-HOWTO'' has - information about this.) This mouse decoder accepts standard - serial options, although they should not be needed. - -@item msc MouseSystems - This is the standard protocol for three-button serial devices. - Some of such devices only enter MouseSystem mode if the RTS, DTR - or both lines are pushed low. Thus, you may try @t{-t msc} - associated with @t{-o rts}, @t{-o dtr} or @t{-o both}. - -@item mman Mouseman - The protocol used by the new Logitech devices with three - buttons. It is backward compatible with the Microsoft - protocol, so if your mouse has three buttons and works with - @t{-t ms} or similar decoders you may try @t{-t mman} instead - to use the middle button. This mouse decoder accepts standard - serial options, although they should not be needed. - -@item sun - The protocol used on Sparc computers and a few others. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item mm MMSeries - Title says it all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logi Logitech - This is the protocol used by old serial Logitech mice. - -@item bm BusMouse - Some bus devices use this protocol, including those produced - by Logitech. - -@item ps2 PS/2 - The protocol used by most busmice. - -@item ncr - This `type' is able to decode the pointing pen found - on some laptops (the NCR 3125 pen) - -@item wacom - The protocol used by the Wacom tablet. Since version 1.18.1 - we have a new Wacom decoder, as the old one was not working - with new tablets. This decoder was tested with Ultrapad, - PenPartner, and Graphire tablets. - Options: - @t{-o relative} (default) for relative mode, - @t{-o absolute} for absolute mode. - -@item genitizer - The \"Genitizer\" tablet, in relative mode. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item logim - Used to turn Logitech mice into Mouse-Systems-Compatible. - Obviously, it only works with some of the Logitech mice. - -@item pnp - This decoder works with the new mice produces by our friend Bill, - and maybe with the old ones as well. The Pnp protocol is - hardwired at 1200 baud and is upset by normal initialization, so - this is a @t{-t bare} decoder with no initialization at all. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item ms3 - A decoder for the new serial IntelliMouse devices, the ones - with three buttons and a protocol incompatible with older - ones. The wheel is currently unused. - -@item imps2 - ``IntelliMouse'' on the ps/2 port. This type can also be used for - a generic 2-button ps/2 mouse too, since it will auto-detect the type. - -@item netmouse - Decodes the ``Genius NetMouse'' type of devices on the ps/2 - port. For serial ``Netmouse'' devices, use the ``ms3'' decoder. - - -@item cal - A decoder of the ``Calcomp UltraSlate device. - -@item calr - Same as above, but in relative mode. - -@item twid - Support for the twiddler keyboard. As of gpm-1.14 this decoder - includes a char generator for the text console, but doesn't - yet support X keycodes. If used with @samp{-R}, @code{gpm} will anyway - repeat mouse events to the X server. More information about twiddler - support can be found in @file{README.twiddler}, in the gpm - distribution. - -@item syn synaptics - A decoder for the Synaptics TouchPad connected to the serial port. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item synps2 synaptics_ps2 - Same as above, but for the devices attached to the ps2 port. - -@item brw - A decoder for the Fellowes Browser, a device with 4 buttons - and a wheel. - This mouse decoder accepts standard serial options, although - they should not be needed. - -@item js Joystick - This mouse type uses the joystick device to generate mouse - events. It is only available if the header @file{linux/joystick.h} - is found at compile time. The header (and the device as well) - has been introduced only during 2.1 development, and is not - present in version 2.0 of the kernel. - -@item summa - This is a decode for the Symmagraphics of Genius tablet, run in - absolute mode. A repeater is associated to this decoder, so it - can @t{-R summa} can be used to generate X events even for other - absolute-pointing devices, like touchscreens. To use the repeated - data from X, you need a modified @t{xf86Summa.o} module. - -@item mtouch - A decoder for the MicroTouch touch screen. Please refer to the - file @file{README.microtouch} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. - -@item gunze - A decoder for the gunze touch screen. Please refer to the - file @file{README.gunze} in the source tree of gpm for - further information. In the near future, anyways, I plan to fold - back to this documentation the content of that file. The decoder - accepts the following options: @t{smooth=}, @t{debounce=}. An - higher smoothness results in slower motion as well; a smaller - smoothness gives faster motion but, obviously, less smooth. - The default smoothness is 9. The debounce time is express in - milliseconds and is the minimum duration of an up-down event - to be taken as a tap. Smaller bounces are ignored. - -@item acecad - The Acecad tablet in absolute mode. - -@item wp wizardpad - Genius WizardPad tablet - -@end table - -@ignore - -.SH FILES -.nf -src/mice.c The source file for pointer decoders -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The General Purpose Mouse server - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore - -%MANPAGE END - - -%########################################################################## -@node Gpm Internals, The ClientLib, Server Invocation, Top -@chapter Gpm Internals -@cindex Internals - -The server is organized as a main loop built around a @code{select()} -system call. It responds both to mouse events and to input from the -clients, which are connected to the server through a unix domain -socket. The connection is used to tell the server what a client is -interested in, and to get mouse events. - -When no clients are connected to the active console, the server runs -the selection mechanism (cut and paste of text). The selection -mechanism is a simple and well-designed application, whose behaviour -can be cloned by clients, by telling the server to inherit the default -response for certain mouse events (motion being the most -interesting). - -@menu -* Events:: -* Margins:: -* Event Types:: -* Connection Details:: -* Default Handlers:: -@end menu - -%========================================================================== -@node Events, Margins, Gpm Internals, Gpm Internals -@section Events -@cindex Events - -Whenever the mouse generates an event, the event is dispatched to the -active client for the current console, or to the default handler, if -present. Otherwise selection is run. A default handler is a client -process which gets mouse events form all the virtual -consoles. -@xref{Default Handlers}. - -When a client is involved, it is handled a @code{Gpm_Event} -structure, built by the server. The fields for @code{Gpm_Event} are the -following: -@tindex Gpm_Event - -@table @code - -@item unsigned char buttons; - An or-mask of the values @code{GPM_B_LEFT}, - @code{GPM_B_MIDDLE} and @code{GPM_B_RIGHT}. It corresponds to - the state of the mouse buttons when the event is reported. The - current implementation of gpm allows at most three buttons. - -@item unsigned char modifiers; - The value of the kernel variable - @code{shift_state}, as of @file{keyboard.c}, when the event is - reported. It is a bitmask value, and corresponds to the least - significant byte of the value used by the @code{loadkeys} - program. Use of symbolic - names in source code is available after inclusion of - @file{linux/keyboard.h}, as exemplified in @file{mev.c}. - -@item unsigned short vc; - The number of the active virtual console when - the event is reported. The client is not expected to use this value, - which corresponds to the controlling terminal of the client process, - unless it gets events form multiple consoles. - @xref{Default Handlers}. - -@item short x, y; - The position of the mouse pointer where the event - is reported. It is 1-based by default, to be compatible with - @code{selection} and @code{libcurses}. This behavior can be - overriden, though, by setting the library variable - @code{gpm_zerobased}. - @xref{Variables}. - -@item short dx, dy; - The change in position since the last reported - event. - -@item enum Gpm_Etype type; - A bit-mask, representing the - type of reported event, as described later. - @xref{Event Types}. - -@item int clicks; - A counter, which is valid at button-down, drag or - button-up. It can be 0, 1 or 2 to mean single, double or triple - click. - -@item enum Gpm_Margin margin; - A bit-mask, telling if the pointer has - gone out of the visible screen. The indivudual bits are - named @code{GPM_TOP}, @code{GPM_BOT}, @code{GPM_LFT}, - @code{GPM_RGT}. Only one - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -@end table - -%========================================================================== -@node Margins, Event Types, Events, Gpm Internals -@section How margins are managed - -Motion and button-press events are constrained to remain within the -visible screen. This means that the @code{x} will be within 1 and 80 and -@code{y} will be within 1 and 25 when the console is 80x25 -cells. However, a client can keep track of movements outside the -screen, by using the @code{dx} and @code{dy} fields, which aren't subject to -clipping. - -The server helps applications in detecting margin conditions by filling the -@code{margin} field. Whenever the pointer tries to cross screen boundaries, -it is forced to remain on the border, but a flag is set in @code{margin}. - -A different policy is in force for drag and button-release events. In this -case the pointer is allowed to go outside the physical screen by exactly -one position. This allows, for example, selecting to end of line -by dragging down-left. The peculiar situation is nonetheless signaled -through the @code{margin} flags. The client should be careful to -fit the values within the screen if needed. -@xref{Utility Functions}. - - -%========================================================================== -@node Event Types, Connection Details, Margins, Gpm Internals -@section Event Types - -The @code{type} field in @code{Gpm_Event} is made up of bit-wide -flags. The existing bit masks belong to two groups: bare events and -cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to -extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -For any event, exactly one bit will be set in the resulting bitmask. - -Bare events are the following: - -@table @code -@item GPM_MOVE - A motion event, with all buttons up. -@item GPM_DRAG - A motion event, but one or more buttons are kept pressed. -@item GPM_DOWN - A button press event. The @code{buttons} field will report - which buttons are pressed after the event. -@item GPM_UP - A button release event. The @code{buttons} field will report - which buttons are being released. Note that this is different from - the previous case. -@item GPM_ENTER - This means "enter in the current Region of Interest", and such - event can only happen if the high-level library is used. - When the type is @code{GPM_ENTER}, all the other fields are undefined. - @xref{High Level Lib}. -@item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -@end table - -Cooked events are the following: - -@table @code -@item GPM_SINGLE - This bit may be set at button-press, - drag and button release events, and can be used to identify a - single press. The time interval used to choose a double click - from two single clicks is set by a parameter in the daemon - (configurable at daemon invocation). -@item GPM_DOUBLE - Used to identify a double click (press, drag, release) -@item GPM_TRIPLE - Used to identify a triple click (press, drag, release) -@item GPM_MFLAG - The ``motion flag'' is true if some dragging happened - between button-press and button-release. It can be used by - those applications which respond to events at button release. - It is available at drag and release. -@end table - -%========================================================================== -@node Connection Details, Default Handlers, Event Types, Gpm Internals -@section Connection Details - -Each virtual console has a stack of clients attached to it. They talk to -gpm by writing to a control socket and get mouse events by reading -it. All the clients in the stack can receive events. Gpm-1.10 and earlier -only sent events to the top client, but sometimes users play with -multiple programs using suspend-resume (thanks Ian). - -In addition to the per-console stacks, another stack is there to store -default-handling clients. -@xref{Default Handlers}. - -Each client registers with the server and tells which events it is -interested in. Events not managed by the client can be handled by the -selection mechanism, which is compiled in the server itself. This -approach simplifies writing clients which respond only to button -press/release events, because highlighting the mouse pointer can be -performed by the server. A default handler in turn can respond only to -mouse events associated with modifier keys, so that selection is used -for any mouse-only event. - -Clients are required to fill a @code{Gpm_Connect} structure and pass -it to the server. The structure is made up by four @code{unsigned int} -fields. -@xref{Open and Close}. -@tindex Gpm_Connect - -@table @code -@item eventMask - A bitmask of the events the client wants - to receive. Both bare and cooked events are - allowed to appear in the mask. - -@item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, - independent of the modifier keys. - -@item minMod - The minimum amount of modifiers - required by the client. This field is used for default-handlers - which manage control-mouse events without interfering - with mouse-only ones. - @xref{Default Handlers}. - -@item maxMod - The maximum amount of modifiers the client is willing to receive. - Events featuring a modifier key not included in @code{maxMod} won't - be passed to the client. -@end table -@noindent -Two more fields are there to tell about the connection itself, and you're -not asked to fill them, because @code{Gpm_Open} will do it for you. - -@table @code -@item int pid - The process id of the connecting application. -@item int vc - Which virtual console to gain control of. -@end table - -Keyboard modifiers are used to multiplex clients on the same virtual -console. You (as a programmer) don't need to care about the internal -workings. They are detailed in @ref{Default Handlers}, but you only -need to choose the right values for your application. - -Examples: -@table @code -@item minMod=0; maxMod=0; - specifies a client which senses mouse-only events, but neither - shift-mouse nor alt-mouse nor control-mouse. - -@item minMod=0; maxMod=~0; - is a client which gets any mouse event. - -@item minMod=1< -.br -Ian Zimmerman - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP The mouse server -\fB gpm-root(1) \fP An handler for Control-Mouse events. - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node sample/rmev, Emacs Support, mev, Demo Clients -@section @code{sample/rmev} - -@code{rmev} is a reduced version of @code{mev}, but it is designed to be as -portable as possible. It uses a subset of the capabilities of @file{libgpm.a}, -but works smoothly on both xterm and the Linux console. It is distributed -with @code{gpm} to show how a curses based application can support the mouse -with a small effort. Most of the xterm decoding is by Janne Kukonlehto. -@xref{Xterm}. - -%========================================================================== -@node Emacs Support, gpm-root, sample/rmev, Demo Clients -@section Emacs Support - -Emacs support is quite complete as of 0.14. The enclosed file -@file{t-mouse.el}, also available in byte-compiled form, is used to pass -mouse events to emacs. @file{t-mouse.elc} is installed in the correct -@t{site-lisp} directory for you emacs installation (as detected by the -configure phase). - -Events with modifiers other than Meta, Control, and Shift are not -managed by the library. Managed events are passed to the lisp program, -which converts them to be similar to X mouse events inside -emacs. Actions are then invoked through a local keymap. - -In my own environment I can use mouse-only and meta mouse within emacs, -shift-mouse to run selection and control-mouse to run @code{gpm-root}. -@xref{gpm-root}. - -I suggest to put the following form in your own @file{.emacs} file, to -avoid loading @code{t-mouse} when you aren't working on the Linux console: - -@lisp -(if (and (string-match ".*-linux" system-configuration) - (or (string-match "linux" (getenv "TERM")) - (string-match "con.*" (getenv "TERM")))) - (load-library "t-mouse")) -@end lisp - -Mouse events are appended to the list variable -@code{unread-command-events} where the Emacs main event loop will find -them. They can be made to trigger any command (or interactive function, -in Emacs Lisp terminology) at all. Actually Emacs already comes with -reasonable bindings for most mouse events, so usually you won't have to -do anything beyond installing @code{t-mouse}. If you want to modify -what Emacs does in response to mouse events, please see -@ref{Keymaps,,,elisp}. - -The scrollbar sits on the last column of the screen, though it is not -visible. When you click on the last column, a scroll-bar action is taken. -If this annoys you, again it can be turned off by changing the -appropriate Emacs keymap. - -If you kill the @code{gpm} server, Emacs won't respond to mouse events -any more. If the server is then restarted, you can invoke `@kbd{M-x -t-mouse-run}' to restart mouse responsiveness in the editor. - -%========================================================================== -@node gpm-root, hltest, Emacs Support, Demo Clients -@section The ``gpm-root'' program - -%MANPAGE gpm-root.1 -%M .TH GPM-ROOT 1 "February 1995" -%M .UC 4 -%M .SH NAME -%M gpm-root \- a default handler for gpm, used to draw menus on -%M the root window -%M -%M .SH SYNOPSIS -%M .B gpm-root -%M [ -%M .I options -%M ] -%M .br -%M .SH DESCRIPTION - -The program @code{gpm-root} is designed to handle Control-Mouse events to -draw menus on the background of the current tty. The actual menus -are described by a configuration file in the user's home directory. - -Please note that @code{gpm-root} needs to run with Linux 1.1.73 or -newer, because previous kernels lack some screen handling capabilities -required by the program. - -The program uses the files @file{/dev/vcs*} to draw to the console screen. -These are available only from kernel 1.1.81 onward. If you miss those -device nodes, you should create them using @code{create_vcs} in the -distribution directory. The tool won't run with kernels older than 1.1.81, -because they lacked a full screen dump/restore capability. - -Available command line options are the following: - -@table @code -@item -m @var{number} - Choose the modifier to use (by default: @samp{control}). The modifier - can be provided either as a number or as a symbolic string. - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - -@item -u - Deny using user-specific configuration files. With this - option on, only @file{/etc/gpm-root.conf} will be used as a source - of configuration information. This option - is intended for those system administrators who fear security could - be broken by this daemon. Things should be sufficiently secure, but - if you find a hole please tell me about it. - -@item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog - mechanism. This is useful for debugging; in previous releases - it was done with a compile-time option. - -@item -V @var{verbosity increment} - Raise the maximum level of messages that will be logged. Thus a - positive argument has the effect of making the program more - verbose. One can also give a negative argument to hush the - program; however, note that due to @b{getopt(3)} rules a negative - argument must follow the option with no space betwixt (that is, - @samp{-V-1} but not @samp{-V -1}). @xref{Program Arguments,,,libc}. - The argument is optional and its default value is 1. - -@end table - -Each time a menu is drawn, the configuration file is reparsed if it has -changed. This allows modification of personal setup without reinvoking -the daemon. - -%M The actual configuration file is better introduced by looking at your -%M @file{/etc/gpm-root.conf}. -%M -%MSKIP - -The actual configuration file is better introduced by an example: - -@lisp -# sample configuration file for gpm-root -# edit it to suit your taste - -button 2 @{ - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "load: " f.load - "free:" f.free - "---------" f.nop - "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -@} - -button 3 @{ - name "jump" - - foreground black - background red - border bright yellow - head bright yellow - - "tty1" f.jptty "1" - "tty2" f.jptty "2" - "tty3" f.jptty "3" - "tty4" f.jptty "4" - "tty5" f.jptty "5" - "tty6" f.jptty "6" - "" f.nop - "more of them..." @{ - "tty 17" f.jptty "17" - @} - @} -@end lisp -%M .fi - -The syntax for the file won't be described here, being it quite apparent -from the example above. Blanks and newlines are unused in parsing the -file, and the layout of the file is free. Comments are allowed in the -file: any hash mark (@samp{#}) found at the beginning of the line or -after white space makes the parser discard anything up to the next -line. To insert quotes (@samp{"}) in strings precede them with a backslash. - -Note that recursive menus are allowed, to any level of recursion. - -Keywords belong to three groups: the button keyword, the cfg -keywords and the action keywords. They are all described in the table -below: - -@table @code -@item button @var{number} @var{menu} - The @code{button} keyword is used to introduce a menu. It is - followed by the number of the relevant button (1=left, - 2=middle, 3=right), an open brace, a menu and a closed brace. - A menu is made up of cfg statements, followed by - action statements. Cfg statements can come in any order, - while the order of action statements tells the actual order - in which actions will appear on the screen, top to bottom. -@end table - -The following statements belong to the cfg set. - -@table @code -@item name @var{string} - If the @code{name} keyword is present, the specified - @var{string} will be used as the name for the current menu. - -@item background @var{color} - This statements is used to specify the - background color to be used in the current menu. The @var{color} - can be specified with one of the eight canonical strings @samp{black}, - @samp{red}, @samp{cyan} etc. The background defaults to black. - -@item foreground @var{color} - This statements is used to specify the - foreground color for menu items. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item border @var{color} - @code{border} is used to specify the - border color for the menu. Its value defaults to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. - -@item head @var{color} - @code{head} is used to specify the - foreground color for the title of the menu. Its value defaults - to @samp{white}. - An optional @samp{bright} keyword can appear before the actual color. -@end table - -The following statements belong to the action set. - -@table @code -@item @var{string} f.fgcmd @var{cmdstring} - When the mouse button is - released above the corresponding menu item, the @var{cmdstring} is - pasted in the keyboard queue of the current console. This is - not yet implemented. - -@item @var{string} f.bgcmd @var{cmdstring} - When the mouse button is released above the - corresponding menu item, a shell (@file{/bin/sh}) is forked to - execute the specified command, with @code{stdin} - connected to @file{/dev/null}, and @code{stdout}, @code{stderr} connected - to the active console. - -@item @var{string} f.jptty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, the console is - switched to the one specified. The @var{ttynumber} must be specified - as a string. Any tty can be reached this way, even those which are - not accessible via the keyboard. - -@item @var{string} f.mktty @var{ttynumber} - When the mouse button is - released above the corresponding menu item, an unused console is - selected, and @file{/sbin/mingetty} is executed in it. The current console - is switched to the newly opened console. I use this command to save - kernel memory by opening a single console through @file{/etc/inittab} - and requesting the others only when i need to login. - -@item @var{string} @var{Whole-menu} - A menu can directly follow the label string. - When the mouse pointer leaves the menu frame at the level of @var{string}, - a second menu is posted on screen. - -@item @var{string} f.lock - When the mouse button is - released above the corresponding menu item, the keyboard and the - screen are locked, and only the locking user or the superuser - can unlock them. This is not yet implemented. - -@item @var{string} f.load - The current loadavg when the menu is posted is concatenated to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.free - The free memory and swap when the menu is posted is concatenated - to @var{string} - to build the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.time - The current time is formatted with @b{strftime(3)}, according to - @var{string}. The resulting string is - the actual message displayed on screen. Nothing happens at - button release. - -@item @var{string} f.pipe @var{cmdline} - When the mouse pointer leaves the menu frame at the level of @var{string}, - a message box is posted on screen showing the last ten lines - of the output of @var{cmdline}. @var{cmdline} is executed - by @file{/bin/sh}. This is not yet implemented. - - -@item @var{string} f.nop - This does nothing, it only displays @var{string} on the menu. -@end table - -The @code{HOME}, @code{LOGNAME} and @code{USER} environment variables are setup -to the values for the invoking user before spawning an external -process (@code{f.bgcmd}, @code{f.pipe}). The current directory is always @file{/}. - -%M .SH BUGS - -Known bugs have been fixed. In particular, if you invoke @code{gpm-root} -right after @code{gpm}, it will delay a few seconds before trying to connect -to the daemon. - -@ignore -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/gpmctl The socket used to connect to gpm. -/etc/gpm-root.conf The default configuration file. -$(HOME)/.gpm-root The user configuration file. -/dev/vcs* Virtual Console Screens -.fi - -.SH SEE ALSO -.nf -\fB gpm(8) \fP - -.fi -The info file about `gpm', which gives more complete information and -explains how to write a gpm client. - -@end ignore -%MANPAGE END - -%========================================================================== -@node hltest, mouse-test, gpm-root, Demo Clients -@section @code{hltest} - -High-level test is a simple sample application using the high-level -library. It implements something like a window manager for text windows, -though it is small and unuseful. - -The application is meant to be read by programmers trying to use the -high-level library. It is equipped with event reporting to help -in understanding the internal workings. - -%========================================================================== -@node mouse-test, , hltest, Demo Clients -@section @code{mouse-test} - -%MANPAGE mouse-test.1 -%M .TH mouse-test 1 "March 26, 1998" "" -%M .SH NAME -%M mouse-test \- a tool for determining mouse type and device it's attached to. -%M .SH SYNTAX -%M \fBmouse-test\fR [ \fIdevice\fR ... ] -%M .SH DESCRIPTION - -This experimental and incomplete application tries to help in detecting -which protocol does your mouse speak. It is able to detect MouseMan -devices, and to choose between @samp{-t ms} (three-buttons aware) and -@samp{-t bare} old two-buttons-only serial mice. - -%M .SH BUGS - -I know the application is buggy, but I only own one mouse device. -If you are interested in this application, just call me and awake me -from my laziness. - - -@ignore -.SS OPTIONS -.IP \fIdevice\fP -[ \fIdevice\fP ... ] -.PP -Check this \fIdevice\fP for a mouse. If no devices are listed, mouse-test will try all possible devices. - -.SH AUTHOR -Alessandro Rubini - -.SH FILES -.nf -/dev/* The devices used to search for a mouse -.fi - -.SH SEE ALSO -.nf -gpm(8) - -.fi - -@end ignore -%MANPAGE END - -%########################################################################## -@node Type Index, Function Index, Demo Clients, Top -@unnumbered Type Index - -@printindex tp - -@node Function Index, Variable Index, Type Index, Top -@unnumbered API Index - -@printindex fn - -@node Variable Index, , Function Index, Top -@unnumbered Variable Index - -@printindex vr - -%@iftex -%@unnumbered Table of Contents -%@contents -%@end iftex - - -@bye - -/* - * This is because Linus uses 4-wide tabstops, - * forcing me to use the same default to manage kernel sources - */ - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.etouch b/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.etouch deleted file mode 100644 index 82658795..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.etouch +++ /dev/null @@ -1,52 +0,0 @@ - -This file tells how to use gpm and X with a Elotouch screen with -serial interface at 9600 Baud No parity. - - CALIBRATION - ----------- - -Calibration is done in console mode using the program "elocalib" -available from http://www.dobit.com/emblin/pub/elocalib.tgz -See also elocalib --help -To start calibration at console 128x48, for screen 1024x786 -> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 - -Touch the upper-left corner and write down the coordinates Xmin, Ymin -Touch the bottom-right corner and write down the coordinates Xmax, Ymax -Update the file gpm-calibration with this coordinates - -> cat /usr/local/etc/gpm-calibration -# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -4010 80 80 4010 - - - GPM OPERATION - ------------- - -> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "gpmsumma" module -available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o - or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz - -/usr/lib/X11/modules/input/gpmsumma_drv.o - - -Then add the following sections to your XF86config: - -Section "InputDevice" - Identifier "EloTouch" - Driver "gpmsumma" - Option "Device" "/dev/gpmdata" - Option "SendCoreEvents" "On" -EndSection - -Section "ServerLayout" - InputDevice "EloTouch" "SendCoreEvents" - ... -EndSection diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.evabs b/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.evabs deleted file mode 100644 index 92965abb..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.evabs +++ /dev/null @@ -1,39 +0,0 @@ - -This file tells how to use gpm with the driver for event-devices -that use absolut coordiantes (evabs) like touchscreens. It was -desigened and tested for eGalax controllers, but should work with -others as well. - - - CALIBRATION - ----------- - -Calibration is done with a configfile. It consists of a single -line of 8 integers: - -ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max - -The first four values (prefixed withe here) show the minimum and -maximum values of coordinates the event-device delivers for -x- and y-axis, respectivly. The last four values show range of -coordinates to which the input should be scaled, for example your -screen resolution. This works for text-mode, too. - -An example for an 800x600 screen would look like this: - -50 1950 50 1950 0 799 0 599 - - - GPM OPERATION - ------------- - -You need to use the evabs devicetype to use this feature, a -device that delivers the absolute coordinates a config-file -that describes how to scale these coordinates, and a repeater- -device used for output. -The pseudo-file /proc/bus/input/devices should tell you which -event-device to use. - -Usage example: - -gpm -t evabs -m /dev/input/event2 -c /etc/gpm-calib.conf -R ps2 diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.gunze b/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.gunze deleted file mode 100644 index 415ca726..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.gunze +++ /dev/null @@ -1,196 +0,0 @@ -This file tells how to use gpm and X with a Gunze touchscreen. - -It is pretty similar to README.microtouch, and I plan to unify them as -soon as I port the two implementation to offer a consistent look and -feel. Currently the Gunze implementation is more configurable but has -a worse calibration management (it must write to -/etc/gpm-calibration). - - DEVICE CONFIGURATION - -------------------- - -The gpm decoder requires the Gunze device to be in Gunze Mode (not in -Elo Emulation Mode). The supported serial speeds are 9600 and 19200 -baud, the latter being the default speed (in other words, to decode -data at 9600 you must use the "-b 9600" option of gpm; no "-b" option -selects 19200 baud). Currently, the only device supported is the -10-bit one. - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. This will soon change: I -plan to implement corner-taps for button-2 and button-3, as well as a -different "mode" where motion is not supported and any touch event is -converted to a button-1 click. - -In the default (and only) mode, when a user touches the screen, the -decoder generates mouse motion events. Tapping on the screen generates -button-press (as well as drag and release) events. - -A "tap" is a finger-down (or pen-down) event generated quickly after a -finger-up. A touch event is considered a "tap" if the lapse since the -last finger-up is less than or equal to the double-click interval (the -default is 250ms, and the value is chosen by specifying the "-i" -option of gpm). This means that you'll usually move the pointer to the -desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip). - -My own experience with the Gunze device, revealed that sometimes the -finger bounces, generating very fast finger-up/finger-down pairs. The -gpm decoder, therefore, ignores any quick succession of finger-up and -finger-down events. The default is to ignore any release-press pair if -the time lapse is less than 100ms (note, however, that this time lapse -is configurable). - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t gunze - -If /dev/mouse is not updated to point to the touchscreen serial port, -use - gpm -t gunze -m /dev/ttyS0 -or an equivalent command. - -Unfortunately, there is currently no way to paste text, but I'll -implement corner-tapping to achieve that. - - - Gunze-specific Configuration - ---------------------------- - -It is possible to specify device-specific options to gpm in order to -customize the behaviour of the Gunze decoder. The options are passed -as argument to the "-o" command line (reminiscent of the mount -command). - -The following options are recognized: - - smooth= - The decoder smooths mouse movements, to prevent the jumpy - behaviour that usually results from finger movement. The - default smoothin factor is 9, you can specify a different - value if you wish: "gpm -t gunze -o smooth=3" gives faster - (and more jumpy) motion, while "gpm -t gunze -o smooth=30" - gives a very slow feeling.x - - debounce= - The option is used to specify the minimum time lapse, in - milliseconds between finger-up and finger-down events. Smaller - time intervals are discarded to achieve debouncing. Note that - the maximum time lapse is the one used for double-click - detection, and is specified with the "-i" command-line option, - common to every other mouse type. - - -Please note that more than one option can be specified, by using the -comma ``,'' as a separator. For example: - - gpm -t gunze -o smooth=5,debounce=150 - - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - -After calibration, the calibration values can be found in the file -/etc/gpm-calibration, but gpm must be restarted in order to be able to -read them. This can be construed as a bug, and avoiding to stop the -program is in my TODO list. - - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html, as well as -in the gpm CVS tree and from gpm-1.18.2 in the gpm release as well). - -The compiled module (xf86Summa.so) should go in the module directory -of your X server, usually /usr/X11/lib/modules, when it sits in the -right place, a proper XF86Config will arrange for its loading. - -Gpm must run in repeater mode, with a command line like: - gpm -t gunze -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - -If, when calling ``startx'', it won't work with a message of ``Invalid -Subsection Name'', please check the previous error lines, as they -explain what is wrong. They usually look like: - - (--) no ModulePath specified using default: /usr/X11R6/lib/modules - xf86Summa.so: Unknown error loading module - -It is pretty clear, if your are careful in reading the messages (I am -not that careful, and lose half an hour in trying to figure out what -was wrong). - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "gunze-setup" found in -the source tree of gpm (yes, it is the same program used for the text -mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port initialization). - -The calibration program uses either /dev/touchscreen (if available) or -/dev/mouse (otherwise) as the serial port to communicate with the -touchscreen. You'll need therefore to create a symlink for one of -those names before running "gunze-setup". - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.microtouch b/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.microtouch deleted file mode 100644 index 6836991f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.microtouch +++ /dev/null @@ -1,103 +0,0 @@ - -This file tells how to use gpm and X with a touch screen (this is -being written as an addition to gpm 1.17.5 and currently the only -supported touchscreen is the MicroTouch). - - - USER INTERFACE - -------------- - -The decoder currently implemented in gpm is quite simple: it only -supports mouse motion and button-1 events. - -When a user touches the screen, the decoder generates mouse motion -events. Tapping on the screen generates button-press (as well as drag and -release) events. - -A "tap" is a finger-down event generated quickly after a finger-up -(half a secon at most). This means that you'll usually move the -pointer to the desired position and then tap on it. - -Double-and triple clicks are easily generated by repeated tapping. - -Since tapping is usually accompanied by a small movement, the decoder -will use the coordinates of the finger-up event for the button-press. -Further dragging will be relative to the tapping position (i.e., the -finger-up position). Moreover, the last coordinate pair received on -finger-up is discarded, because it usually is slightly offset (due to -the non-negligible area of the fingertip) - - - GPM OPERATION - ------------- - -In order to run the touchscreen with gpm, you need to update the -/dev/mouse symbolic link to point to the right serial port; then -invoke gpm with a command line like - - gpm -t mtouch - -Unfortunately, there is currently no way to paste text. I think some -modifier key should be eligible to this role but this would mean an -in-depth modification to gpm. We have to discuss about it to make the -right choice. - - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm. The gpm daemon must already be running in -order for the program to work flawlessly, as the program stops and -restarts gpm internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. - - - X OPERATION - ----------- - -In order to use the touchscreen in X, you should install in your -system the "Summa" module, as modified by Frank Holtz (the driver is -available from http://www.hof-berlin.de/tablet/tablet.html). - -Gpm must run in repeater mode, with a command line like: - gpm -t mtouch -Rsumma -, which instructs gpm to repeat packets according to the Summa protocol. - -Then, you need to add the following sections to your XF86config: - - Section "module" - Load "xf86Summa.so" - EndSection - - Section "Xinput" - Subsection "SummaSketch" - Port "/dev/gpmdata" - DeviceName "touchscreen" - Mode Absolute - AlwaysCore - EndSubSection - EndSection - - -Moreover, you should disable the "Pointer" section. I used a trick -like this one: - - Section "Pointer" - Protocol "MouseSystems" - Device "/dev/fifo" - EndSection - -Where /dev/fifo is just a plain unused fifo ("mknod /dev/fifo p") - - Calibration - ----------- - -To calibrate the touchscreen, use the program "microtouch-setup" found -in the source tree of gpm (yes, it is the same program used for the -text mode). The gpm daemon must already be running in order for the -program to work flawlessly, as the program stops and restarts gpm -internally (it depends on gpm for correct serial port -initialization). "microtouch-setup" uses /dev/mouse to access the -serial port, so /dev/mouse should point to a "ttyS" device. diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.synaptics b/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.synaptics deleted file mode 100644 index a604874d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.synaptics +++ /dev/null @@ -1,345 +0,0 @@ -This README describes the support for the Synaptics ToucPads. - -In addition to translating finger motion into mouse motion and supporting -the buttons, this support currently has several features: - - a "tap" on the TouchPad causes a left mouse click - - a "tap" followed quickly by a finger motion causes a - left button drag type action. - - a "tap" in one of the corners causes an action - the default configuration is upper right causes middle mouse click - and lower right causes right mouse click - - more pressure on the touch pad speeds the motion of the cursor - - a "tap" with a motion component (default > 2mm) initiates a - toss and catch sequence. This is terminated by a finger touch - on the pad (the toss also ends after 1 sec since that is the - idle timeout period for the touchpad). - - if the finger moves close to an edge then the mouse motion will - be continued in that direction so that you don't need to pick up - your finger and start moving again. This continued motion is - pressure sensitive (more pressure is faster motion). - - Scrolling by putting the finger at the edge, an dmoving up or down. - - Recognition of Stick. - - Multi fingers are recognized to to stop erradic motions, and to change - which mouse button is reported. - - Palm detection so the palm does not move the mouse. - -These features can be enabled/disabled and many of them have time and speed -parameters which can be adjusted to the taste of the user. These parameters -can be provided in the "/usr/etc/gpm-syn.conf" file (or -/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran -configure). Each line in this file has the following syntax: [param-name] - - -Where param-name is one of the following - - param-name value description - ====================== ===== =========== - /* feature enable configuration values all default to 1 (TRUE) */ - /* flags are true if the first char of the value is in the string "YyTt1" */ - /* flags are false if the first char of the value is in the string "NnFf0" */ - edge_motion_enabled flag is edge motion enabled - edge_motion_speed_enabled flag does pressure control - speed of edge motion - corner_taps_enabled flag are corner taps enabled - tap_gesture_enabled flag are taps gesture enabled - pressure_speed_enabled flag does pressure control - speed in non edges - tossing_enabled flag is toss/catch enabled - does_toss_use_static_speed flag is toss/catch speed - based on toss dist - - /* pressure induced speed related configuration constants */ - low_pressure 0-255 the lowest pressure which triggers - speed processing. If this is less - than speed_up_pressure then the - motion is slowed down. When the - pad pressure is between these - values. - - The default value is 60 - - pressure is described by - Synaptics as follows: - 0 : no finger contact - 10 : hovering NEAR pad surface - 30 : very light finger contact - 80 : normal finger contact - 110: very heavy finger contact - 200: finger lying flat on surface - 255: whole palm on pad surface - - speed_up_pressure 0-255 the lowest pressure at which speed - is increased. If the pad pressure - is less than this value then the - motion will bs slowed down. If - greater, then the motion will be - sped up. - - The default value is 60 - - pressure_factor float the multiplicative factor applied - to the pressure difference to - be applied to the speed. This - is used as follows: - 1 + pf * (press - speed_up) - The difference in pressure between - the measured pressure and the speed - up pressure is multiplied by this - value which is then applied to the - nominal mouse speed. - - The default value is 0.05 - - standard_speed_factor float the standard speed factor used to - scale touchpad deltas into mouse - deltas. The touchpads have - resolutions in the 1000 points/inch - range (much more detail than a - mouse). - - The default value is 0.08 - - /* toss/catch related constants */ - min_toss_time msec This number specifies the minimum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 100 (0.1 sec) - - max_toss_time msec This number specifies the maximum - finger contact time which is to - be considered a toss - (in milliseconds). - - The default value is 300 (0.3 sec) - - prevent_toss_time msec This number specifies the minimum - finger release time after a toss - is terminated before reacting to - taps (in milliseconds). This - prevents the "catch" tap from - causing a mouse button tap. - - The default value is 300 (0.3 sec) - - min_toss_dist mm This number specifies the minimum - finger move distance which is to - be considered a toss - (in millieters). - - The default value is 2 - - static_toss_speed int If does_toss_use_static_speed is - 1 (TRUE) then this specifies the - speed to be used. - - The default value is 70 - - toss_speed_factor float This is a multiplier against the - toss distance in touchpad units - used to scale the distance to a - speed. - - The default value is 0.5 - - /* edge motion related configuration constants */ - edge_speed int This is the nominal speed for - use when in the edge regions. - - The defalt value is 20 - - /* corner tap actions */ - upper_left_action int This is the mouse button which - will be activated on a tap in - the upper left corner of the - touchpad. - - 0: None - 1: Left - 2: Middle - 3: Right - 4: Fourth - 5: Up - 6: Down - 7: Toggle pad on/off - - The default value is 0 (none) - - upper_right_action int This is the mouse button which - will be activated on a tap in - the upper right corner of the - touchpad. - - The default value is 2 (middle) - - lower_left_action int This is the mouse button which - will be activated on a tap in - the lower left corner of the - touchpad. - - The default value is 0 (none) - - lower_right_action int This is the mouse button which - will be activated on a tap in - the lower right corner of the - touchpad. - - The default value is 3 (right) - - /* wmode parameters */ - wmode_enabled flag This is to enable the wmode of - Synaptics touchpad which - supports more configurable - options and buttons. - - The default value is 1 (enabled) - - drag_lock_enabled flag Whether to enable drag lock, - that is, do not break a drag - until next tap even when the - finger is off the pad. - - The default value is 0 (disable) - - finger_threshold int The threshold of the pressure - reading to consider the finger - is on the pad. - - The default value is 30 - - tap_lower_limit msec The lower bound of finger - contact time to be considerred - a tap. - - The default value is 5 (0.005 sec) - - tap_upper_limit msec The upper bound of finger - contact time to be considerred - a tap. - - The default value is 200 (0.2 sec) - - tap_range int The maximum displacement of - finger contact to be considered - a tap. - - The default value is 100 (0.1 sec) - - tap_interval msec The time length of button press - generated when a tap is - recognized, which is also the - time within which further - finger contact will be consider - a drag (or multiple click, if - it's also a tap). - - The default value is 200 (0.2 sec) - - pads_tap_interval int Equivalent to tap_interval, but the - pads interval. Used when wmode is - disabled and multi finger is enabled. - - The default value is 8. - - - multiple_tap_delay msec Break length between button - presses when generating multiple - click. - - The default value is 30 (0.03 sec) - - - palm_detect_enabled flag This enables the palm detection in - the pad so a palm does no move the - mouse. Actually this is the width of - the finger on the pad. - - The default value is 1 (enabled) - - palm_detect_level int At what palm detection level should - the pad be ignored? Value should be - between 0-11, where 11 is a full palm - at pad, and 0 is a normal finger - size. - - Default value is 12 (meaning disabled). - - - multi_finger_tap_enable flag This enables the ability to use 2 - and 3 fingers during a tap, to press - right and middle button - respectively. The detection is not - 100% perfect. If the pad supports - finger detection, its values are used. - - The default value is 1 (enabled) - - - multi_finger_stop_enabled flag When more than one finger is one the - pad, an average value (weighted with - the the pressure) between the - fingers is reported. This gives - erradic movements when adding - or removing fingers, or when just - accidental touches the pad. This - option stops the mouse movement for - a given time, to let the movement settle. - - The default value is 1 (enabled). - - - multi_finger_stop_delay Int Number of packets that should be - ignored when adding or removing an - additional finger to stop erradic - movements. - - The default value is 8. - - - /* Additional options */ - touch_pad_enabled flag This will stop the interpreting of - the touchpad (thought not the stick - if any). As such not that usefull, - but in a combination with a - corner toggle on/off, this may - come useful. A corner tap is - interpretated if it turns the pad on. - - The default value is 1 (enabled). - - stick_enabled flag Some touchpads have an additional - stick which uses the same port. This - is an attempt to enable the use - while using the touchpad. - - The default value is 1 (enabled). - - - scrolling_enabled flag This enables the scrolling gesture, - which emulates the wheel on a wheel - mouse. Putting the finger on the - edge and moving it up and down, is - eqvivalent with rolling the wheel up - and down. - - The default value is 1 (enabled). - - - scrolling_edge int This decides which edge(s) starts - the scrolling gesture. Legal values - are (added if more than one edge): - - 1: Left edge - 2: Right edge - 4: Top edge - 5: Bottom edge - - The default value is 2 (Right edge). - - - auto_scrolling_enabled flag This enables whether to keep - scrolling if the finger moves to the - top or bottom edge. - - The default value is 1 (enabled). diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.twiddler b/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.twiddler deleted file mode 100644 index ddbd017a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/drivers/README.twiddler +++ /dev/null @@ -1,161 +0,0 @@ - - NEW FEATURE IN BETA-2 OVER BETA-1 (ONLY TWIDDLER CHANGES) - -Fixed typo in twiddler.c which prevented compiling -Fixed segfault when using more than one thumb-key at a time -Should fix problem when non-ascii chars appear in the cfg file -Changed algorithm for dhouble-click -Added shift etc. support -Added VT change and Execution of commands - - DETAILED DESCRIPTION OF GPM SUPPORT FOR THE TWIDDLER KEYBOARD - - -Gpm-1.14 and later support the twiddler keyboard, by HandyKey Corp. -(the keyboard is described at www.handykey.com). This document -describes the current status of the gpm decoder. - - Mouse support - ============= - - Motion - ------ -The mouse functionality of the keyboard is supported by gpm. Three -decoders are currently available: - - - a "static" decoder, which turns twiddler position to mouse - displacement. The decoder locks the mouse when the - ``mouse'' button is pressed and any further motion - moves the cursor, as long as ``mouse'' is kept down. - This is compiled if "-DTWIDDLER_STATIC" (for example - by invoking ``make CC="gcc -DTWIDDLER_STATIC"''. - - - a "ballistic" decoder, which turns twiddler position to - mouse speed. If the keyboard is hole vertical the mouse - cursor won't be moved. To compile this decoder - -DTWIDDLER_BALLISTIC must be used. - - - a "mixed" decoder, that behaves like the static one when the - device is near-to-vertical and like the ballistic one - for large inclination. This is compiled by default - - - Problems - ........ - -The current decoder doesn't allow tuning the parameters at run time. -I plan to implement twiddler chords to change the resolution, -acceleration and threshold of the mixed decoder, and the other ones as -well. If different people routinely use different decoders, I'll make -it possible to choose which decoder to run. - -I will also implement the chord to switch up/down. - - - Buttons - ------- - -The first (left) mouse button is bound to the right key ("a", green, -R000). The other buttons are bound to M000 ("e", blue) and L000 -("SP", red). This is consistent with the twiddler manual. - -To ease using the fingers like with conventional mice, keys 0R00 and -00R0 (i.e., "b" and "c") are bound to the middle and right button as -well. - -Since someone prefers to reverse the order of the keys (i.e., L000 is -the left mouse button), they will use "-B 321" on the gpm command -line. To ease them, 0L00 is bound to the middle button, and 00L0 is -bound to the *left* button. Thus, with "-B 321" it will be the right -button. - -In summary: - - Left button (B1): R000 R000 - Middle button (B2): M000 0R00 - Right button (B3): L000 00R0 - -For people using "-B 321" - - Left button (B1): L000 L000 - Middle button (B2): M000 0L00 - Right button (B3): R000 00L0 - - - - Problems - ........ - -None, by now. - - - Keyboard support - ================ - - Configuration file - ------------------ - -The keyboard map is stored in run-time tables within gpm. There is no -precompiled table, so a configuration file is needed. I chose not to -precompile values because that would mean to pre-parse a configurazion -file, and provide documentation as well. Using a compulsory -configuration file reliefs my workload :-) - -The file "gpm-twiddler.conf" that appears in the gpm configuration -includes the default keyboard map, and can be used right away. If the -file is not in place, gpm will complain about its absence. By default -the file must live in /usr/etc (or /usr/local/etc, or whatever you -gave as a prefix to ./configure). The behaviour is similar for -different installation prefixes. The file is not installed by "make -install". If the file is missing, gpm will exit producing a message -like this: - - ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory - -The distributed configuration file includes its own documentation. - -If you want to add keys to the default file, you can avoid editing it -by writing a "gpm-twiddler.user" file and putting it in the same -directory as gpm-twiddler.conf. Gpm will read both files, in sequence, -but won't complain if gpm-twiddler.user doesn't exist. - -Gpm will print an error message for any incorrect line in any of the -configuration files: error messages include the file name and the -line number where the error appears, as well as a description of the -type of error. If any error is encountered, gpm will exit. - -The daemon will print a warning message for any redefined key, but will -use the new definition. Therefore, if you want to redefine keys in your -user file, just redirect standard error to /dev/null after checking -you are willing to override default definitions. - - - General information - ------------------- - -A key press is reported when any key of the chord is released: this -avoides reporting false keys when a multi-key chord is being composed. - -The twiddler driver in gpm implements auto-repeat. Auto-repeat is -invoked by double-clicking a chord and keeping it pressed. If the -double-click takes more than .3 seconds, it won't be considered a -double-click; auto-repeat will start .5 seconds after the -double-click. - -Gpm unblanks the screen when keys are composed using the twiddler. - - - Problems - -------- - -Gpm doesn't currently report keypresses to the X server. You should -use other twiddler drivers for Linux if you need this functionality. -For example get the driver by Jeff Levine (there is a link to the -driver in www.handykey.com). - - - - - -I would like to thank HandyKey Corp. for sending a twiddler keyboard -to me and Torben Fjerdingstad for his help in testing out the driver. diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/infofilter b/software/gpm/browse_source/gpm-1.99.7/doc/infofilter deleted file mode 100644 index f8682cbf..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char -s/^%/@c / -s/[^\\]%.*$// -s/\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/manpager b/software/gpm/browse_source/gpm-1.99.7/doc/manpager deleted file mode 100644 index c7b1119f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/manpager +++ /dev/null @@ -1,121 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/mktxt b/software/gpm/browse_source/gpm-1.99.7/doc/mktxt deleted file mode 100644 index 8193e387..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# This shouldn't contain any gawk specific features anymore - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\*\ Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/Announce b/software/gpm/browse_source/gpm-1.99.7/doc/old/Announce deleted file mode 100644 index 078456bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/Announce +++ /dev/null @@ -1,63 +0,0 @@ -This is to announce gpm-1.0, available by ftp from - -iride.unipv.it:/pub/gpm/gpm-1.0.tar.gz (my site) and -sunsite.unc.edu:/pub/Linux/Incoming/gpm-1.0.tar.gz its final destination -on sunsite and mirrors will be /pub/Linux/system/Daemons - - - What's gpm? - -Gpm ("general purpose mouse") is a user-level daemon in charge of mouse -management. It can deliver mouse events to clients on a per-console basis. -Its client library eases writing mouse-sensitive application which will run -under both the Linux console and xterm. - -Gpm is part of slackware since November 1994 (gpm-0.90). - -From 0.98.x onward it supported two mice running concurrently (like you -do with "MultiMouse") and it can repeat events to an external fifo -(like you do with "mconv"). - - - What's new? - -What made me switch to 1.0 is the availability of the high-level library, -a useful tool for mouse programmers, together with a sample application -using that library ("hltest"). - -"mouse-test" is available as well -- it is a tiny utility meant to -help you in detecting what protocol does your mouse speak. Not too -smart (it has to run attended), but useful when you change mouse. -It works well with serial mice, and is otherwise untested. - -gpm-root is now capable to draw recursive menus. Console locking is still -missing, lazy me. - -The daemon is able to manage two mice running concurrently, -this should be useful for those owning a laptop. - -t-mouse.el is enhanced, in mode-line and vertical-line management (not by -me, actually). - -The alpha architecture is supported. - - - What about the future, after 1.0? - -Most likely I'll release bug-fix updates in the near future (I only -own one mouse :-). - -After that I'll consider making gpm a kernel module, implementing a -mouse-type independent mouse driver. The device driver will be -completely compatible with applications linked with libgpm version 1.0 -or later. In this sense 1.0 is incompatible with previous versions: -applications linked with older libraries won't run with the kernel module. - - - I never use text consoles. - -Then, gpm is not important for you (unless you write mouse-sensitive -curses-based application). - - - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/BUGS b/software/gpm/browse_source/gpm-1.99.7/doc/old/BUGS deleted file mode 100644 index 6294f7b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/BUGS +++ /dev/null @@ -1,37 +0,0 @@ -Hello World. - -This files lists all current known bugs of gpm. If you have some spare time, -please help to fix them. Thanks from the current maintainer (Nico). - -Additional bug information can be found in the TODO file. Everything not done -is more or less a bug... - -/*============================================================================*/ -From: maintainer (Nico) - -src/headers/config.h: - SBINDIR and SYSCONFDIR are corrupted: ${prefix} should disappear! - -/*============================================================================*/ -From: maintainer (Nico) - -Following probles crash/do not work correctly: (most due to problems with devfs) - - mev - - gpm-root - - disable-paste - - mouse-test - -/*============================================================================*/ - -From: D Richard Felker III - -One is the way the baud rate setting is done. It worked fine in old -versions of gpm, but the special case for mman in the baud rate -setting code now actually *breaks* support for my Logitech MoiseMan -(the version with 4 buttons). Could you provide an way to initialize -it to 9600 baud just like all the other mice, without using the -special mman code that doesn't work for this mouse? - -[...] - -/*============================================================================*/ diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/Changelog b/software/gpm/browse_source/gpm-1.99.7/doc/old/Changelog deleted file mode 100644 index 9b8b21ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/Changelog +++ /dev/null @@ -1,2079 +0,0 @@ -2002-12-24 Nico Schottelius - * removed src/prog/Makefile*: it's easier with one Makefile - * some cleanups to Makefile.in,src/Makefile.in - - ==> gpm-1.20.1 release - -2002-12-02 Nico Schottelius - * added src/prog, src/lib so I don't confuse library / program - and normal source files... - * modified src/Makefile.in to fit latest the new directory structure - * added src/prog/Makefile.in, src/lib/Makefile.in - -2002-11-30 Nico Schottelius - * today leaving the hospital -> - gpm-1.20.1rc2 will be released, minor fixes/patches will be accepted - until 15th of Decembre...after that stable 1.20.1 should be out. - -2002-11-26 Nico Schottelius - * gpn.c: moved some opt_ to option. structure - * gpn.c: cleanup up cmdline - * startup_n_daemon.c renamed to startup.c as the demon part is old_main - * server_tools.c: added prototype of init_mice - * server_tools.c: added prototype of reset_mice - * -u paramter for autodetection implemented, autodetect() is still missing - * removed headers/gpmInt.h from gpm-root.y - * updated -h informations - * added -DSYSCONFDIR patch from Ben Pfaff -> synaptics should work again - -2002-11-23 Nico Schottelius - * some minimal changes to the Makefile.in, make dist works perfectly now! - * typo in MANIFEST - * removed gpmCfg.h from source tree. Merged with gpmInt.h - => configuring a program via header files is not necessary. - => either we tune things with ./configure or parameters - * removed gpm-proto.h as it is not used. - * added GPM_RELESE_DATE - * replacing date in doc/doc.gpm.in with @release_date@ - -2002-11-22 Nico Schottelius - * heavy work on -M,-o,-m,-t -> gpn.c,server_tools.c,...more description - follows - * added add_mouse in server_tools.c - * added primary support for more than two mice - * changes to gpn.c to let add_mouse work - * updated doc/doc.gpm.in - -2002-11-08 Nico Schottelius - * added main.c, which will replace earlier main() function - * correct the running gpm check, now we start with a stale pidfile, too. - * added new struct options option - * next release will have the name 'gpm Autumn', cvs has this name right now - -2002-07-17 Dmitry V. Levin - * bugfix: restored fields order in struct Gpm_Event to avoid ABI change. - -2002-06-30 Nico Schottelius - * removed some files, updated cvs. - -2002-05-31 Nico Schottelius - * applied patch from Kerry Scott McLeod , - which fixes some gpm_open() problems (gpm06122002-cvs-tty.patch) - -2002-05-31 Nico Schottelius - * included latest updates to the synaptics driver from peter berg larsen - (patches/done/applied/diff_synaptics_c_7.gz) - -2002-05-27 Nico Schottelius - * together with Alessandro's help there is now cvs access to gpm - * added Sven Dickert's patch - - ms3 wheel / repeater - - imps2 wheel - (partly changed to match current code) - * updated README - * updated src/report.c: removed now unecessary \ns - * updated TODO - * moved ChangeLog to Changelog - -2002-05-11 Nico Schottelius - * updated the FAQ - * fixed problem with long filenames through linking (src/Makefile.in) - * added VSXXX-AA ("hockey puck") mice support: patch from - "Maciej W. Rozycki" - * fixed minor problems with libgpm.so (shlib-patch, Maciej W. Rozycki) - -2002-04-26 Nico Schottelius - * most of the exams are written, so time is back for gpm: - applied 3/4 of Peter Berg Larsen's [pebl@math.ku.dk] synaptics patch - * added doc/HACK_GPM, added a note in README - -2002-03-11 Nico Schottelius - * replaced 2spaces/tabs with three spaces in synaptics.c - * removed DEBUG_SYNAPTICS in synaptic.c - -2002-03-10 Nico Schottelius - * added doc/support for vendor information about mouse support. - first document is from logitech - -2002-03-03 Nico Schottelius - * added M_imps2 patch, which looks now for unsigned data instead of signed - (Paul ...) - * applied ms3 repeater patch from Andrew - -2002-02-28 Nico Schottelius - * removed warnings about labels (missing semicolon at the end of - switch() statement) - * added stdlib.h for exit() to report-lib.c - -2002-02-24 Nico Schottelius - * changed DEF_CLUSTER from 10 to 0 in headers/gpmCfg.h. This makes the mouse - faster on modern machines, slower on 386. (Proposal by - Andrew Pimlott and Alessandro Rubini) - * add DEF_CLUSTER into doc/FAQ if the mouse is too slow. - -2002-02-23 Nico Schottelius - * bugfix: problems in processConn/devfs code. snprintf() didn't work the way - I expected, so sprintf() and strncpy are used. - * bugfix: gpm-root won't compile outside the srcdir (Makefile problem) - - ==> released gpm-1.20.0 - -2002-02-22 Nico Schottelius - * bugfix: sedsid() in gpn.c should only be executed, if running as daemon - ==> gpm -D works now fine again. - * bugfix: if condition in gpm.c, gpm_exited() must leave - ==> removing gpm.pid works again. - * bugfix: hltest.c: could possibly run with devfs and without it... - * modifications to Makefile.in - -2002-02-20 Nico Schottelius - * removed gpm_oops and replaced it with gpm_report(GPM_PR_OOPS) although - the report function should normally not exit....but this way we can - decide better, if we should take _exit() or exit(). A simple - 'for file in *.c gpm-root.y ; - do cat $file | sed - 's/gpm_oops(FL/gpm_report(GPM_PR_OOPS/g' > $file.new; - mv $file.new $file; - done' - did all the work. - * added GPM_PR_OOPS to headers/message.h - * updated check_kill(): we don't need opt_kill, if -k is specified we kill, - so we can call check_kill() directly. - * removed unecessary global variable opt_kill - * updated check_uniqueness: removed unecessary code. made everything more - simple. - * moved devfs parts to gpmInt.h (where it belongs to...) - * removed debugging in gpmInt.h - -2002-02-10 Nico Schottelius - * replaced two with three spaces in mouse-test.c (possibly cindent would have - helped, too. But I didn't use it until today) - -2002-02-10 Nico Schottelius - * renamed the oops() function to gpm_oops() so we don't pollute - user space! - -2002-02-10 Nico Schottelius - * added patches from Andreas Mohr: fixed many typos, added descriptions, - removed warnings (that were patches I really like, although they were - diffed against gpm-1.19.6.) - This first patch also included I_ps2, R_ps2 - - -2002-02-06 Nico Schottelius - * added report-lib.c: this is used in libgpm. - * added tools.c: used by clients (libgpm) and server. (Gpm_Open) - * added event device patch - * updated gpm-root.y - * fixed minor bug in src/Makefile.in - * 2->3 spaces in mev (via contrib/scripts/replace_2_with_3_spaces - - * released gpm-1.20.0-gamma to mailing list. - -2002-02-04 Nico Schottelius - * checked twiddler.c: indent is now okay and gpm_report,too. - -2002-02-02 Nico Schottelius - * checking new functions/debugging other problems in gpm.c,gpn.c, - mice.c,liblow.c - * replaced tabs in mice.c with 3 spaces. - * removed more 'bad' report code (fprintf(stderr, .. ) is deprecated!) - -2002-01-29 Nico Schottelius - * removed default device completly. (gpm.c) - * added x_high_y() and cnt_digits() - * replaced all 2/4 spaces in gpn.c with 3 spaces. - -2002-01-14 Nico Schottelius - * applied patch from Blaise Gassend : - - added an imps2 repeater - - slight changes to imps2 and synps2 so that roller motions could be - generated - * applied gpm-1.19.6-rh-gpm-root.diff from Solar Designer - * updated MANIFEST: patches are now included in the gpm source tarball. - * update src/headers/message.h: added new messages - * cleanup intetion level in gpm.c: now 3 spaces is the standard. - this makes no problem with tabs! other files follow... - * cleanup some old oops() calls, which are now oops(FL), as oops is not - an macro anymore. (gpm.c) - * cleanup some old gpm_debug_log calls. - * added FIXME directives for people, who have time to fix some code. - -2002-01-08 Nico Schottelius - * applied awk patch from Jason Gurtz and Mark Hymers - (markh@linuxfromscratch.org) - -2002-01-07 Nico Schottelius - * updated TODO file. - * removed -V option (currently gpm_debug_level is not supported anymore) - * added #defines for message strings to message.h - * renamed check_devfs to get_console - * added some initializations to Gpm_Open - -2002-01-05 Nico Schottelius - * finished report.c (gpm_report) which should replace all output - functions now - * removed devfs.c (last devfs code is now in gpn.c) - * removed debuglog.c (all messaging is done through report now) - * removed headers/wd.h, moved parts into headers/message.h - * begin to remove debuglog code. (was not clear enough) - * updated headers/gpmInt.h - * applied following pataches: - - gpm-1.19.3-owl-warnings.diff (removed strings.h include)[Solar Designer] - -2001-12-02 Nico Schottelius - * added sample initscript from Solar Designer to contrib/init - -2001-11-06 Nico Schottelius - * removed src/Makefile.dep, added easy dependencies - * removed headers/general.h, defines.h, gpm-mess.h - * cleaned up doc/Makefile.in - * primary ROOT support (for installing in virtual tree) - -2001-10-03 Nico Schottelius - * moved doc/doc.gpm to doc/doc.gpm.in, version is replaced by configure - -2001-10-02 Nico Schottelius - * added src/Makefile.dep, which produces dep files for src/Makefile. - * updated MANIFEST, README - * removed devfs from mouse-test.c, it's not needed there. - -2001-09-27 Nico Schottelius - * added double include protection into new header files - * gpm.c: removed unecessary variables. fixed possible problem with - braces. thanks to gcc -Wall - * devfs.c: fixed some static problems stuff - * liblow.c/twidler.c: removed global variable consolename - * mice.c: added missing string.h, added braces. removed variables. - * src/Makefile.in: removed ELISP, those files are in contrib/ now - -2001-09-23 Nico Schottelius - ***** Release 1.19.5 - * fixed libc5 and Linux 2.0 problems - * new problem with the main Makefile - -2001-09-13 Nico Schottelius - * Makefile fixes (doc/) - * minor devfs changes - * added synaptics patch: now all 4 buttons of touchpads are supported. - (Chun-Chung Chen supplied this patch) - -2001-09-08 Nico Schottelius - * new directory structure - * new file structure - * bug in liblow.c fixed: thanks to Jakub Bogusz - -2001-09-04 Nico Schottelius - * removed from source, so we can compile under Linux 2.0 - * rewrote parts of the readme, updated it - -2001-09-02 Nico Schottelius - ***** Release 1.19.4 - * introduced problems with libc5 and linux 2.0! - -2001-08-21 Nico Schottelius - * several files: applied some old patches (imps autodetect, mktemp - secure problem, IntelliMouse Explorer), preparing next gpm release. - -2001-04-23 Nico Schottelius - * gpm.c: removed default taking of /dev/mouse (problem with devfs). - Instead print help message, to use the -m 'dev' option - -2001-04-22 Nico Schottelius - * gpm.c, liblow.c, mouse-test.c: primary devfs support added. Now gpm will - at least start, but some of the hardcoded ttys are still there. - -2000-07-18 Alessandro Rubini - - * doc/doc.gpm (Command Line): removed "-q" documentation. - -2000-07-16 Ian Zimmerman - - * gpmInt.h (GPM_REQ_NOPASTE): add this to replace GPM_REQ_CONFIG. - - * Makefile.in (GOBJ): no longer link gpm with liblow.o, it was - only needed for disable-paste. - - * doc/doc.gpm (Command Line): remove part about needing setuid in - disable-paste. - - * gpm.c (disable_paste): replace xfer_options with this function. - (opt_quit): remove. - (processRequest): replace xfer_options call with disable_paste(). - (processRequest): replace GPM_REQ_CONFIG with GPM_REQ_NOPASTE. - - * gpn.c (cmdline): remove all code dependent on opt_quit. - (cmdline): remove 'q' from getopt argument. - (xfer_options): remove. - -2000-07-14 Ian Zimmerman - - * Makefile.in (install): no longer install disable-paste with mode - 4755. - - * gpn.c (xfer_options): make a normal connection (Gpm_Open(*,0)) - rather than a "default" one (Gpm_Open(*,-1)); with identification, - default connections must be made as root (at least when setuid - root), and disable-paste no longer runs as root per the previous - entry. - - * gpm.c (processConn): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), use the getsockopt(SO_PEERCRED) - interface to identify the client, rather than checking the name - bound to the peer. Security problem reported by Olaf Kirch - - (processConn): close the newly accept()ed socket in case of - identification failure. - (main): remove initial setuid(0) call; as reported by Olaf Kirch - this is a general security problem because it - makes a setuid process appear to be a genuine root process to libc - internals. - (main): add a geteuid()==0 check after option processing and - before main loop. - - * liblow.c (Gpm_Open): if SO_PEERCRED is defined (which it is at - least with 2.2.* kernels), do not bind the client side of the gpm - socket. - - * t-mouse.el (t-mouse-tty): merge patch by Wolfgang Sourdeau - to deal with yet another and different - version of procps. - -2000-04-19 Koblinger Egmont - - ***** Release 1.19.2 - - * gpm-root.y (f__fix): added initgroups() to definitely fix sec. hole - -2000-03-31 Alessandro Rubini - - ***** Release 1.19.1 - - * contrib/Makefile.in: use @release@ as needed - - * contrib/: added new patches and reasons why I didn't apply them - I'll put further patches in ftp://ftp.prosa.it/pub/gpm/patches - -2000-03-30 Alessandro Rubini - - * gpn.c (find_mouse_by_name): fix by Chris Ruhel (failed for synonyms) - - * README.gunze: updated to refer to /dev/touchscreen - - * gunze-setup: added missing line (bugfix) and changed default - device to /dev/touchscreen if available. - - * gpm-root.y (f_bgcmd): avoid calling setuid, do it last instead - (still doesn't use initgroups(), I'll let this to others - -2000-03-07 Alessandro Rubini - - ***** Release 1.19.0 - - * contrib/: new directory, with contributed and unapplied patches - - * README: gpm is officially unmaintained - -2000-02-07 Alessandro Rubini - - * gpm.c (getMouseData): downgraded "Error in protocol" to LOG_DEBUG - -2000-02-02 Stefan Runkel - - * mice.c (I_wacom, M_wacom): new Wacom IV protocol driver - - * doc/doc.gpm : Wacom Item updated - -2000-02-01 Alessandro Rubini - - * gpm.c (processMouse): re-check console size on console change - (get_console_size): preserve pointer position even if size changed - -2000-01-27 Roberto Amucano - - * liblow.c (Gpm_CharsQueued): new function - -2000-01-20 Alessandro Rubini - - * MANIFEST: new file, used in "make dist" as well - - * sample/rmev.c (main): reverted too. - - * sample/*.in: reverted to the older standalone implementation - - * configure.in: don't create sample/Makefile - - * doc/localstyle.tex: removed unused file - - * configure.in: changed versions (program and library) - -2000-01-19 Alessandro Rubini - - * doc/doc.gpm (Bugs and Problems): removed the pre-1.0 bug. - (Mouse Types): Moved chapter: from "internals" to "server invocation" - (Mouse Types): added the man page gpm-types.7 - - * tools/b2x.c: new directory and new file, to help with new protocols - - * doc/doc.gpm (Mouse Types): added description of gunze - -2000-01-17 Alessandro Rubini - - * several files: changed maintainership and attributions - - * *.[ch] */*.[ch]: fixed address of FSF (now in Boston) - - * README doc/doc.gpm: fixed references to /usr and /usr/local - -2000-01-17 Ian Zimmermann - - * doc/Makefile.in: renived dependency on Makefile - - * Makefile.in: removed dependency on Makefile where not needed - -2000-01-16 Alessandro Rubini - - * mice.c (M_mman): removed unneeded message about extra byte - -2000-01-14 Alessandro Rubini - - * xf86Summa.*: the files have been added to CVS, for easy retrivial - - * mice.c (I_gunze, M_gunze): new touchscreen protocol supported - - * gunze-setup: new file (needs to be merged with microtouch) - - * README.gunze: new file (needs to be merged with microtouch) - - * gpn.c (find_mouse_by_name): bugfix: didn't find repeater name - -2000-01-13 Alessandro Rubini - - * gpm.c (build_argv): bugfix, didn't parse multiple options. - - * mice.c (parse_argv): new function, used by mouse initialization - -2000-01-10 Alessandro Rubini - - * gpm.c (get_data): avoid a message which is duplicated anyways - - * liblow.c (Gpm_GetEvent): avoid the message if no data is there - -2000-01-05 Ian T Zimmerman - - * mev.c (main): continue if select is interrupted - -2000-01-04 Alessandro Rubini - - * mouse-test.c: various changes to fit the new mice.c layoutq - - * mice.c: use new prototype for init function, and print errors if - too many options are passed - (option_modem_lines): use the "dtr", "rts" and "both" options for - serial devices. - - * gpn.c (find_mouse_by_name): new function, using the sysnonym field - as a list of alternative names - (cmdline): changed use of the -o option - (cmdline): avoid closing stderr (init functions must print errors) - - * gpmInt.h (Gpm_Type): rename "syn" to "synonyms", and changed its use - (Gpm_Type): changed prototype of the init function - (mouse_feautres): removed "opt_toggle", added "opt_options" - - * gpm.c (build_argv): new function, used for "-o" - (wait_text): remove action on RTS and DTR, as it is in done in dev init - (main): create the argv associated to each device, don't act on DTR - - - * doc/doc.gpm (Mouse Types): revised and completed this list - (Command Line): documented the new "-o" option - - * debuglog.c (gpm_oops): always print to stderr as well - -1999-12-08 Alessandro Rubini - - * liblow.c (gpm_convert_event): use "unsigned char" for conversion of - xterm data (suggested and partially done by Christian Weisgerber) - ------> 1.18.1 released - -1999-11-07 Alessandro Rubini - - * configure.in (release): 1.18.1 - - * mice.c: new Wacom decoder, contributed by Stefan Runkel - . Also a flag marking mouse types that - offer a repeater. - -1999-10-07 Alessandro Rubini - - * README: added a paragraph about the CVS repository - - * Makefile.in: removed ".SECONDARY" for gpm-root.c - - * gpm-root.y (getdraw): lowered the loglevel for stat(user) - -1999-09-12 Ian T Zimmerman - - * doc/doc.gpm: Update version and update-month. - - * configure.in (release): Bump to 1.18.0. - -1999-08-05 Ian T Zimmerman - - * mice.c (M_wp): Matt Kimball writes: A - few weeks ago I asked for help getting my Genius WizardPad tablet - to work. (The 'acecad' driver got it to talk back, but gpm - couldn't understand). - - Well, this morning I got the technical spec for my tablet from the - Genius people, and as of right now I am actually able to use my - tablet as my only pointing device under X. Woohoo! - - To do it, I actually added support for the WizardPad to gpm and - set gpm in Summa repeater mode. Thanks gpm folks for making it so - easy to get my tablet working in so little time! (After getting - the specs, of course). - - Attached is a patch against gpm which provides support for the - WizardPad protocol. It turns out that it isn't related to the one - that 'acecad' is using at all. It just happened that 'acecad' - sent some things which made the WizardPad talk back. - -Mon Jun 28 07:18:44 1999 Ian T Zimmerman - - * doc/doc.gpm: Changed info file category because gpm is not - really part of Emacs. - -Thu May 27 23:20:15 1999 Ian T Zimmerman - - * synaptics.c (ser_read): Apply patch by Henry - to allow the touchpad to be ignored if it - is unplugged. - -Tue May 11 18:57:15 1999 Ian T Zimmerman - - * mice.c: Geert Van der Plas provided - the code to support older Synaptics PS/2 touchpads. - - * synaptics.c: Geert Van der Plas - provided the code to support older Synaptics PS/2 touchpads. - - * mice.c (M_summa): realposy should be 0 - based. - -Fri May 7 22:28:38 1999 Ian T Zimmerman - - * configure.in (release): Bumped to 1.17.8 - - * synaptics.c: Fixes by Henry Davies - - * README: Fix email addresses, contributed by Davide Barbieri - - -Tue Apr 20 07:12:57 1999 Ian T Zimmerman - - * aclocal.m4: Add ITZ_CHECK_TYPE. - - * configure.in: Use ITZ_CHECK_TYPE. - - * liblow.c (Gpm_Open): Before trying ttyname(0) etc., check that - the file number refers to a tty device in the first place. This - is because libc 5 implementation of ttyname() can be wastefully - slow. Antonio Colombo - -Tue Apr 6 02:22:31 1999 Ian T Zimmerman - - * configure.in: Change way we deal with presence or absence of - __u32, due to glibc header differences. Dan Yefimov - - (release): Stepped release to 1.17.7 - -Wed Mar 31 00:03:38 1999 Ian T Zimmerman - - * doc/doc.gpm (Demo Clients): Split index into Type, Function, and - Variable indices. It was getting unwieldy. - (Mouse Types): Corrected mtouch item in mouse types. - - * configure.in (release): Bumped release number to 1.17.6. - - * Makefile.in (DIFFS): Add the microtouch files. - - * mice.c (M_mtouch): Add Alessandro's MicroTouch tablet decoder. - - * doc/doc.gpm (Mouse Types): Add info about microtouch device - type. - - * README: Update information about mailing list and Alessandro's - current address. - - * libxtra.c (Gpm_GetSnapshot): More defensive checks for the case - of missing gpm binary. - - * mouse-test.c (main): Replaced makedev with gpm_makedev for - compatibility with glibc2. Reported and fix suggested by David - Monniaux . - -Tue Mar 30 23:59:47 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Now checking for error return from - Gpm_GetSnapshot. - - -Sat Mar 27 22:01:35 1999 Ian T Zimmerman - - * doc/doc.gpm: Removed redundant @findex lines (@deftypefun - creates an index entry atomatically). This didn't do any harm - when processed by makeinfo, but it confuses stupid texi2html into - producing 2 identical index entries. - -Tue Mar 2 00:29:40 1999 Ian T Zimmerman - - * mev.c (do_snapshot): Check return value from Gpm_GetSnapshot, - barf loudly if it fails. (Alessandro Rubini , who - really should run "make install" someday :) - - * mice.c: Apply patches from Frank Holtz to - handle Acecad tablets; and from Alessandro Rubini - to fix stale comments about format of mouse type - table. - -Thu Feb 18 21:21:56 1999 Ian T Zimmerman - - * gpm.c (processMouse): Apply latest patch from Frank Holtz - to produce more isotropic moves. - - * mice.c (M_summa): Add Frank Holtz's Summa - protocol support, at last. This really needs testing. But I - suppose we'll hear about any bugs even without asking. - -Wed Feb 17 21:51:00 1999 Ian T Zimmerman - - * gpn.c (check_kill): Really unlink the stale pid file, not jusk - talk about it. - - * doc/doc.gpm (Command Line): Improve description of the -V option - as suggested by Mircea Damian . (Linux in - Romania -- world domination must be really close now). - -Mon Feb 15 10:25:53 1999 Ian T Zimmerman - - * synaptics.c: Make source likable to Emacs (function-opening - braces in column 1 please). - (syn_read_config_file): Config file should go to /usr/etc - (ie. SYSCONFDIR), look for it there. - - * mice.c (I_serial): Assume synaptics device needs baud rate - notification like other serial mice. - - * Makefile.in (%.elc): Correct Emacs byte compilation rule for - backward compatibility. - - * mice.c: Add Synaptics support from Henry Davies - . - - * Makefile.in (DIST): Add Synaptics support files from Henry - Davies . - -Sat Feb 13 10:27:35 1999 Ian T Zimmerman - - * gpm.c (processMouse): Add Frank Holtz's code - for repeating from absolute protocols, with the deletion of some - device-specific and resolution-specific stuff. This should be - tested, somebody with an absolute device please run "gpm -R msc" - and see what happens in X. - - * mice.c: Add Frank Holtz's SummaSketch driver. - It is disabled for nonce because of continuing confusion over that - protocol. Anybody with better people/communication skills than I - have is encouraged to contact Frank and make sure his contribution - (which is very welcome in principle) conforms to gpm's design and - coding pratices. - - * mev.c (main): Stop immediately if I discover I run in xterm. - - * doc/doc.gpm (mev): Document newly missing xterm functionality. - -Sun Jan 24 09:03:47 1999 Ian T Zimmerman - - * Makefile.in (DIST): Add exec.el back in. - -Thu Jan 14 12:47:53 1999 Ian T Zimmerman - - * doc/manpager: Handle @file{} as well. - - * doc/doc.gpm: Hardcode major release number back in. Argh. - Fix more formatting in manpages. - - * doc/Makefile.in (%.texinfo): Roll back this ill-considered - change; it forces re-TeXing gpm.texinfo. - (TEXI2HTML): Be consistent and make option part of make variable. - -Wed Jan 13 21:21:03 1999 Ian T Zimmerman - - * doc/doc.gpm: Fixed incosistent formatting, removed instances of - gratuitous visual formatting. - - * doc/Makefile.in (%.texinfo): Give an additional script piece to - sed to substitute for %RELEASE%. - (%.html): Add rule for Web fanatics. - -Tue Jan 12 00:11:10 1999 Ian T Zimmerman - - * doc/manpager: Improve to italicize @var{} items. - - * doc/doc.gpm (Command Line): Document parametrized repeater, in - particular raw repeater. - -Mon Jan 11 22:42:16 1999 Ian T Zimmerman - - * mice.c (mice): Add the repeat_fun fields. - (R_msc): Add. - - * gpm.c: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (processMouse): Use repeat_fun rather than hardcoding msc protocol - in repeating. - - * gpmInt.h: Apply patch from "Jan D." - for raw repeater. - (opt_repeater_type): Add. - (repeated_type): Add. - (Gpm_Type): Add new method repeat_fun to handle the - task of repeating a given mouse event in a particular protocol. - - * gpn.c: Apply patch from "Jan D." - for raw repeater. - (cmdline): Use an optional argument to -R rather than a new option. - Barf if the repeat_fun method of requested protocol is null. - -Fri Jan 8 11:05:57 1999 Ian T Zimmerman - - * aclocal.m4: Change darned gcc test again because GCC variable is - modified by AC_PREFIX_PROGRAM. Use ac_cv_prog_gcc instead. - - * gpm-root.y (get_winsize): use /dev/tty0 not /dev/console. - (f.debug): disable undocumented f.debug function - because it uses a file in /tmp in a fashion which invites symlink - abuse. - - * mouse-test.c (main): exclude devices with a minor number of 130 - from the device probe to avoid causing spontaneous reboots on - machines where watchdog is used. Reported by Jim Studt - , patch by James Troup . - - * gpn.c (usage): typo (s/an unexistent/a non-existent/). Patch by - James Troup . - - * doc/manpager: Interpret only with gawk. Patch by James Troup - . - - * aclocal.m4: Change broken test for gcc to use $GCC, not $CC. As - reported by James Troup . - Replace -fpic with -fPIC. As suggested by - James Troup . - Add dependency on libc to shared library linking flags. - As suggested by James Troup . - -Thu Jan 7 21:36:46 1999 Ian T Zimmerman - - * doc/doc.gpm: Apply patch from James Troup - fixing various typos and documenting the mouse-test program. - -Sun Jan 3 11:43:20 1999 Ian T Zimmerman - - * doc/Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * Makefile.in (append-diff): diff exits with status 1 if it finds - differences. Argh. - (install): Make sure data files are installed with 644 mode. - - * gpmCfg.h (MAX_VC): Use MAX_NR_CONSOLES to define this if - possible. - - * configure.in: Add a check for linux/tty.h. - - * doc/doc.gpm (Command Line): Document -A [limit]. - - * gpn.c (usage): Indicate that -A takes an optional parameter. - (cmdline): Add setting of opt_age_limit depending on optional - parameter to -A. - - * gpmInt.h (opt_age_limit): Add. - - * gpm.c (selection_paste): Add general aging test. - -Sun Dec 27 08:05:18 1998 Ian T Zimmerman - - * doc/doc.gpm: Add a directory entry for install-info. - -Sat Dec 26 17:05:22 1998 Ian T Zimmerman - - * Makefile.in (libgpm.so.@abi_full@): Start a new version number - scheme for the shared library. This is intended to be compatible - with libtool versioning, and the initial number is chosen with - continuity in mind, so nothing needs to be recopmiled or even - relinked. - - * configure.in: Rewrite auto-configuration rules per Autoconf Info - page. - - * Makefile.in (config.h): Add config.h support to reduce build - noise. - -Wed Dec 16 22:06:31 1998 Ian T Zimmerman - - * liblow.c (Gpm_Open): Use sigaction() instead of signal() to - manipulate SIGWINCH and SIGTSTP; suggested i.a. by Jan Vroonhof - to fix an infinite signal loop under - XEmacs. - - * gpn.c (cmdline): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * gpm.c (gpm_killed): Get rid of remaining uses of stderr - (suggested by md@linux.it (Marco d'Itri)). - - * mice.c: Apply patch from John Anderson to - support Calcomp UltraSlate tablets. - - * t-mouse.el (t-mouse-make-event): Applied patch from Tom Breton - for braindead chords in t-mouse with 2 button - mice. - -Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 - -Mon Oct 5 22:00:19 1998 Ian T Zimmerman - - * Makefile.in (append-diff): Add some flags to the diff command - (most important, --unidirectional-new-file). - -Wed Sep 30 11:08:59 1998 Ian T Zimmerman - - * doc/manpager: Add handling of forced line breaks, - cross-references, and boldface (used for cross-references). - - * doc/doc.gpm: Fixed manpage cross-references. - (Command Line): Mention disable-paste. - -Tue Sep 29 10:39:48 1998 Ian T Zimmerman - - * gpn.c (xfer_options): Move the option structure type into - gpmInt.h to prevent stupid future problems. - - * Makefile.in (install): Add disable-paste (and make it setuid). - - * disable-paste.c (main): Add a new program (not a large one :) - - * mice.c (M_brw): Apply eb patch for broken Fellowes Browser mice. - - * sample/Makefile.in (append-diff): Added rules to recursively - append to the diff file being created in top directory. - - * Makefile.in (DIST): Remove exec.el from the distribution because - it is not needed anymore. Modern Emacs has en --eval command line - option that allows me to do the same thing directly. - - * configure.in (ITZ_PATH_SITE_LISP): Use it. - - * aclocal.m4 (ITZ_PATH_SITE_LISP): Added. - -Mon Sep 14 18:03:45 1998 Ian T Zimmerman - - * doc/Makefile.in (gv): Replace "$(TARGET)" with "gpm". - - * Makefile.in (gpm-%-to-@release@.diff): Added rule to create a - diff from snapshot of previous release. - - * mice.c: Reapply Edmund Grimley Evans' patch with new mouse types - ms+ and ms-lr which get lost somewhere. - -Sun Sep 13 00:08:54 1998 Ian T Zimmerman - - * configure.in: Set CURSES_OBJS dependent on finding the curses header. - -Sat Sep 12 10:53:54 1998 Ian T Zimmerman - - * Makefile.in (LOBJ): Make the buliding of libcurses.o decided by - configure again. - - * libcurses.c (Gpm_Wgetch): Remove the ELF assembler-dependent - wgetch hack again, as it is not really needed as long as clients - are linked statically. - - * gpm.c (processRequest): Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Removed GPM_REQ_CLEAR again, now that its - functionality is available with the -A flag and opt_aged. - - * libxtra.c: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * gpm.h: Removed Gpm_ClearSelection() again, now that its - functionality is available with the -A flag and opt_aged. - - * mev.c (interact): Removed "clear" command again, now that its - functionality is available with the -A flag and opt_aged. - - * gpmInt.h: Change signature of xfer_options(). - Remove it altogether, it's better static and split to gpn.c and - gpm.c. - Add opt_aged. - - * gpn.c (check_uniqueness): Completely rewritten. This function - was a messy mixture of different things. - -Wed Sep 9 09:50:59 1998 Ian T Zimmerman - - * libxtra.c (Gpm_GetServerVersion): Provide explicit path for - popen of gpm daemon. - - * sample/Makefile.in (rmev.o): Added target because of usage of - RMEV_RELEASE. - (prefix): Looks like this has to be done in _every_ Makefile, - sigh. Even if it is not used explicitly, configure subsitutes - e.g. "@sysconfdir@" with "$(prefix)/etc". - (sysconfdir): Added sysconfdir. - - * Makefile.in (gpn.o gpm-root.o twiddler.o): gpn.o added to this - target because it uses RELEASE symbol substituted by configure. - -Tue Sep 8 14:04:44 1998 Ian T Zimmerman - - * mev.c (interact): Added case for "clear" command. - - * libxtra.c (Gpm_ClearSelection): Added. - - * gpmInt.h (GPM_REQ_CLEAR): Added (rubino's objection overruled; - the gpm protocol is not really ugly, it's the code that is, in - effect casting the data exchanged to Gpm_Conn and Gpm_Event. It - could be coded cleanly or even fixed from present state, but don't - hold your breath, you could suffocate.) - - * gpm.h: Add Gpm_ClearSelection. - - * t-mouse.el (t-mouse-swap-alt-keys): Added. This is what is - called "personal variable" :-) I swap the left and right Alt keys - in my Linux keytable, but I still want Emacs to handle left-Alt - events. - -Wed Sep 2 00:09:42 1998 Ian T Zimmerman - - * doc/Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * sample/Makefile.in (maintainer-clean): -rm -i for uniformity. - - * Makefile.in (maintainer-clean): Ignore errors because the file - list can be empty. - - * mouse-test.c (makedev): Add O_NONBLOCK to open ttyS devices - (otherwise the program hangs in this function, at least on my - system). - - * doc/doc.gpm (gpm-root): Use @file at several places in - preference to other markup. Fix several other general - documentation bugs, mostly referring to obsolete (non-)features. - - * doc/Makefile.in (.SECONDARY): Need both %.ps and gpm.ps --- - looks like a gmake bug. - - * sample/gpm-xterm.h: Applied patch by Jean-Daniel - for looking back when scanning arrow key - sequences. - - * Makefile.in (datadir): Oops, need to define this if I define - elispdir. GNU standard document a little incomplete on this - point. - -Fri Aug 28 00:06:05 1998 Ian T Zimmerman - - * configure.in: Oops, autoconf hates newlines between filenames in - AC_CHECK_HEADERS. - - * create_vcs: Create symlinks in /dev for the new (or old?) names - mandated by kernel device list. - - * gpm-root.y (main): Check for both /dev/vcs and /dev/vcs0. Also - check for correct device number. - - * configure.in: Check for sys/sysmacros.h and linux/major.h. - -Thu Aug 27 09:33:56 1998 Ian T Zimmerman - - * sample/Makefile.in: Add TAGS rule. - - * Makefile.in (libgpm.so.@release@): Change sed script to extract - the major release number, now that there are 2 dots in the - complete number. - - * configure.in (release): Now includes the patchlevel number, for - instance 1.15.5. - - * sample/configure.in (release): Define this as RMEV_RELEASE. - - * configure.in (release): Define this as both GPM_RELEASE and - RMEV_RELEASE. - - * gpmCfg.h: Delete RELEASE definition. (will be passed from - configure). - - * sample/rmev.c (RMEV_DATE): Define from RCS checkin date. - Delete RELEASE definition. (will be passed from configure). - - * gpmCfg.h (GPM_DATE): Define from RCS checkin date. - - * sample/gpm-xterm.c: Delete RELEASE definition. - - * Makefile.in: For submakes, add -lgpm to LIBS. Put do-all before - @SHLIB@ in the rule for all; let's hope that means submakes will - use the static library. - Oops, that didn't work. Another try: name the shared library - libgpm.so.@release@ maybe that way linker won't find it. - - * configure.in (GPMXTERM): This is needed because we now configure - under sample. - - * Makefile.in: Add sample to subdirs for recursion. - - * sample/gpm-xterm.c: Include whatever curses header we can find. - - * sample/rmev.c (main): Rewrite to use termios to set raw terminal - mode, not n?curses. - - * Makefile.in (top_builddir): Add top_builddir because it is now - mentioned in @LDFLAGS@. - - * configure.in (CPPFLAGS): Add top_srcdir to the include path. - (LDFLAGS): Add top_builddir to library path. - Add sample/Makefile to output files. - - * sample/configure.in: Simplified to use default autoconf behavior - where possible. - Only look for n?curses if we're building without gpm. - - * sample/Makefile.in: Rewrite to be able to act as slave for - toplevel. - - * doc/Makefile.in: Mostly rewritten to act as slave for toplevel - Makefile. - (mostlyclean): Instead of moving gpm.ps to a funny filename and - then back just to delete all the gpm.?? files, let's just rename - it permanently to gpmdoc.ps. Create a SECONDARY rule to avoid - re-TeXing after gpm.ps has been renamed. - - * configure.in (lispdir): Set as recommended by GNU standard. - - * Makefile.in (DIST): Fix typo (create-vcs => create_vcs). - (.SUFFIXES): Clear this before setting it. Magic suggested by the - Standards Info file. - (install): Add install-strip. - Added subdirectory recursion magic. - - * configure.in: Rewrite for new Makefile. - - * aclocal.m4: Delete useless stuff. - - * Makefile.in: Complete rewrite, now conforms to GNU standard. - - * libcurses.c: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * configure.in: Remove the curses argument, it's quite useless. - Check for the curses header in reasonable places. - - * README: Fix references to /usr/bin/gpm as gpm is now installed - in /usr/sbin. - Fix reference to /etc/gpm-root.conf as this file is now installed - in SYSCONFDIR (== /usr/etc by default). - - * gpm-root.y (SYSTEM_CFG): Place this in SYSCONFDIR not hardcoded - in /etc. - - * README: Fixed reference to debugging version. - -Wed Aug 26 18:47:16 1998 Ian T Zimmerman - - * aclocal.m4: Add ITZ_PROG_EMACS. - - * twiddler.h (TW_CUSTOM_FILE): These files now go to SYSCONFDIR - which is the GNUsically correct way. - - * configure.in: Use LIBS (GNU standard) not LDLIBS. - Add AC_REVISION. - Make srcdir an absolute path. - Figure out default prefix based on location of gcc. - Use AC_CHECK_TYPE to look for __u32. - Don't cache the values from command-line options. - (REL_MAJ): This and RELEASE shouldn't be cached either, as - Alessandro has discovered. - -Thu Aug 20 00:07:42 1998 Ian T Zimmerman - - * Makefile.in (all): Should now recurse into doc ... - - * doc/doc.gpm (Server Invocation): The server manpage should go to - section 8, not section 1. - (gpm-root): Fixed all references in the documentation to - /var/run/gpmctl to /dev/gpmctl. - - * doc/Makefile.in (install): Added this rule here instead of - installing directly from top make. Since I care about consistency - so much, I must have a little mind ... - (distclean): Don't directly rm doc/Makefile from top make, - instead recursively make distclean in doc subdirectory. - - * Makefile.in (distclean): Don't directly rm doc/Makefile here, - instead recursively make distclean in doc subdirectory. - -Wed Aug 19 13:01:00 1998 Ian T Zimmerman - - * gpm.c (processConn): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. - - * liblow.c (Gpm_Open): Added code to bind the client side of the - socket to the name of a temporary file. This is a quick and dirty - authentication scheme described in Stevens p. 504. Server side - hack to follow shortly. - - * Makefile.in (distclean): Have to clean doc/Makefile as well. - - * doc/doc.gpm (gpm-root): Argh, haven't understood that the - manpages are generated from the info source. Added description of - the options here. TODO: cross-references in manpages should be in - bold type. Someone has to hack doc/manpager to do that. - (Emacs Support): Deleted obsolete rubbish about t-mouse. - -Thu Aug 13 13:39:23 1998 Ian T Zimmerman - - * Makefile.in (install): gpm should go to /usr/sbin not /usr/bin. - - * configure.in: Enable libtinfo. - - * libcurses.c: Added weak definition of wgetch() that programs - which don't need the curses part of the library don't need to link - the whole libncurses (instead they can link with libtinfo). - - * gpm-root.y (main): restructured to use the new style logging exclusively. - - * gpm.c (main): moved file cleanup into an atexit hook. - - * gpn.c (cmdline): restructured to use the new style logging exclusively. - -Thu Jul 2 00:05:16 1998 Ian T Zimmerman - - * gpm-root.1: Add -D & -V to the options string. Add boldface to - man references. - Update pathname for /dev/gpmctl (should this be - done automatically?) - - * gpm.1: Described new -D & -V options. Added boldface to other - manpage references, to make them behave as hyperlinks where - software allows. - - * gpm-root.y (main): Add -D & -V to the options string. - - * configure.in: Fixed show-stopping problem of repeated calls to - AC_OUTPUT. - - * gpm-root.y: Replaced PERROR calls with gpm_debug_log. - (usage): Document new flags -D and -V, in analogy to gpm flags. - (cmdline): Implement the new options. - -Wed Jul 1 09:56:30 1998 Ian T Zimmerman - - * gpm-root.y: Replaced PDEBUGGGG calls with gpm_debug_log. - (PERROR): Remove. - - * gpm-root.y: Reindent. - - * debuglog.c (gpm_oops): Moved va_list declaration in front of - initialization statements (I hate C!). - - * gpm.c (processRequest): Fixed debug statement to look inside - passed Gpm_Cinfo structure. - - * tar.exclude: added sundry files created by configure. - - * Makefile.in (tar): changed tar flags to GNU style, otherwise - options get confused with filenames. If anybody tries to use this - rule with a non-GNU tar, good luck. Also added -9 flag to gzip - to squeeze that last byte :-) - - * special.c: Replaced PDEBUG invocations. - - * mouse-test.c (_oops): Delete, it is in the library now. - - * mice.c: Replaced PDEBUG invocations with gpm_debug_log. - Reindent. - - * libxtra.c: Reindent. - (Gpm_GetSnapshot): Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Replaced PDEBUG invocations with gpm_debug_log. - - * liblow.c: Reindent. - - * gpn.c (cmdline): replaced old oops invocations. - - * wd.h (gpm_oops): Add declaration. - - * gpmInt.h: remove declaration of _oops (see above). - - * debuglog.c (gpm_oops): Added as a replacement for _oops in gpn.c. - - * configure.in: check for syslog() as well - Added check for alloca(). - - * gpn.c: removed _oops; see above. - - * gpmInt.h (_oops): Changed signature of _oops - (oops): redefined accordingly - - * gpm.c: Removed a few leftover newlines in logging calls - - * gpn.c: Reindent, because it was so bad as to confuse my tools. - (usage): Added description of new options -D and -V. Used D - partly because it is mentioned in the string passed to getopt(), - but is actually unused. - (cmdline): Added -D and -V to the getopt() loop. - - * gpm.c: Replaced ugggly macros by calls to gpm_debug_log. - - * debuglog.c (gpm_debug_log): Print a trailing newline if using - stdio. - - * configure.in: Added generation of doc/Makefile - - * gpn.c: Removed the Log function (now done through debuglog.c) - - * gpmInt.h: Removed debug/log related declarations (now in - wd.h/debuglog.c) - - * gpmCfg.h: Removed CONFIG_GPM_LOG line. - - * gpm.h: Twiddled various pathnames, included paths.h - - * Makefile.in (tar): exclude the files mentioned in tar.exclude. - Create the archive in the current directory, not parent. - - * configure.in: Move doc/Makefile to doc/Makefile.in and make - configure generate doc/Makefile. Right now it doesn't substitute - anything, but it might one day, the new way is better conformant - with GNU distribution guidelines, and it makes it easier to create - clean tarballs. (There, a fine oxymoron.) - - * Makefile.in (LOBJS): Added debuglog.o - (TARGET): Likewise. - (depend dep): The preprocessor run needs $(CPPFLAGS). - (DEPEND DEP): Likewise. - (CPPFLAGS): Split from CFLAGS to correctly distribute flags to - compilation and preprocessor rules. - (.sh.o): needs CPPFLAGS. - ($(TARGET)): This needs LDFLAGS, not CFLAGS. - ($(TARGET).static): Likewise. - (mouse-test): Likewise. - - * tar.exclude: create - - * wd.h: Rewritten to refer to debuglog.c. - - * debuglog.c (gpm_debug_log): Prefixed globals with gpm_ as this - is going into the library. - (gpm_debug_log): Reversed level test. - (gpm_debug_level): 2 alternative definitions depending on DEBUG. - - * aclocal.m4 (DEFS): -DDEBUG should go into DEFS, not CFLAGS. - This would actually make a difference if we autogenerated header - dependencies. Which we do, but the make rule for it is - imprecise. See Makefile.in entry above. - Also, use AC_DEFINE instead of twiddling the flags by hand. - - * configure.in (DEFS): check for syslog.h and vsyslog(). - (DEFS): Moved definition of PREFIX here from Makefile.in. - - * debuglog.c (debug_log): created. - -Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr - -Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - - * mev.c (main): "-p" doesn't take an argument - -Sat Jul 4 14:40:09 1998 Dan Fandrich (danf@npsnet.com) - - * mice.c (I_serial): Send only "*X" to mman - -Mon Jun 15 21:31:35 1998 Pavel Machek (pavel@ucw.cz) - - ===> 1.14 released - * mice.c: added support for Genius NetMouse - -Sun May 10 11:12:46 1998 David Given (dg@tao.co.uk) - - * mice.c (M_js): joystick support - -Sun May 10 10:41:58 1998 Ian Zimmermann (itz@lanminds.com) - - * t-mouse.el: partial rewrite to enhance its workings - * mev.c: partial rewrite to fit t-mouse.el - -Tue Apr 21 18:24:52 1998 Holger Jakob (jakob@ph-cip.Uni-Koeln.DE) - - * mice.c: changed all (char) to (signed char), to suit ppc Linux - -Tue Jan 6 00:31:25 1998 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): -M forces -R (why didn't it?) - * Makefile.in (YACC): Use autoconf to assign YACC - -Mon Jan 5 14:48:23 1998 kw@dtek.chalmers.se (Kristian Wiklund) - - * mice.c (M_geni): new mouse type - -Mon Jan 5 00:53:57 1998 Alessandro Rubini (rubini@amelia) - - * twiddler.c: new file to support keyboard workings - * README.twiddler: documentation about the twiddler keyboard - * gpn.c (cmdline): opt_scale ("-r") is now limited to 100 - -Mon Dec 29 09:43:28 1997 (rubini@morgana) - - * mice.c (M_twid): new mouse type - * mice.c: removed the PROTO field - * kmouse.h: removed the file - -Thu Sep 11 21:43:27 1997 Jan Daciuk (jandac@pg.gda.pl) - - ===> 1.13 released - * t-mouse.el (t-mouse-tty): another possibility for ps - * gpm.h (GPM_XTERM_OFF): the string was buggy (James Troup) - * gpm-root.c (get_winsize): use tty0 not console - -Sun Sep 7 12:00:35 1997 Steve Bennett (s.bennett@lancaster.ac.uk) - - * mice.c: new type "-t ms3" for intellimouse devices. - -Sun Sep 7 12:00:35 1997 Alessandro Rubini (rubini@amelia) - - * gpn.c (cmdline): bugfix: accel allowed to be 1 - -Mon Sep 1 14:22:31 1997 (rubini@morgana) - - * mice.c: new type "-t pnp", supporting braindead ms devices. - -Sun Aug 31 18:28:01 1997 (rubini@morgana) - - * gpm-root.y (f_mktty): use /sbin/mingetty instead of agetty - -Fri Aug 29 08:11:32 1997 (rubini@morgana) - - * Makefile (configure): update ./configure when needed - -Fri Apr 11 10:19:18 1997 (rubini@morgana) - - * mev.c (main): Ctrl-C terminates the program - * doc/doc.gpm: revision of the docs. - -Tue Apr 8 17:06:06 1997 (Dave Flater: dave@universe.digex.net) - - * mice.c (M_ms): removed a typo in the disabled decoder - * FAQ: Marked the change in the decoder for ms-middle - -Tue Apr 8 16:57:17 1997 (Ian Zimmermann: itz@rahul.net) - - * gpm.c: fix to handle the whole stack of clients - * liblow.c (Gpm_Open): support for SIGTSTP - -Tue Apr 8 01:27:09 1997 (Thomas E. Dickey: dickey@clark.net) - - * aclocal.m4, configure.in: added support for autoconf - -Tue Apr 8 00:48:46 1997 (rubini@morgana) - - * doc/doc.gpm (Mouse Types): fixed the list - * gpmCfg.h (MAX_VC): raised from 32 to 64 (needed by some users) - * README: Added a check for "window-system" in the .emacs clause - -Tue Apr 8 00:35:33 1997 (Pavel Machek: pavel@Elf.mj.gts.cz) - - * mice.c (M_logimsc): new mode needed for some mice - -Tue Apr 8 00:13:30 1997 (Matthias Grimrath: y0001032@rzserv8.rz.tu-bs.de) - - * gpm.h: check for c++ inclusion - -Tue Apr 8 00:10:33 1997 (Stephen Tell: tell@cs.unc.edu) - - * mice.c (M_ps2): patch to support some strange devices - -Tue Aug 27 15:54:10 1996 (rubini@morgana) - - * gpmCfg.h (SELECT_TIME): increased, to avoid possible hd spinup. - -Fri Jul 26 12:33:39 1996 (rubini@morgana) - - ===> 1.10 released - * FAQ: new file - * doc/doc.gpm: provided docs about special commands - -Thu Jul 25 09:38:29 1996 (jrt@miel.demon.co.uk) - - * gpm-root.y (main): added a missing arg in a message - -Wed Jul 10 15:59:33 1996 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a fault when stdin not a tty (John Davis) - * mice.c (I_wacom): fixed initialization - described the fields of Gpm_Type, in order to easily add new types - * special.c: new file, based on an idea by Karsten Ballueder - * gpm.c (processMouse): use a different "repeater" (Markus) - -Sun May 5 22:01:48 1996 (rubini@morgana) - - ===> 1.09 released - * gpmCfg.h (DEF_GLIDEPOINT_TAP): changed to 0. The tapping code - for ps2 mice must be disabled for non glidepoint protocols. - -Tue Apr 23 14:05:43 1996 (rubini@morgana) - - ===> 1.08 released - * mice.c: support glidepoint ps2 mice (suggested by Don Schwarz) - -Mon Apr 22 15:20:05 1996 (rubini@morgana) - - * mice.c: added the wacom protocol - -Sun Apr 14 20:59:08 1996 (rubini@morgana) - - * t-mouse.el (t-mouse-tty): comply with procps-0.99 - -Sun Feb 11 01:05:07 1996 (rubini@morgana) - - * Makefile (MAN): libgpm.so.1 was installed. Fixed. - - * gpn.c: try to kill even if connection fails - (usage): removed the line about "-P" (dropped time ago) - (cmdline): added a missing "break": -o forced -p. - - * gpmInt.h: new globals: opt_kernel, opt_explicittype - - * gpn.c (cmdline): support for "-K" (kernel module) - -Fri Jan 12 00:31:40 1996 (Michael_Plass.PARC@xerox.com) - - * mice.c (M_ms): allow motion and button change in a single event - however, some mice won't work, so the code is still "#if 0" - -Tue Nov 14 14:18:26 1995 - - ===> 1.06 released, unexpectedly - * mouse-test.c: added missing variable to link with mice.c - (main): don't use absolute pointing devices as possible mice. - -Mon Nov 13 11:21:42 1995 (Marc Meis 100334.1426@compuserve.com) - - ===> 1.05 released - * gpmInt.h: added flag "absolute" to Gpm_Type to indicate - absolute pointing device - * mice.c: added NCR3125 pen support - * gpm.c: modified processMouse to support absolute pointing device - - -Sat Nov 11 11:40:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-run): fixed bug in linux-to-linux remote link. - * doc/doc.gpm (gpm-root): documented the need for /dev/vcso - * gpm-root.y (main): check for /dev/vcs0 before starting - Only run with /dev/vcs -- disregard kernels 1.1.73-92 - (scr_dump, scr_restore): if open(/dev/vcs) fails, write on syslog - - * gpm.c (processMouse): only one margin is active at a time. - -Fri Nov 10 22:37:45 1995 (rubini@morgana) - - * gpm.h (Gpm_FitEvent): bug fix: fit DRAG, not MOVE. - * gpm-root.y (main): only ctrl-move gets the default behaviour - -Fri Nov 09 20:33:26 1995 (lou@lounix4.conc.tdsnet.com) - - * mice.c (M_mman): added support for glidepoint mice (Lou Sortman) - -Wed Sep 27 09:51:17 1995 (rubini@morgana) - - ===> 1.04 released - * Makefile: added a dirty check for __u32 - -Wed Sep 26 01:31:13 1995 (rubini@morgana) - - * doc/doc.gpm: some fixes - * doc/gpmdoc.txt: new file: ascii for "less" readers. - -Sat Sep 23 08:44:01 1995 (rubini@merlino) - - * doc/doc.gpm: updated the lisp form to load t-mouse - * README: added instructions on compiling and installing - * Makefile: minor fixes - -Sun Sep 17 13:35:26 1995 (rubini@morgana) - - ===> 1.03 released - * doc/doc.gpm (Variables ): gpm_mx and gpm_my are documented. - * gpm.h (Gpm_FitEvent): this too was buggy, when dealing with motion. - * gpm.c (do_client): masked with GPM_BARE_EVENTS (long-standing bug) - (processMouse): removed GPM_SINGLE from motion events - * libxtra.c (Gpm_GetSnapshot): return 0 if the input queue is full - * mev.c (main): another fflush, I forgot about it. - * liblow.c (Gpm_Open): the fix of two days ago broke normal clients. - -Sat Sep 16 22:47:13 1995 (rubini@morgana) - - * gpn.c (cmdline): added a missing "break;" (-L) - -Fri Sep 15 09:40:59 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed a problem whit pty's (t-mouse broke) - -Thu Sep 14 01:50:23 1995 (rubini@morgana) - - ===> 1.02 released - * liblow.c (Gpm_Open): fixed a bug with multiple opens - * mev.c (user_handler): added fflush() 'cause didn't work with elf/lib5 - * gpmInt.h (inline): inhibit inlining when debugging - * Makefile (install): some fixes to make it work (Mark Shadley) - (static): new target (I've an old gdb :-( ) - * hltest.c (xhandler): fixed a problem with messages - * libhigh.c (Gpm_HandleRoi): fixed a segfault when no roi matches - * gpm.c (get_console_size): create a different resolution for x and y - (processMouse): return tiny motions (0,0) if some time has elapsed - * gpn.c (cmdline): introduced "-q". Obsoletes "-L". - * gpmCfg.h (SELECT_TIME): decuplicated time-out (10 minutes). - (MAX_VC): 32 virtual consoles - -Tue Sep 12 00:12:47 1995 (rubini@morgana) - - ===> 1.01 released - * Makefile: supports elf shlibs (Mark Shadley) - -Wed Sep 6 22:46:55 1995 (rubini@morgana) - - * mev.c (main): use current tty instead of /dev/console - * liblow.c (Gpm_Open): use /dev/ttyxx instead - of /dev/console (Pavel Kankovsky) - * gpn.c (cmdline): fixed "-o rts" - -Wed Jul 26 14:44:59 1995 Alessandro Rubini - - ===> 1.00 released - * doc/doc.gpm (Emacs Support): upgrade - * t-mouse.el: upgrade by Ian T Zimmerman - * gpm-root.y (cmdline): last bug fix: missing break in switch - -Wed Jul 26 00:38:51 1995 (rubini@morgana) - - * t-mouse.el: fixes and enhancements by Ian T Zimmerman - * Announce: new file. The announce for c.o.l.a. - * liblow.c (Gpm_Open): open console O_WRONLY instead of O_RDONLY - (Gpm_Getc): swapped two lines, to handle SIGWINCH in clients - - * doc/doc.gpm: final fix - -Tue Jul 25 00:41:44 1995 (rubini@morgana) - - * mouse-test.c: a new utility to "detect" your mouse type - -Mon Jul 24 15:52:11 1995 (rubini@morgana) - - * gpm.c (gpm_killed): removed spurious and annoying message - -Fri Jul 21 10:57:07 1995 (rubini@morgana) - - * libhigh.c (Gpm_HandleRoi): fixed a problem with gpm_visiblepointer - -Thu Jul 20 23:04:42 1995 (rubini@morgana) - - * gpn.c (cmdline): "-D" removed (use "-k" instead) - -Wed Jul 19 09:12:29 1995 (rubini@morgana) - - * gpm.c (processRequest): fixed nasty bug introduced with "-R" - * t-mouse.el (t-mouse-keymap): added double-drag and triple-drag - * gpm.c (processMouse): the GPM_SINGLE,GPM_DOUBLE and GPM_TRIPLE - flags are always delivered (as they should have always been). - * gpn.c (cmdline): removed the "-p" option (useless). - * doc/doc.gpm: Revised and updated. - * liblow.c (Gpm_Open): use the foreseeable device /dev/gmctl - * gpn.c (cmdline): no more symlink /tmp/gpmctl - * gpm-root.y (main): recursive menus definitely fixed - -Sat Jul 15 11:16:18 1995 (rubini@morgana) - - * various places: applied axp patches. - * libhigh.c: update, at last. - * hltest.c: new file, to test the high level library - -Mon Jul 10 20:03:46 1995 (rubini@morgana) - - * gpm-root.y (main): recursive menus - * gpm.c (main): chmod 777 /var/run/gpmctl (1.2.9 and later broke it) - * mice.c (M_mman): chord-middle detected - -Wed Jul 5 09:29:52 1995 (rubini@morgana) - - ===> 0.99 released - * doc/Makefile: minor cleanup - * doc/manpager: changed any "continue" to "next" - -Fri Jun 30 09:14:13 1995 (rubini@morgana) - - * gpm.c (wait_text): fixed interaction with X when non repeater. - -Wed May 31 09:17:55 1995 (rubini@morgana) - - ===> 0.98.3 released - * gpm.c (processMouse): fixed update of number of buttons - * doc/doc.gpm: minor fixes - * libxtra.c (Gpm_GetSnapshot): check if a connection is open - -Sun May 28 22:02:20 1995 (rubini@morgana) - - * gpm-root.y (main): reset gpm_tried after failure - -Tue May 16 10:28:01 1995 (rubini@morgana) - - * gpm.c: setuid(0) - * gpm-root.y: setuid(0) - -Tue Apr 25 18:02:03 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-make-event): fixed problem with split windows - -Sat Apr 22 13:19:50 1995 (rubini@morgana) - - * t-mouse.el: mouse-2 in Info-mode is handled - mouse-2 in dired-mode is handled - * gpm-root.y (main): added sleep() if Gpm_Open() fails - -Wed Apr 12 00:29:46 1995 (rubini@morgana) - - ===> 0.98.2 available - * mev.c (main): use the new library functions - * gpm.c (processRequest): added information retrivial - * liblow.c (Gpm_Open): try /tmp/gpmctl as well - * libxtra.c (Gpm_GetLibVersion): new function - (Gpm_GetServerVersion): new function - (Gpm_GetSnapshot): new function - * gpm-root.y (postmenu): use /dev/vcs and fine line-drawing chars - (main): change of semantic: use button-down to choose item. - (tableMod[]): use KG_SHIFT - (main): logging out is correctly managed (in /etc/utmp) - -Tue Apr 11 15:48:27 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-process-filter): catch errors in mev messages - * mice.c (I_serial): mouseMan fix (Stephen Lee) - (mice[]): added an information string and a synonym. - (M_listTypes): new function to give some help - * mev.c (user_handler): added "0x" in printf (ajohnson) - (tableMod[]): use keyboard.h instead of constant values. - * gpm-root.y: added missing ';'s (ajohnson@apanix.apana.org.au) - (postmenu): fixed "unsigned char" bug (johnvl@einstein.et.tudelft.nl) - * Makefile (install): fixed problems with info file - -Thu Apr 6 00:33:03 1995 (rubini@morgana) - - ===> 0.98.1 made available - * gpm.c gpn.c: read two mice at a time - * gpm-root.y (f_jptty): added ioctl(VT_WAITACTIVE) - (main): console disallocation is provided - -Wed Apr 5 08:03:37 1995 (rubini@morgana) - - * gpm.c (wait_text): only invoked if already graphics - (processMouse): be a repeater if we're in graphic mode - * gpn.c (check_uniqueness): fixed bug with "-k" and nobody to kill - * gpm-root.y (scr_dump): fixed bug with clr_selection and dump/restore - * wd.h: changed DEBUG(()) to PDEBUG(()) - -Tue Apr 4 08:56:33 1995 (rubini@morgana) - - * gpn.c (usage): changed semantics, to be more useful - -Sun Apr 2 13:20:28 1995 (rubini@merlino) - - * gpn.c (cmdline): device is opened with O_NDELAY - -Mon Mar 6 09:49:19 1995 (rubini@morgana) - - ===> 0.98 released - * Makefile (info): new target: no more info file from simple "make" - * gpn.c (loadlut): use octal codes and latin-1 chars (Andries Brouwer) - (cmdline): create a symlink /tmp/gpmctl to run precompiled executables - -Sat Mar 4 18:44:54 1995 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): use M-mouse to enable the scrollbar - -Tue Feb 28 00:20:35 1995 (rubini@morgana) - - * mev.c (main): added report of kdb modifiers for key events - * Makefile (clean): remove *.1, since they're not sources - * kernel/*: removed the directory as obsolete - * root.y (scr_dump): added support for /dev/vcs - -Sun Feb 26 14:25:31 1995 (rubini@morgana) - - * wd.h: when intactive use "" instead of "0" (to use "-Wall") - * various fixes to face "-Wall" messages - -Mon Feb 20 18:08:02 1995 (rubini@morgana) - - * liblow.c (Gpm_Open): bug fix, closed an open comment (John E. Davis) - -Wed Feb 15 12:25:14 1995 (rubini@morgana) - - * mev.c (sigHandler): propagate SIGWINCH to the father - * gpm.c (main): propagate SIGWINCH to the clients - * gpmInt.h: modified Gpm_Type; one more field to allow extra bytes - * mice.c (I_serial): changed prototype to autodetect mouseman - (M_mman): new mouse type for damned MouseMan. - -Tue Feb 14 00:33:34 1995 (rubini@morgana) - - * gpn.c (cmdline): modem-line toggle added - -Thu Feb 9 00:42:51 1995 (rubini@morgana) - - * root.y (main): the "-B" option is no longer supported - (scr_restore): be sensitive to SIGWINCH - -Wed Feb 8 11:46:52 1995 (rubini@morgana) - - * gpm.c (main): added support for SIGWINCH - -Thu Jan 26 12:11:59 1995 (rubini@morgana) - - ===> 0.97 released - * root.y (postmenu): get color to restore from the cursor cell instead - of the previous one (it failed with `less') - (yylex): allow double quotes in strings - (main): go to background - * gpn.c (cmdline): go to background and setsid() (Stefan) - (cmdline): new switch -k (kill) for busmouse users - * gpm.h (GPM_NODE_DIR): use "/var/run" instead of "/tmp" (Larry) - * Makefile: use "-O3" and don't release binaries any more - * mice.c (I_logi): don't jump to I_serial anymore (Larry) - -Fri Jan 13 12:57:41 1995 (rubini@morgana) - - ===> 0.97alpha releasd - * gpm.c (gpm_killed): use signal SIGUSR1 to kill an existent gpm - (main): removed the annoting warning in signal() - -Thu Jan 12 11:45:08 1995 (rubini@morgana) - - * mev.c: added "any" to event list - * t-mouse.el (t-mouse-suspend): fixed behaviour (thanks Larry) - * mice.c (I_serial): flushed pending input (thanks Miguel) - (I_logi): fixed "howmany" problem with serial vs. busmice - * gpn.c (cmdline): m_type is passed to m_type->init - * gpmInt.h: removed unused field "device" in Gpm_Type - -Mon Dec 26 01:21:54 1994 (rubini@morgana) - - * gpn.c (cmdline): authentication moved here. - -Wed Dec 21 11:28:41 1994 (rubini@morgana) - - * gpm.c (main): new (smarter) authentication - -Sun Dec 18 11:18:40 1994 (rubini@morgana) - - ===> gpm-0.96 released - * root.y: allright and tested - * gpn.c: new '-P' option - * doc/manpager: new file to generate man pages - * Makefile: fixed the installation stuff, use /usr as $(PREFIX). - * gpn.c, mice.c: removed the last #ifndef linux - * getopt.[ch]: removed from the distribution - -Fri Dec 16 17:09:19 1994 (rubini@morgana) - - * doc/doc.gpm: general update, addition of gpm-root docs. - -Thu Dec 1 01:03:51 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): fixed console detection (thanks Miguel) - and removed unused ttyp* and ttyq* recognition - -Fri Nov 25 01:37:37 1994 (rubini@morgana) - - * root.c (main): new file: a tentative default handler - * gpm.c (do_client): bug-fix: default handlers now can run - * gpm.h: new struct and prototypes for libhigh.c - * doc/doc.gpm: minor fixes - * libhigh.c: new file with "Region-of-Interest" management - -Fri Nov 25 01:24:45 1994 laurent@brasil.frmug.fr.net (Laurent Chemla) - - * gpm.c (processMouse): fix for button-up reporting - -Tue Nov 22 19:54:54 1994 (rubini@morgana) - - * gpm.c (do_selection): draw a running pointer or none at all - -Thu Nov 17 00:24:13 1994 (rubini@morgana) - - ===> gpm-0.93 released - * t-mouse.el (tm-scroll-jump): changed behaviour: doesn't jump - * doc/doc.gpm (Emacs Support): documented new word and line facilities - * liblow.c (gpm_convert_event): fix: use gpm_zerobased - (gpm_convert_event): fix: report all buttons on button-up - -Wed Nov 16 21:15:15 1994 (rubini@morgana) - - * t-mouse.el: tm-word and tm-line implemented - -Thu Nov 10 15:27:07 1994 (rubini@godipmec) - - ===> gpm-0.92 released - * gpmInt.h (Gpm_Type): new field "howmany" - * mice.c: fixed behaviour for "-t bm" (thanks to Reuben Sumner) - * gpm.c (getMouseData): fixed data reading - -Sun Nov 6 13:18:34 1994 (rubini@morgana) - - * removed all the outdated "#ifdef linux" - -Sat Nov 5 10:23:30 1994 (rubini@morgana) - - * Makefile (all): executables are stripped - -Tue Nov 1 13:10:48 1994 (rick@razorback.brisnet.org.au) - - * gpm.c (check_mode): fix in mouse re-openig - -Sun Oct 30 01:49:14 1994 Alessandro Rubini (rubini@coroide) - - ===> gpm-0.9 released - * doc/infofilter: fixed indentation of lisp code - -Sat Oct 29 17:24:54 1994 (rubini@morgana) - - * sample/configure.in: shows how to setup for both gpm and xterm - * sample/rmev.c: new file, to test xterm compatibility - * mev.c (usage): fixed ugly bug in printf() - (main): added initscr() to work under sunos-hpux - -Fri Oct 28 13:19:37 1994 (rubini@godipmec) - - * gpm-xterm.c, gpm-xterm.h: new files, for xterm applications - * mev.c (main): fixed ascii value reporting - -Thu Oct 27 01:56:13 1994 (rubini@morgana) - - * libcurses.c: xterm support is there as well - -Wed Oct 26 21:07:11 1994 (rubini@morgana) - - * liblow.c: xterm support is there - -Tue Oct 25 00:32:36 1994 (rubini@morgana) - - * libcurses.c (Gpm_Wgetch): new file, single function - - * gpm.h (Gpm_Getchar): removed a spurious "eject" string - -Mon Oct 24 22:47:37 1994 (rubini@morgana) - - * liblow.c (Gpm_Repeat): new function - (Gpm_Open): uses gpm_consolefd - * doc/doc.gpm: updated info, created indexes - -Sun Oct 16 11:36:07 1994 (rubini@morgana) - - ==> gpm-0.17 released - * gpm.c (processConn): give the client a motion event at connection - * t-mouse.el (t-mouse-run): added interactive to restart mouse - (t-mouse-tty): bug fix: the -.16 one won't work on most machines - -Thu Oct 13 09:48:07 1994 (rubini@morgana) - - ===> gpm-0.16 released - * gpm.c (main): a better check for uniqueness - (gpm_killed): a signal handler to remove /tmp/gpm* on exit - -Wed Oct 12 16:10:26 1994 (rubini@godipmec) - - * Makefile (all): the info file is generated - * t-mouse.el (t-mouse-tty): procps 0.95 is recognized - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - ===> gpm-0.15 released - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - * mev.c: new flag "-p" to show the pointer during drags - -Thu Sep 22 13:15:22 1994 Alessandro Rubini (rubini@ipvvis) - - ===> gpm-0.14 released - * doc/doc.gpm: fixed the section about emacs - -Fri Sep 23 12:26:37 1994 (rubini@morgana) - - * t-mouse.el (t-mouse-keymap): the scroll-bar is there. - -Mon Sep 19 01:06:56 1994 (rubini@morgana) - - * mev.c: new flag "-f" to fit events. - * Makefile (quickinst): new target - gpm.info is installed as well - (distrib): the precompiled binaries are distributed as well - * t-mouse.el: it is really full-featured, now. - -Sun Sep 18 11:44:36 1994 (rubini@morgana) - - * mev.c (emacs_handler): up events now return the press location - * Makefile: binaries are now released with the package - -Wed Sep 14 14:12:48 1994 (rubini@morgana) - - * t-mouse.el: removed free variables: clean compile - * Makefile: t-mouse.elc is properly compiled - * exec.el: used to compile elisp. - * doc/*: texinfo is used, and online docs are available - -Wed Sep 7 19:34:28 1994 (rubini@morgana) - - ===> gpm-0.13 released - * gpmCfg.h (MAX_VC): manage 16 virtual consoles - * t-mouse.el: avoid invoking awk on startup - * mev.c (cmdline): accept hex numbers with "-C" - -Sat Aug 27 11:41:57 1994 (rubini@morgana) - - * t-mouse.el: added the "-s" option to 'mev', to prevent error msg. - -Mon Aug 22 20:28:47 1994 (rubini@morgana) - - * liblow.c (Gpm_GetEvent): Closing connection correctly handled. - (Gpm_Close): fix to help the above handling - -Fri Aug 19 10:23:01 1994 (rubini@morgana) - - ===> gpm-0.12 released - * gpn.c (cmdline): new options: "-2" and "-3" - * doc/gpm.tex: (Emacs Support) new section - -Thu Aug 18 10:01:22 1994 (rubini@morgana.unipv.it) - - * gpm.c (do_selection): use right button to extend selection, - if the middle one is present - * t-mouse.el: recognizes the controlling terminal - * doc/gpm.tex (Compiling and Installing) note about rc.local - * gpm.c (processMouse): fix: first click is single - -Wed Aug 17 09:20:54 1994 (Olav Woelfelschneider) - - ===> gpm-0.11 released - * gpmInt.h: changed "char proto[]" to unsigned - -Tue Aug 2 05:26:55 1994 (rubini@morgana) - - ===> gpm-0.10 released - * liblow.c (Gpm_FitValuesM): bug fix - -Mon Aug 1 19:22:50 1994 (rubini@morgana) - - * gpn.c (cmdline): fixed bug with opt_device (Miguel de Icaza) - * liblow.c (Gpm_Close): fixed the gpm_tried bug - * gpm.c (processMouse): clustering added - (getMouseData): new function to ease readability - -Fri Jul 29 13:54:38 1994 (rubini@ipvvis) - - * gpn.c: moved many functions to gpm.c to make them inline - -Fri Jul 29 01:56:39 1994 (rubini@morgana) - - * gpm.h: Gpm_DrawPointer: new facility - * liblow.c: gpm_zerobased added - * gpn.c (do_client): added an option to map "drag" to "move" (ugly) - -Thu Jul 28 23:55:18 1994 (rubini@coroide) - - ===> gpm-0.06 released - * doc/gpm.tex: updated - -Thu Jul 28 11:02:48 1994 (rubini@morgana) - - * gpn.c (cmdline): configurable button order - (cmdline): double click time, too. - (cmdline): "-L" option. - (do_selection): fixed bug about wrap-around. - -Wed Jul 27 23:56:14 1994 (rubini@morgana) - - * liblow.c: no more public gpm_timeout - * gpn.c (do_client): bug fix - -Tue Jul 26 14:44:37 1994 (rubini@mimmo) - - * gpm.h: ctl file now in /tmp - -Sat Jul 23 13:22:29 1994 (rubini@morgana) - - * gpn.c (cmdline): /dev/mouse is the default - * gpm.c (processMouse): button-up: report which one - -Fri Jul 22 15:57:35 1994 (rubini@morgana) - - * mev.c: emacs syntax is there - -Wed Jul 20 19:35:16 1994 (rubini@morgana) - - * gpm.h: added GPM_HARD - * gpn.c (do_client): fixed default management. - -Tue Jul 19 16:31:23 1994 (rubini@morgana) - - * gpm.h: changed Gpm_Event to fit ptys - -Tue Jul 19 09:21:37 1994 (rubini@morgana) - - ===> gpm-0.04 released - * gpn.c (cmdline): use "/dev/mouse" as a second trial for the name - * gpm.c (processRequest): can override info - * mev.c (interact): new function to test stacking - -Mon Jul 18 11:44:13 1994 (rubini@morgana) - - * liblow.c (Gpm_Open): added stacking and an ugly goto - * gpn.c (_oops): fixed bug about errno (Steven S. Dick) - * doc/gpm.tex: fixed the terrible language, hopefully. - -Fri Jul 15 18:21:08 1994 (rubini@merlino) - - * mev.c: raw stdin added - -Tue Jul 12 16:57:45 1994 (rubini@ipvvis) - - ===> gpm-0.03 released - - -/* Local Variables: */ -/* tab-width:8 */ -/* End: */ - - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/MANIFEST b/software/gpm/browse_source/gpm-1.99.7/doc/old/MANIFEST deleted file mode 100644 index 0527ad29..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/MANIFEST +++ /dev/null @@ -1,147 +0,0 @@ - - This is the list of all the files included in the current - distribution tar ball. Actually, Makefile used this very list to - know what to include in the tar. Now we include everything - is still there after a 'make distclean' - - SOURCE FILES - ------------ - -src/ - gpm.c main engine of the daemon - gpn.c support functions - report.c message management (replaces debuglog.c) [inside gpm] - report-lib.c message management [inside the lib] - special.c special functions - mice.c support for (almost) all the pointer types - twiddler.c the twiddler keyboard needs special code - synaptics.c and the synaptics table too - - liblow.c low-level gpm library - libhigh.c high-level gpm library - libxtra.c optional and little-used library functions - libcurses.c curses-like functions - - mev.c sample mouse-event application - hltest.c sample use of the high-level gpm library - mouse-test.c old tool to help detecting the pointer protocol - disable-paste.c very short application to forget the current selection - gpm-root.y a sample default handler - gpm-root.c derived from the above using bison - - headers/ - gpm.h installed gpm header - gpmCfg.h default configuration - gpmInt.h internal declaration - gpm-proto.h proposal for a new protocol, currently unused - message.h messages - synaptics.h synaptics tablet implementation - twiddler.h twiddler keyboaard implementation - - config.h.in [build by autoheader] template for config.h - [build by ./configure] - - PATCHES - ------- - -patches/ - done/ applied/refused/too old patches - todo/ patches still need to be applied or refused - - - DEFAULT/SAMPLE CONFIGURATION FILES - ---------------------------------- - -conf/ - gpm-root.conf sample usesable by gpm-root - gpm-twiddler.conf default configuration for the twiddler keyboard - gpm-syn.conf default configuration for the synaptics touchpad - - - FILES USED IN THE BUILD PROCESS - ------------------------------- - -configure.in source for configure -configure script to autoconfigure the package -aclocal.m4 support declaration for configure.in -acconfig.h -Makefile.in the source for Makefile, used by configure -Makefile.include.in the source for Makefile.include, used by other Makefiles -install-sh fallback install script if no install command is found - - - DOCUMENTATION (currently not up-to-date) - --------------- - -README introductory information, and credits (incomplete list) -COPYING GNU GPL -Changelog the log of changes - a lot of changes :) -Changes Put together all important changes from one to another release -MANIFEST this file - -doc/ - Announce original announce for version 1.0 - Makefile.in template for doc/Makefile - - infofilter preprocessor to create a .texi source file from my own docs - manpager tool to extract manual pages from the main document file - mktxt tool to extract a ``decent'' text file from the info one - - # FAQ / READMEs - FAQ Frequently asked/answered questions - README.gunze how to use the gunze touchscreen - README.microtouch how to use the microtouch touch screen - README.synaptics how to use the synaptics tablet - README.twiddler how to use the twiddler keyboard - - doc.gpm.in template of gpm.doc (substitutes version) - doc.gpm the source for the ``real'' documentation - gpmdoc.ps generated from doc.gpm using doc/infofilter, texinfo and TeX - gpm.info generated from doc.gpm using doc/infofilter and makeinfo - gpmdoc.txt generated from gpm.info using doc/mktxt - - # MANPAGES - gpm.8 man page, generated from doc.gpm using doc/manpager - mev.1 man page, generated from doc.gpm using doc/manpager - gpm-root.1 man page, generated from doc.gpm using doc/manpager - gpm-types.7 man page, generated from doc.gpm using doc/manpager - mouse-test.1 man page, generated from doc.gpm using doc/manpager - - support/ contains information about mouse support - this includes mails and other information from the vendors. - - - SUPPORT MATERIAL (currently not installed) - --------------- - -contrib/ - Makefile.in when you read everything to here you should know what it is - - emacs/ - t-mouse.el emacs client (needs mev installed) - t-mouse.elc compiled form of the emacs client - exec.el allow emacs to execute lisp commands from the command line - - init/ - gpm.init sample init script (Redhat?) - - scripts/ - create_vcs script to create /dev/vcs* devices (redundant) - gunze-setup same, for the gunze touchscreen - microtouch-setup a program to calibrate the microtouch touchscreen - mkinstalldirs creates the installation directories (currently unused) - test_gpm test gpm. use it, to copy the gpmdir, ./configure,make - - other/ other contributions - - - SAMPLE GPM CLIENT [ currently not available/I don't know why :( ] - ----------------- - -sample/ - README explanation of how it works - Makefile.in sample template for Makefile - configure.in sample template for configure - gpm-xterm.c support file, replacement for libgpm - gpm-xterm.h header, replacement for gpm.h - rmev.c sample client application diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/README b/software/gpm/browse_source/gpm-1.99.7/doc/old/README deleted file mode 100644 index 8429b4d4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/README +++ /dev/null @@ -1,5 +0,0 @@ -These documents are here for historical reason. - -They are not maintained anymore. - -They may or may not contain false / outdated information. diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/README b/software/gpm/browse_source/gpm-1.99.7/doc/old/support/README deleted file mode 100644 index 376776c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains emails from/to companies, which were asked, if they -wanted to help support gpm. -This also includes the XFree project, perhaps sometime we can share mouse -support... diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/autodependencies b/software/gpm/browse_source/gpm-1.99.7/doc/old/support/autodependencies deleted file mode 100644 index 5924ac35..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/autodependencies +++ /dev/null @@ -1,2 +0,0 @@ -A nice manual thet helped me to integrate deps into gpm-1.99.5: -http://make.paulandlesley.org/autodep.html diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_1 b/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_1 deleted file mode 100644 index 3c6a00ad..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_1 +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Jesse. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -The information you are requesting is proprietary and not publicly available. Please visit our web site for all public information on our products. http://www.logitech.com/cf/index.cfm -Logitech does not currently support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Jesse -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/05/2002 11:42am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: mouse support - -Hello! - -I am the Linux gpm mouse maintainer and I would like to include -some more mouses from logitech into the support. -Gpm is the primary Linux mouse driver. For more information about -gpm visit freshmeat.net and search gpm. - -I only need some protocol specifications and possibly other informations -from you. - -Do you think we can corporate ? - -Thanks for you answer, - -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_2 b/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_2 deleted file mode 100644 index dd23c040..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_2 +++ /dev/null @@ -1,72 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Peggy. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -Following is all the information I was able to find on Linux and Logitech mice. I hope it will help you some. - -At this time, LINUX is not a supported operating system for Logitech pointing devices. Do not use the software which comes with the Logitech mouse. -Linux has Logitech drivers built in. Run either Linuxconf (for shell use) or XF86Config and tell it you're using a Logitech mouse. There are specific entries for serial, bus, and PS2 mice. Currently, the kernel does not support USB mice. -As a demand for this operating system increases, Logitech will consider implementing support for it in the future. Please visit our web site periodically for information on product announcements and releases. -Configuring 3 button support in Linux (X-Free): -In LINUX, you normally have only 2 button support, but it is possible to emulate a third button by pressing the left and the right button together (chording). This is a very uncomfortable solution. So, if a customer is asking for a nice solution, tell him following: -Edit the file: /usr/lib/X11/Xconfig -and try the following: -MouseMan "/dev/mouse" -Emulate3buttons -and then you have 3-button-support in LINUX -Configuring 3 button support in Linux ver.1.1.59: -The following information was entered in the configuration file for X11R6 found in the directory: /USR/X11R6/LIB/X11 -In this directory the user will find a config file called: XF86CONFIG -They need to change, or make sure the information in the "POINTER" section reads as follows: -Section "Pointer" -Protocol "MouseMan" -Device "/DEV/MOUSE" -EndSection -PROTOCOL specifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for PROTOCOL are: -BusMouse, Logitech, Microsoft, MMSeries, MouseMan, MouseSystems, PS/2 & MMHitTab -DEVICE specifies the device file where the mouse can be accessed. On most Linux systems, this is /DEV/MOUSE. /DEV/MOUSE is usually a link to the appropriate serial port (such as /DEV/CUA0) for serial mice, or the appropriate BusMouse device for BusMice. Just be sure the device file listed in DEVICE exists. -BaudRate and SampleRate are only for some Logitech mice. An example of these, which would be added under DEVICE line are: -BaudRate 9600 -SampleRate 150 - - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Peggy -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/11/2002 03:59am Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - -Hello Jesse! - -> The information you are requesting is proprietary and not publicly -available. Please visit our web site for all public information on our -products. http://www.logitech.com/cf/index.cfm -> Logitech does not currently support Linux. - -It would be nice for many logitech users to get mouse devices from -logitech to work under Linux. - -When you start sharing information or supporting Linux, please drop me -a line, so I can include the support into gpm and possibly later into X. - -Just one more question, why don't you release those information ? -What's the problem when the information are public available ? - -Thanks in advance, - -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_3 b/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_3 deleted file mode 100644 index b07d5a02..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/logitech_3 +++ /dev/null @@ -1,40 +0,0 @@ -Thank you for using Logitech's Electronic Technical Support. My name is Donald. The following information addresses your original question. You may wish to print this out and/or save this on your computer. - -We do not know when or if ever Logitech will support Linux. - -If you have additional technical questions regarding your product, please visit our web site at www.logitech.com and submit your question. - -Thank you for your interest in Logitech. - - -Regards, -Donald -Logitech Customer Support - ---- Original Message --- -From: Nico Schottelius -Received: 03/21/2002 12:11pm Eastern Standard Time -To: eShare - Logitech Customer Support -Subject: Re: mouse support - - -thanks for the information. but I am the gpm maintainer and I know all -that stuff. - -It would just be nice, if you tell me when logitech starts to support -linux, -so we can work together! - -Greetings, -Nico Schottelius - --- -Nico Schottelius - -Please send your messages pgp-signed or pgp-encrypted. -If you don't know what pgp is visit www.gnupg.org. -(public pgp key: ftp.schottelius.org/pub/familiy/nico/pgp-key) - ------- Please do not remove your unique tracking number! ------ -<<#140786-104335#>> - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/mouse-maintainer-XFree b/software/gpm/browse_source/gpm-1.99.7/doc/old/support/mouse-maintainer-XFree deleted file mode 100644 index fc0a512e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/mouse-maintainer-XFree +++ /dev/null @@ -1,24 +0,0 @@ -On Sun, Feb 17, 2002 at 10:46:48PM +0100, Nico Schottelius wrote: ->Hello David! -> ->As I am the current maintainer of gpm I found out that partly X can handle ->mouse protocols better and partly gpm. Why should we not join our work ? - -That sounds like a good idea. - ->For example the X I use cannot init ps2 correclty, if synps2 was taken before. ->gpm can (1.20.0 and later). ->Who is the mouse maintainer in X, who may I contact ? - -The maintainer was Kazutaka Yokota , -although I haven't heard from him ina while. - -I'm also interested in the mouse driver, so if you can't get in contact -with him, let me know. - -David --- -David Dawes -Release Engineer/Architect The XFree86 Project -www.XFree86.org/~dawes - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/mouse-maintainer-XFree.status b/software/gpm/browse_source/gpm-1.99.7/doc/old/support/mouse-maintainer-XFree.status deleted file mode 100644 index 9b7de197..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/old/support/mouse-maintainer-XFree.status +++ /dev/null @@ -1 +0,0 @@ -Didn't get any answer from . diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf b/software/gpm/browse_source/gpm-1.99.7/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf deleted file mode 100644 index 0431371e..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/doc/specs/synaptics/www.synaptics.com/decaf/utilities/511-000024-01a.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf b/software/gpm/browse_source/gpm-1.99.7/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf deleted file mode 100644 index 2883e59c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/doc/specs/synaptics/www.synaptics.com/decaf/utilities/ACF126.pdf and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/tests/1.99.2.2 b/software/gpm/browse_source/gpm-1.99.7/doc/tests/1.99.2.2 deleted file mode 100644 index cf8eec8b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/tests/1.99.2.2 +++ /dev/null @@ -1,2 +0,0 @@ -- gpm with mc test: - * click on items works: yes (using -m /dev/psaux -t ps2) diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.3 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.3 deleted file mode 100644 index e9230255..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.3 +++ /dev/null @@ -1,3 +0,0 @@ -- fixup major bugs in 1.20.1 -- add / fix release script to include configure again! -Codename: Eiche diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.6 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.6 deleted file mode 100644 index 30d7fbb9..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.6 +++ /dev/null @@ -1,8 +0,0 @@ -- fix Gpm_GetServerVersion -- remove all warnings -- use -Werror -W -Wall -- seperate "drivers" from the rest -- remove the unneeded typedefs -- seperate add daemon and library stuff cleanly -- split off gpm.c and gpn.c -- add report success diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.7 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.7 deleted file mode 100644 index 09ec71d1..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.20.7 +++ /dev/null @@ -1,2 +0,0 @@ -- cleanup protocol names -- cleanup autoconf diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.0 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.0 deleted file mode 100644 index 2d2948ec..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.0 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpm.c - -> finished, 20080220 diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.1 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.1 deleted file mode 100644 index 6bfb727e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.1 +++ /dev/null @@ -1,2 +0,0 @@ -- splittoff gpn.c and startup.c - => Done by 20080222 diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.10 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.10 deleted file mode 100644 index a1dd6f38..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.10 +++ /dev/null @@ -1,5 +0,0 @@ -- remove /Changes (obsolete) -- mice driver: - * load them dynamically - * do not require senseless header (all functions have the same type) - * add option to include some statically diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.11 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.11 deleted file mode 100644 index a89986c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.11 +++ /dev/null @@ -1,3 +0,0 @@ -- Double check multimouse support / begin gpm2 model - * Make sure, drivers do not reference parts from other drivers - Like etouch / gunze diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.12 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.12 deleted file mode 100644 index 1b2b7c62..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.12 +++ /dev/null @@ -1 +0,0 @@ -- remove all old FIXME entries diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.13 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.13 deleted file mode 100644 index 6c1b75d3..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.13 +++ /dev/null @@ -1,4 +0,0 @@ -- Remove Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) - and create - Gpm2_Type *I_exps2(struct gpm2_init *g2i); - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.14 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.14 deleted file mode 100644 index 016b4cb7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.14 +++ /dev/null @@ -1 +0,0 @@ -- Synaptics-cleaunp: splitoff the whole stuff and integrate it cleanly into gpm diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.15 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.15 deleted file mode 100644 index 9bcc75c3..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.15 +++ /dev/null @@ -1 +0,0 @@ -- we cleaned up synaptics, now comes twiddler diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.16 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.16 deleted file mode 100644 index 88812bf4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.16 +++ /dev/null @@ -1,6 +0,0 @@ -- Begin to design gpm2-client library - -- change Events for clients for gpm2: - - * allow 32 buttons (unsigned long int) - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.2 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.2 deleted file mode 100644 index 841c6162..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.2 +++ /dev/null @@ -1,2 +0,0 @@ -- begin splittoff of mice.c - -> begun diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.20 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.20 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.20 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.21 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.21 deleted file mode 100644 index 19726e9b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.21 +++ /dev/null @@ -1 +0,0 @@ -- finish main core for gpm2 diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.23 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.23 deleted file mode 100644 index 47be48f2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.23 +++ /dev/null @@ -1 +0,0 @@ -- freebsd release: check that gpm2 compiles and runs on fbsd diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.3 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.3 deleted file mode 100644 index 9ea392f7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.3 +++ /dev/null @@ -1 +0,0 @@ -- Apply Evabs-patch diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.4 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.4 deleted file mode 100644 index 06e5b6a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.4 +++ /dev/null @@ -1 +0,0 @@ -- finish splittoff of mice.c diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.5 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.5 deleted file mode 100644 index 1e335c65..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.5 +++ /dev/null @@ -1,6 +0,0 @@ -Done: -- use -Werror -W -Wall - -pipe, too? - - - diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.6 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.6 deleted file mode 100644 index 20d51bdc..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.6 +++ /dev/null @@ -1,9 +0,0 @@ -done: -- have a look at make dist: (in 1.20.3pre6 already) - - make release - - make test - always (build) -- cleanup autoconf stuff -- add commit to version, if git version is exiting: - git-show --abbrev-commit - -x git - -d .git diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.7 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.7 deleted file mode 100644 index 6378c6af..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.7 +++ /dev/null @@ -1,31 +0,0 @@ -critical: -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=470882 -http://bugs.gentoo.org/show_bug.cgi?id=219577 - -normal: - -- finish gpm2/doc/DESIGN -- fix checksum path (is .. currently) - -- fix dependencies...: *.d, *.P! -- check for rmev (1.19.6 or 1.17.8) -- try to implement n mice by usage of add_mouse -- add help for calib file in English -- add document, that describes on howto add a new driver - -- Fix open_console: serial check is missing -- write / find indent script to fixup source files - -- check for senseful use of global variables (gunze_calib, etouch - -> also in the library code - -gpm2: -- protocols: - GPM2_PROTOCOLS via cconf - wenn leer, dann ls mice/* -- version - via cconf! - - -done: -- Fixes: Remove glibc-hacks, where possible and posix conform: processConn diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.8 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.8 deleted file mode 100644 index 7bd46e55..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.8 +++ /dev/null @@ -1,6 +0,0 @@ -- double check that the os speficih code is in gpm2/os// - prefix os specific drivers with OS-name? - like linux event and joystick -- Fix Gpm_GetServerVersion and Gpm_GetLibVersion - -> Gpm_GetServerVersion: connect to server and ask - -> Gpm_GetLibVersion: use real library version diff --git a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.9 b/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.9 deleted file mode 100644 index 9787b875..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/doc/todo/1.99.9 +++ /dev/null @@ -1,4 +0,0 @@ -- cleanly design conf/ - add cc, ld, ..., create temporary files for cc/ld (like in cinit) -- splitoff twiddler.c -- remove most FIXME entries diff --git a/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-root.conf b/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-root.conf deleted file mode 100644 index ab9f16c8..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-root.conf +++ /dev/null @@ -1,85 +0,0 @@ -# sample configuration file for gpm-root -# edit it to please your taste.... - -button 1 { - name "ttys" - - "" f.nop - "login on a new tty" f.mktty - "" f.nop - "tty 1" f.jptty "1" - "tty 2" f.jptty "2" - "tty 3" f.jptty "3" - "tty 4" f.jptty "4" - "" f.nop - "tty 5" f.jptty "5" - "tty 6" f.jptty "6" - "tty 7" f.jptty "7" - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - "more of them..." { - "tty 17" f.jptty "17" - } - } - -} - -button 2 { - name "system status" - foreground red - background black - border yellow - head bright yellow - - "" f.nop - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop - "load: " f.load - "free:" f.free - "" f.nop - "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - "print mail headers to tty" f.bgcmd - "grep '^From ' /var/spool/mail/$USER | tail" -} - -button 3 { - name "far ttys" - - foreground black - background red - border bright yellow - head bright yellow - - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" - "tty 12" f.jptty "12" - "" f.nop - - "tty 13" f.jptty "13" - "tty 14" f.jptty "14" - "tty 15" f.jptty "15" - "tty 16" f.jptty "16" - "" f.nop - -# I use this to halt and reboot the system, but it isn't wise to put it -# in widely accessible boxes. -# -# "----" f.nop -# "" f.nop -# "halt" f.bgcmd "/sbin/shutdown -h now" -# "reboot" f.bgcmd "/sbin/shutdown -r now" -} diff --git a/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-syn.conf b/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-syn.conf deleted file mode 100644 index bba0ffef..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-syn.conf +++ /dev/null @@ -1,49 +0,0 @@ -/* enabling configuration parameters */ -[edge_motion_enabled] TRUE -[edge_motion_speed_enabled] TRUE -[corner_taps_enabled] TRUE -[tap_gesture_enabled] TRUE -[pressure_speed_enabled] TRUE -[tossing_enabled] TRUE -[does_toss_use_static_speed] TRUE -/* pressure induced speed related configuration parameters */ -[low_pressure] 60 -[speed_up_pressure] 60 -[pressure_factor] 0.10 -[standard_speed_factor] 0.10 -/* toss/catch related parameters */ -[min_toss_time] 100 -[max_toss_time] 300 -[prevent_toss_time] 300 -[min_toss_dist] 2 -[static_toss_speed] 70 -[toss_speed_factor] 0.5 -/* edge motion related configuration parameters */ -[edge_speed] 20 -/* corner tap actions */ -[upper_left_action] 0 (none) -[upper_right_action] 2 (middle) -[lower_left_action] 0 (none) -[lower_right_action] 3 (right) -/* wmode parameters */ -[wmode_enabled] TRUE -[drag_lock_enabled] FALSE -[finger_threshold] 30 -[tap_lower_limit] 5 -[tap_upper_limit] 200 -[tap_range] 100 -[tap_interval] 200 -[pads_tap_interval] 8 -[multiple_tap_delay] 30 -[palm_detect_enabled] TRUE -[palm_detect_level] 12 -[multi_finger_tap_enable] TRUE -[multi_finger_stop_enabled] TRUE -[multi_finger_stop_delay] 8 - /* Additional options */ -[touch_pad_enabled] TRUE -[stick_enabled] TRUE -[scrolling_enabled] TRUE -[scrolling_edge] 2 -[auto_scrolling_enabled] TRUE - diff --git a/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-twiddler.conf b/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-twiddler.conf deleted file mode 100644 index 85d0d402..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/example-configurations/gpm-twiddler.conf +++ /dev/null @@ -1,258 +0,0 @@ -# -# This is the configuration file for the twiddler keyboard as used under -# the gpm mouse server -# -# Empty lines and comments are ignored, other lines must follow either -# of the following conventions: -# chord = value (e.g. "L000 = a") -# mod chord = value (e.g. "Shift L000 = a") -# -# The "mod" is one of "Shift" "Numeric" "Function" "Control" "Ctrl" "Alt", -# or any abbreviation of those (case independent) -# The special case "Ctrl+Shift" (or "Shift+Ctrl") is supported, but note -# that it can't be abbreviated like C+S or anything like that. -# -# The "chord" value is one of the usual specifications, uppercase only -# -# Value can be a single byte (also as escape sequence), a string with -# double quotes (with escape sequences) or a special name (one of those -# appearing as "string" in dumpkeys, and Up Down Left Right). -# In addition, the strings "Console" and "Exec" are supported. See the -# sample case below. -# -# Escape sequences are \n \r \e \t \a \b, octal ("\243") or hex ("\xff") -# numbers. Any other char is returned unchanged, like \" or \\. - -######## Lowercase -R000 = a -0R00 = b -00R0 = c -000R = d -M000 = e -0M00 = f -00M0 = g -000M = h -LR00 = i -L0R0 = j -L00R = k -LM00 = l -L0M0 = m -L00M = n -LL00 = o -L0L0 = p -L00L = q -MR00 = r -M0R0 = s -M00R = t -MM00 = u -M0M0 = v -M00M = w -ML00 = x -M0L0 = y -M00L = z - -############## Uppercase -Shift R000 = A -Shift 0R00 = B -Shift 00R0 = C -Shift 000R = D -Shift M000 = E -Shift 0M00 = F -Shift 00M0 = G -Shift 000M = H -Shift LR00 = I -Shift L0R0 = J -Shift L00R = K -Shift LM00 = L -Shift L0M0 = M -Shift L00M = N -Shift LL00 = O -Shift L0L0 = P -Shift L00L = Q -Shift MR00 = R -Shift M0R0 = S -Shift M00R = T -Shift MM00 = U -Shift M0M0 = V -Shift M00M = W -Shift ML00 = X -Shift M0L0 = Y -Shift M00L = Z - -######## Control -Ctrl R000 = \x01 -Ctrl 0R00 = \x02 -Ctrl 00R0 = \x03 -Ctrl 000R = \x04 -Ctrl M000 = \x05 -Ctrl 0M00 = \x06 -Ctrl 00M0 = \x07 -Ctrl 000M = \x08 -Ctrl LR00 = \x09 -Ctrl L0R0 = \x0a -Ctrl L00R = \x0b -Ctrl LM00 = \x0c -Ctrl L0M0 = \x0d -Ctrl L00M = \x0e -Ctrl LL00 = \x0f -Ctrl L0L0 = \x10 -Ctrl L00L = \x11 -Ctrl MR00 = \x12 -Ctrl M0R0 = \x13 -Ctrl M00R = \x14 -Ctrl MM00 = \x15 -Ctrl M0M0 = \x16 -Ctrl M00M = \x17 -Ctrl ML00 = \x18 -Ctrl M0L0 = \x19 -Ctrl M00L = \x1a - -######## Meta (Alt) -Meta R000 = "\ea" -Meta 0R00 = "\eb" -Meta 00R0 = "\ec" -Meta 000R = "\ed" -Meta M000 = "\ee" -Meta 0M00 = "\ef" -Meta 00M0 = "\eg" -Meta 000M = "\eh" -Meta LR00 = "\ei" -Meta L0R0 = "\ej" -Meta L00R = "\ek" -Meta LM00 = "\el" -Meta L0M0 = "\em" -Meta L00M = "\en" -Meta LL00 = "\eo" -Meta L0L0 = "\ep" -Meta L00L = "\eq" -Meta MR00 = "\er" -Meta M0R0 = "\es" -Meta M00R = "\et" -Meta MM00 = "\eu" -Meta M0M0 = "\ev" -Meta M00M = "\ew" -Meta ML00 = "\ex" -Meta M0L0 = "\ey" -Meta M00L = "\ez" - -##### 1b is escape, etc... - - RRR0 = \x1b - -############### Numbers and symbols (ascii 0x20 to 0x40) - L000 = " " - R0L0 = ! - R0M0 = " - 0M0L = # - 0LR0 = $ - 00RM = % - 0L0L = & - RM00 = ' - 0LL0 = ( - 0RL0 = ) - 00LM = * - 00ML = + - R0R0 = , - R00L = - - RR00 = . - MMM0 = / -Num 0L00 = 0 -Num R000 = 1 -Num 0R00 = 2 -Num 00R0 = 3 -Num 000R = 4 -Num M000 = 5 -Num 0M00 = 6 -Num 00M0 = 7 -Num 000M = 8 -Num L000 = 9 - 00RL = : - R00R = ; -Num M00L = < - 00MR = = -Num R0R0 = > - RL00 = ? - 00LR = @ - -############## Other symbols (ascii 0x5b to 0x60 and 0x7b to 0x7f) - -Num RM00 = [ - LLL0 = \ -Num R00M = ] -Num LM00 = ^ - 0R0L = _ -Num R0L0 = ` - -Num R00L = { -Num LLR0 = | -Num LL0R = } -Num LLM0 = ~ - 0L00 = \x7f - 00L0 = \x08 - -############## In addition to ascii, here are the special keys - -# return, tab -000L = \x0a -MM0M = \x09 - -# arrows -0MR0 = Up -0ML0 = Down -0MM0 = Left -0M0M = Right - -# pageup/down -00RR = Prior -00LL = Next - -############## Functions -Fun R000 = F1 -Fun 0R00 = F2 -Fun 00R0 = F3 -Fun 000R = F4 -Fun M000 = F5 -Fun 0M00 = F6 -Fun 00M0 = F7 -Fun 000M = F8 -Fun L000 = F9 -Fun 0L00 = F10 -Fun 00L0 = F11 -Fun 000L = F12 - - -############## Console switching -Ctrl+Shift R000 = Console 1 -Ctrl+Shift 0R00 = Console 2 -Ctrl+Shift 00R0 = Console 3 -Ctrl+Shift 000R = Console 4 -Ctrl+Shift M000 = Console 5 -Ctrl+Shift 0M00 = Console 6 -Ctrl+Shift 00M0 = Console 7 -Ctrl+Shift 000M = Console 8 -Ctrl+Shift L000 = Console 9 -Ctrl+Shift 0L00 = Console 10 -Ctrl+Shift 00L0 = Console 11 -Ctrl+Shift 000L = Console 12 - -############## Executing commands (be careful: this is root) -# This is just an example: t for "time" and s for "space" -# The empty line is used to align text on console border - -F M00R = Exec echo > /dev/tty0; date > /dev/tty0 -F M0R0 = Exec echo > /dev/tty0; df > /dev/tty0 - -# you can put shutdown, reboot or anything here. - -############## Macros - -0RR0 = "the" -0RM0 = "of" -0R0R = "to" -0M0R = "ed" -R00M = "and" -0R0M = "in" -0L0M = "ion" -00MM = "ing" - -############## Add accented letters here below.... diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/TODO b/software/gpm/browse_source/gpm-1.99.7/gpm2/TODO deleted file mode 100644 index bc1b3a89..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- read cconfig-directory -- create mouse structures -- use cconfig-protocol-options as base for each protocol - char *fullpath? diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/client/README b/software/gpm/browse_source/gpm-1.99.7/gpm2/client/README deleted file mode 100644 index 7da4b230..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/client/README +++ /dev/null @@ -1,18 +0,0 @@ -The files in this directory should built up the client interface. - -Some ideas: - - struct gpm2_conn *gpm2_connect(): - client connects to gpm2-daemon - - gpm2_get_mice(struct gpm2_conn *g2c): - get list of devices, including protocols and ids - - struct *mouseinfo gpm2_open_mouse(int mouse_id, int type); - returns set of descriptors: - - to read mousedata - - int gpm2_close_mouse(struct *mouseinfo mi); - - - diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/README b/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/README deleted file mode 100644 index 788196a5..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/README +++ /dev/null @@ -1,11 +0,0 @@ -This is the conf/ directory Nico Schottelius uses to configure his -software projects. They evolve with every project and the aim is -to replace autoconf once. - -In general, the idea is to create extremly simply configuration files, -that are editable by non-interactive programs (distributor friendly). - -In most cases only the first line is important and the other lines are -simply the description. - - programs/ - contains definitions of programs we need in our built process diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/built-options/protocols b/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/built-options/protocols deleted file mode 100644 index 6857e18f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/built-options/protocols +++ /dev/null @@ -1,3 +0,0 @@ -ps2 - -List of protocols to enable (at built time: not expandable later). diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/built/ld b/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/built/ld deleted file mode 100644 index aa323fc7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/built/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The program used to link diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/cc b/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/cc deleted file mode 100644 index b168ae6c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/cc +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The c-compiler to use. diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/cc.params b/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/cc.params deleted file mode 100644 index 3e5f99a8..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/cc.params +++ /dev/null @@ -1,3 +0,0 @@ --pipe -W -Wall -Werror -I. -Iinclude -g - -flags to pass to the c-compiler. diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/ld b/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/ld deleted file mode 100644 index 7121e835..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/conf/programs/ld +++ /dev/null @@ -1,3 +0,0 @@ -gcc - -The linker to use. diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/core/main.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/core/main.c deleted file mode 100644 index 5ad87765..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/core/main.c +++ /dev/null @@ -1,51 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * main: Where life of gpm2 begins. - ********/ - -#include "gpm2-daemon.h" - -int main(int argc, char **argv) -{ - set_defaults(); - - if(!commandline(argc, argv)) - return 1; - - if(!read_config(opts.cconfig)) - return 1; - - /* - * creates a fork() - */ - if(!mice_handler()) - return 1; - - /* - * listen to messages: exits only on failure or shutdown - */ -// listen_ipc(); - -// shutdown_gpm2(); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/core/read_config.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/core/read_config.c deleted file mode 100644 index 275e3645..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/core/read_config.c +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read cconfig - ********/ - -#include "gpm2-daemon.h" - -int read_config(char *cconfig) -{ - /* - * open cconfig-dir (FIXME: write small framework for reuse) - */ - - if(!cconfig) - return 0; /* remove, just to make gcc happy */ - /* - * set options - */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/core/set_defaults.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/core/set_defaults.c deleted file mode 100644 index cf59ced2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/core/set_defaults.c +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * set the default options - ********/ - -#include "gpm2-daemon.h" - -void set_defaults() -{ - /* - * options - */ - opts.cconfig = GPM2_CCONFIG; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/daemon/README b/software/gpm/browse_source/gpm-1.99.7/gpm2/daemon/README deleted file mode 100644 index 37394952..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/daemon/README +++ /dev/null @@ -1 +0,0 @@ -Stuff, that is relevant for daemonizing only. diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/daemon/become_daemon.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/daemon/become_daemon.c deleted file mode 100644 index 86129635..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/daemon/become_daemon.c +++ /dev/null @@ -1,89 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007-2008 Nico Schottelius - * - * 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. - * - * - * Become a daemon - ********/ - -#include /* open */ -#include /* close/dup2 */ -#include /* perror */ - -#include "gpm2-messages.h" /* GPM2_MESS_* */ - -#define NULL_DEV "/dev/null" - -int become_daemon() -{ - int fd; - - /* - * fork - */ - switch (fork()) { - case -1: /* error */ - perror(GPM2_MESS_FORK); - return 0; - break; - case 0: /* child */ - break; - default: - _exit(0); /* parent */ - } - - /***************** child code ******************/ - - /* - * change fds - */ - fd = open(NULL_DEV, O_RDWR); - if(fd == -1) { - perror(GPM2_MESS_OPEN); - return 0; - } - - if(setsid() == -1) { - perror(GPM2_MESS_SETSID); - return 0; - } - if(chdir("/") == -1) { - perror(GPM2_MESS_CHDIR); - return 0; - } - - /* - * FIXME perhaps connect to syslog? - */ - if(dup2(fd, STDIN_FILENO) == -1 || - dup2(fd, STDOUT_FILENO) == -1 || dup2(fd, STDERR_FILENO) == -1) { - perror(GPM2_MESS_DUP2); - return 0; - } - - if(close(fd) == -1) { - /* - * makes no sense, as stderr is dead. use gpm2_report later - * perror(GPM2_MESS_CLOSE); - */ - return 0; - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/deps/gpm2-daemon b/software/gpm/browse_source/gpm-1.99.7/gpm2/deps/gpm2-daemon deleted file mode 100644 index 31e1fbe0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/deps/gpm2-daemon +++ /dev/null @@ -1,7 +0,0 @@ -core/main.o -core/read_config.o -core/set_defaults.o -generic/commandline.o -generic/daemon-usage.o -generic/mini_printf.o -mice/mice_handler.o diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/deps/gpm2-daemon-headers b/software/gpm/browse_source/gpm-1.99.7/gpm2/deps/gpm2-daemon-headers deleted file mode 100644 index d79ea816..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/deps/gpm2-daemon-headers +++ /dev/null @@ -1 +0,0 @@ -include/gpm2-daemon.h diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/API b/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/API deleted file mode 100644 index 3966fdc8..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/API +++ /dev/null @@ -1,20 +0,0 @@ -What to export how to the clients. - -Perhaps use doxygen for it? - -Currently just some ideas (based on gpm1 experience): - - -Functions ---------- - -- get_num_mice(): returns number of attached mice - - -Data / structures ------------------ - -gpm2_event -~~~~~~~~~~ - -- unsigned short mouse_number; /* which mouse reported the event */ diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/CONFIGURATION b/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/CONFIGURATION deleted file mode 100644 index 1ae0fe27..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/CONFIGURATION +++ /dev/null @@ -1,17 +0,0 @@ -Configuration: - /etc/gpm2/ - mice/ - default/ - mice-userid: userid of person reading/writing mice devices - mice-groupid: groupid of person reading/writing mice devices - - / - device: link or device to use - protocol: one line, containing protocol - userid: overwrites default/mice-userid - groupid: overwrites default/mice-groupid - options/: options for that protocol - - - - clients/ diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/DESIGN b/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/DESIGN deleted file mode 100644 index 5f759bf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/doc/DESIGN +++ /dev/null @@ -1,71 +0,0 @@ -Possible design of gpm2: - - gpm2-starter: - - reads configuration - - starts daemons - * first gpm2-daemon - - connects daemons - * connects them through stdin and stdout? - - perhaps a job of gpm2-daemon? - * stderr is relayed to the log console - - which can log to syslog - - gpm2-daemon: - - main daemon - - starts mice handlers - - listens for ipc - - relays input data abstracted to clients - - does *NOT* draw a cursor or something like that - - can be used by x.org (see below) - - opens mice devices? - - should be portable - - gpm2-io: - - gets list of opened fds or of devices - - uses poll() / select() on mice devices - - retrieves data packets - - forwards raw data packets to gpm2-daemon from devices - - either - - forwards raw data packets from gpm2-daemon to devices?? - - decodes mice packets: does protocol handling and - forwards decoded packages to gpm2_daemon - - has a mouse - fd_in - fd_out list - - has *NO* root priviliges - - gpm2-decode: - - forwards raw data packets from gpm2-daemon - - forwards decoded packages to clients (like gpm2-cdisplay) - - gpm2-raw-relay: - - reads data from gpm2-daemon - - writes raw data to clients - - a client needs to connect n times for n mice - - gpm2-cdisplay: - - Console DISPLAYS: displays mouse cursor on console - - reads input from gpm2-daemon - - reads mouse information - - perhaps os-specific versions - - gpm2-ccandp: - - Console Copy AND Paste daemon - - reads input from gpm2-daemon - - copies selected text into own buffer - - pastes buffer to console - - perhaps os-specific versions - - gpm2-xorg: - - interface between gpm2 and x.org - - could make mouse support unecessary in x.org - - should be portable - - gpm2-syslog: - - connects to the gpm2-daemon logging port - - reads messages - - relays them to syslog - - gpm2-log: needed? - - logging interface for gpm2-daemon - - recieves messages - - diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/commandline.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/commandline.c deleted file mode 100644 index c1a3ff0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/commandline.c +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle command line arguments - ********/ - -#include /* getopt() */ - -#include "gpm2-daemon.h" - -int commandline(int argc, char **argv) -{ - int opt; - - while((opt = getopt(argc, argv, GPM2_ARGS)) != -1) { - switch (opt) { - default: - usage(); - break; - } - - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/daemon-usage.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/daemon-usage.c deleted file mode 100644 index c08254d7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/daemon-usage.c +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Print out, how to use gpm2-daemon - ********/ - -#include "gpm2-generic.h" - -void usage() -{ - mini_printf("gpm2-daemon: written by Nico Schottelius\n", 1); - mini_printf("\n", 1); - mini_printf(" -c : specify configuration directory\n", 1); - mini_printf(" -f: fork into background after startup \n", 1); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/mini_printf.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/mini_printf.c deleted file mode 100644 index f5620b5a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/mini_printf.c +++ /dev/null @@ -1,29 +0,0 @@ - -/*********************************************************************** - * - * 2005-2007 Nico Schottelius (nico-cinit at schottelius.org) - * - * part of cLinux/cinit - * - * Print the world! - * - */ - -#include - -void mini_printf(char *str, int fd) -{ - char *p; - - /* - * don't get fooled by bad pointers - */ - if(str == NULL) - return; - - p = str; - while(*p) - p++; - - write(fd, str, (size_t) (p - str)); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/read_packet.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/read_packet.c deleted file mode 100644 index 2f0238a9..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/generic/read_packet.c +++ /dev/null @@ -1,47 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * read one mouse packet and return it - ********/ - -#include /* read() */ -#include /* NULL */ -#include /* malloc() */ -#include /* errno */ - -char *read_packet(int fd, int len) -{ - char *packet; - - errno = 0; /* no library function ever sets errno to 0, so - * we do */ - - packet = malloc(len); - if(packet == NULL) - return NULL; - - if(read(fd, &packet, len) == -1) { - free(packet); - return NULL; - } - - return packet; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-client.h b/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-client.h deleted file mode 100644 index b7857bca..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-client.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * client information - ********/ - -/* functions */ - - - - diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-config.h b/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-config.h deleted file mode 100644 index af6788c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * values shared by daemon and clients - ********/ - - diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-daemon.h b/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-daemon.h deleted file mode 100644 index 4d94470c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-daemon.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * daemon specific include file - ********/ - -#ifndef GPM2_DAEMON -#define GPM2_DAEMON - -/* parameters and options */ -#define GPM2_ARGS "c:f" -#define GPM2_CCONFIG "/etc/gpm2" - -struct gpm2_options { - char *cconfig; /* configuration directory */ -} opts; - -/* functions */ -int become_daemon(); -int commandline(int argc, char **argv); -int mice_handler(); -int read_config(char *cconfig); -void set_defaults(); -void usage(); - - -/* structs */ - -struct mouse { - /* pointer to init and decode functions */ - int (*open)(int fd); -}; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-data.h b/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-data.h deleted file mode 100644 index 64dafea7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-data.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -/* structs */ -struct gpm2_mouse { - char *name; - char *dev; - int fd; -}; - -struct gpm2_me { /* mouse element */ - struct gpm2_mouse mouse; - struct gpm2_me *next; - struct gpm2_me *prev; -}; - -struct gpm2_packet_raw() { /* raw mouse packets */ - char *data; - int len; -}; - -/* must contain everything a mouse can do */ -struct gpm2_packet() { /* decoded mouse packets */ - - int nr_buttons; - int *buttons; - - int pos_type; /* absolute or relativ */ -}; - -/* structure */ -struct gpm2_mic - -/* gpm2-daemon needs a list of mice, containing: - * - name of mouse - * - device used - * - filedescriptor - * - mouse configuration as found in cconfig - */ diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-generic.h b/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-generic.h deleted file mode 100644 index 3081130b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-generic.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * generic functions: used by daemon and clients - ********/ - -/* generic functions */ -void mini_printf(char *str,int fd); diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-io.h b/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-io.h deleted file mode 100644 index 8b7fc45a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-io.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * data definitions used by clients and daemon - ********/ - -#ifndef GPM2_IO_H -#define GPM2_IO_H - -char *read_packet(int fd, int len); /* needed? */ - - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-messages.h b/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-messages.h deleted file mode 100644 index 833e2754..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/include/gpm2-messages.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * Messages - ********/ - -#ifndef GPM2_MESSAGES -#define GPM2_MESSAGES - -#define GPM2_MESS_OPEN "open" -#define GPM2_MESS_FORK "fork" -#define GPM2_MESS_SETSID "setsid" -#define GPM2_MESS_CHDIR "chdir" -#define GPM2_MESS_DUP2 "dup2" - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/README b/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/README deleted file mode 100644 index d14013a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/README +++ /dev/null @@ -1,63 +0,0 @@ -This directory should contain the mice-protocol implementations. - -Each file (or if bigger: directory) implements one protocol. - -You have to create three functions: - - gpm2_open_(); - gpm2_handle_(); - gpm2_close_(); - -It's not yet clear, how to register protocols to gpm2. - -First idea of inclusion: - -- create deps/mouse- containging all dependencies -- conf/built-options/mice specifies which mice protocols to include -- a script generates include/gpm2-daemon-mice.h containg a struct-array - that looks like: - - struct mice_protos { - char *name; - int (*open)(); - int (*handle)(); - int (*open)(); - }; - --------------------------------------------------------------------------------- -More design ideas for using mice: - - - The gpm2_handle function gets a pointer to a char array containing the - data packet. - - The gpm2_handle function returns what the packet means - - gpm2_daemon may then decide what todo with this information - --------------------------------------------------------------------------------- -It would be nice to have a read_config_ that reads and verifies -the protocol specific options. - -For this, it would be nice to have a libcconfig() like this: - - struct cconfig_fd *cconfig_open(char *dir); - struct cconfig_tree *cconfig_read_tree(struct cconfig_fd *which); - - struct cconfig_element *cconfig_select_below(char *basepath, struct cconfig_fd *which, ...); - - The tree, cconfig_read_tree creates could consist of elements - of the following definition: - - struct cconfig_element { - char *path; - struct stat sbuf; - }; - --------------------------------------------------------------------------------- -gpm2_open_*: - - needs fd - - needs options - --------------------------------------------------------------------------------- -struct datapacket *gpm2_read_*(int fd) - - reads one packet - - returns it --------------------------------------------------------------------------------- diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/deps/ps2 b/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/deps/ps2 deleted file mode 100644 index 181c4e1b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/deps/ps2 +++ /dev/null @@ -1 +0,0 @@ -mice/ps2.o diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/init_mice_handler.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/init_mice_handler.c deleted file mode 100644 index 63694e38..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/init_mice_handler.c +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - -#include "gpm2-daemon.h" -#include "tmp/protocols.h" - -int init_mice_handler() -{ - /* - * open connections: pipes - */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/mice_handler.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/mice_handler.c deleted file mode 100644 index 85e07927..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/mice_handler.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle mice - ********/ - -/* unclean headers */ -#include -#include -#include -#include /* close */ - -#include "gpm2-daemon.h" -//#include "tmp/protocols.h" - -int mice_handler() -{ - - /* - * init_mice_handler(); open connections to gpm2_daemon: - one for each - * mouse: * raw channel (unidirectional) * decoded channel (unidirectional) - * * control channel (bidirectional) - */ - // init_mice_handler(); - - /* - * init_mice: - open mousedev - drop priviliges after that - */ - // init_mice(); - - // handle_mice(); /* forks and maintains mice */ - - /* - * dirty hack - */ - int ps2test = open("/dev/psaux", O_RDWR); - - // gpm2_open_ps2(ps2test); - // gpm2_decode_ps2(ps2test); - - close(ps2test); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/ps2.c b/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/ps2.c deleted file mode 100644 index b965f193..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/mice/ps2.c +++ /dev/null @@ -1,138 +0,0 @@ - -/* - * gpm2 - mouse driver for the console - * - * Copyright (c) 2007 Nico Schottelius - * - * 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. - * - * - * handle standard ps2 - ********/ - -#include /* usleep() */ -#include /* tcflush() */ -#include - -#include "gpm2-daemon.h" -#include "gpm2-generic.h" - -/* protocol handler stolen from gpm1/mice.c */ - -/* ps2 protocol description - * - * 3 Bytes per packet - * - * first bit of data[0]: Left Button - * second bit of data[0]: Right Button - * third bit of data[0]: Middle Button - * fourth bit of data[0]: Always 1 - * fifth bit of data[0]: X Sign - * sixth bit of data[0]: Y Sign - * seventh bit of data[0]: X Overflow - * eighth bit of data[0]: Y Overflow - * - * data[1]: X Movement - * data[2]: Y Movement - */ - -/* standard ps2 */ - -/* FIXME: implement error handling and options as described on - * http://www.computer-engineering.org/ps2mouse/ - */ -int gpm2_open_ps2(int fd) -{ - // static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; -// write(fd, s, sizeof (s)); - -// static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - char obuf, ibuf; - - /* - * FIXME: check return - */ - - obuf = 0xff; /* reset mouse */ - write(fd, &obuf, 1); - read(fd, &ibuf, 1); - printf("RX: %#hhx\n", ibuf); -// if(ibuf != 0xfa) return 0; - -// obuf = 0xf6; /* set mouse to default */ -// write(fd, &obuf, 1); -// read(fd,&ibuf,1); -// printf("DF: %#hhx\n",ibuf); - - obuf = 0xf2; /* device id */ - write(fd, &obuf, 1); - read(fd, &ibuf, 1); - printf("ST: %#hhx\n", ibuf); - read(fd, &ibuf, 1); - printf("DI: %#hhx\n", ibuf); - - /* - * set resolution: 0xe8 - */ - - // if(scaling = 2) { e7h - // - // 0xe6 scaling =1 - - /* - * do 0xf2, get device id and print it out - */ - /* - * do 0xe9 and print out values as status - */ - - /* - * FIXME: time correct? - */ - usleep(30000); - tcflush(fd, TCIFLUSH); - return 0; - -} - -/* returs gpm2-readable data */ -//int *gpm2_decode_ps2(char *data, struct mousedata *decoded) -int gpm2_decode_ps2(int fd) -{ - char data[3]; - - data[0] = 0; - data[1] = 0; - data[2] = 0; - - read(fd, data, 3); - - if(data[0] & 0x01) - mini_printf("left!\n", 1); - if(data[0] & 0x02) - mini_printf("right!\n", 1); - if(data[0] & 0x04) - mini_printf("middle!\n", 1); - - /* - * decoded->button_left = data[0] & 0x01; decoded->button_right = data[0] & - * 0x02; decoded->button_middle = data[0] & 0x04; - * - * decoded-> - */ - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/scripts/generate_cbuiltconfig.sh b/software/gpm/browse_source/gpm-1.99.7/gpm2/scripts/generate_cbuiltconfig.sh deleted file mode 100644 index e182f801..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/scripts/generate_cbuiltconfig.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-11 -# First script to generate built environment from -# a standard cconfig directory for building. - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -programs="programs" -progdir="$confdir/$programs" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -for tmp in "${progdir}"/*; do - prog="" - params="" - baseprog="$(basename "$tmp")" - destprog="$tmpdir/$baseprog" - - # ignore *.params, those are parameters, not programs - if [ "${tmp%.params}" != "${tmp}" ]; then - continue - fi - - # check for params - pfile="${tmp}.params" - if [ -f "$pfile" ]; then - params="$(head -n1 "$pfile")" - fi - - prog=$(head -n1 "$tmp") - - echo "Creating $destprog: $prog $params" - echo '#!/bin/sh' > "${destprog}" - echo "\"${prog}\" $params \"\$@\"" >> "${destprog}" - chmod 0700 "${destprog}" -done diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/scripts/include_protocols.sh b/software/gpm/browse_source/gpm-1.99.7/gpm2/scripts/include_protocols.sh deleted file mode 100644 index f731e9a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/scripts/include_protocols.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 2007-05-13 -# Create protocol related files - -[ "$#" -eq 1 ] || exit 23 - -set -e - -# args -confdir="$1" - -# paths below the configuration directory -builtopts="built-options" -builtoptsdir="$confdir/$builtopts" - -# paths directly in the srcdir -tmpdir="tmp" - -# -# generate built programs -# - -: > "${tmpdir}/protocols.h" - -for proto in $(head -n1 ${builtoptsdir}/protocols); do - echo "int gpm2_open_${proto}(int fd);" > "${tmpdir}/protocols.h" - echo "int gpm2_decode_${proto}(int fd);" >> "${tmpdir}/protocols.h" -done diff --git a/software/gpm/browse_source/gpm-1.99.7/gpm2/tmp.README b/software/gpm/browse_source/gpm-1.99.7/gpm2/tmp.README deleted file mode 100644 index 30214bfd..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/gpm2/tmp.README +++ /dev/null @@ -1 +0,0 @@ -Directory for temporarily created files. diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/README b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/README deleted file mode 100644 index 375088b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/README +++ /dev/null @@ -1 +0,0 @@ -patches applied after 1.20.1 diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/ceilf1 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/ceilf1 deleted file mode 100644 index 92d64a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/ceilf1 +++ /dev/null @@ -1,31 +0,0 @@ -http://ftp.frugalware.org/pub/other/people/alex/upstart-mess/source/base/gpm/gpm-1.20.1-ceilf-gcc4.patch - ---- gpm-1.20.1/src/Makefile.in.orig Sat Feb 1 17:15:55 2003 -+++ gpm-1.20.1/src/Makefile.in Sat Feb 1 17:23:43 2003 -@@ -70,6 +70,7 @@ - all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) - - gpm: $(GOBJ) -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - # construct dependings of sourcefiles and link sourcefiles - $(DEPFILE) dep: prog/gpm-root.c -@@ -139,13 +140,14 @@ - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - - # gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) --prog/gpm-root: prog/gpm-root.c -+prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< -- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: mice.o twiddler.o synaptics.o -+prog/mouse-test: prog/mouse-test.o mice.o twiddler.o synaptics.o -+ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - --$(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a -+$(PROG): lib/libgpm.so - - # Subdirectory lib/ - lib/libgpm.a: $(LOBJ) diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/001_logging.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/001_logging.patch deleted file mode 100644 index da42ac66..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/001_logging.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: b/src/report.c -=================================================================== ---- a/src/report.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/report.c 2008-02-25 06:55:31.000000000 +0200 -@@ -91,30 +91,33 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - break; - - case GPM_STAT_OOPS: -@@ -145,20 +148,21 @@ void gpm_report(int line, char *file, in - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); - vfprintf(console,text,ap); - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); --#endif -+#else - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); - vfprintf(console,text,ap); -@@ -172,6 +176,7 @@ void gpm_report(int line, char *file, in - fprintf(console,"\n"); - fclose(console); - } -+#endif - break; - - case GPM_STAT_OOPS: -Index: b/src/lib/report-lib.c -=================================================================== ---- a/src/lib/report-lib.c 2008-02-25 06:48:59.000000000 +0200 -+++ b/src/lib/report-lib.c 2008-02-25 06:55:31.000000000 +0200 -@@ -27,19 +27,30 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - char *string = NULL; -+ int log_level; - va_list ap; - va_start(ap,text); - - switch(stat) { -- case GPM_STAT_INFO : string = GPM_TEXT_INFO ; break; -- case GPM_STAT_WARN : string = GPM_TEXT_WARN ; break; -- case GPM_STAT_ERR : string = GPM_TEXT_ERR ; break; -- case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; break; -- case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; break; -+ case GPM_STAT_INFO : string = GPM_TEXT_INFO ; -+ log_level = LOG_INFO; break; -+ case GPM_STAT_WARN : string = GPM_TEXT_WARN ; -+ log_level = LOG_WARNING; break; -+ case GPM_STAT_ERR : string = GPM_TEXT_ERR ; -+ log_level = LOG_ERR; break; -+ case GPM_STAT_DEBUG: string = GPM_TEXT_DEBUG; -+ log_level = LOG_DEBUG; break; -+ case GPM_STAT_OOPS : string = GPM_TEXT_OOPS; -+ log_level = LOG_CRIT; break; - } -+#ifdef HAVE_VSYSLOG -+ syslog(log_level, string); -+ vsyslog(log_level, text, ap); -+#else - fprintf(stderr,"%s[%s(%d)]:\n",string,file,line); - vfprintf(stderr,text,ap); - fprintf(stderr,"\n"); -+#endif - - if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ - } -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:55:45.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:56:06.000000000 +0200 -@@ -198,8 +198,6 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -- - /*....................................... First of all, check xterm */ - - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/008_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/008_sun_repeat_000 deleted file mode 100644 index eeb9dfaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/008_sun_repeat_000 +++ /dev/null @@ -1,30 +0,0 @@ -Index: b/src/mice.c -=================================================================== ---- a/src/mice.c 2008-02-25 05:19:31.000000000 +0200 -+++ b/src/mice.c 2008-02-25 05:21:00.000000000 +0200 -@@ -515,6 +515,16 @@ static int M_sun(Gpm_Event *state, unsi - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2455,7 +2465,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, - {"sun", "For Sun (Sparc) mice.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"summa", "For a Summa/Genius tablet in absolute mode (906, 1212B, EasyPainter...)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/030_segfault b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/030_segfault deleted file mode 100644 index ba11c9c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/030_segfault +++ /dev/null @@ -1,18 +0,0 @@ -Index: b/src/lib/liblow.c -=================================================================== ---- a/src/lib/liblow.c 2008-02-25 06:17:55.000000000 +0200 -+++ b/src/lib/liblow.c 2008-02-25 06:18:24.000000000 +0200 -@@ -386,11 +386,11 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /*....................................... Error: free all memory */ - err: - gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! "); -- do { -+ while(gpm_stack) { - new=gpm_stack->next; - free(gpm_stack); - gpm_stack=new; -- } while(gpm_stack); -+ } - if (gpm_fd>=0) close(gpm_fd); - if (sock_name) { - unlink(sock_name); diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/outdated/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/outdated/002_force_repeat_000 deleted file mode 100644 index f58de336..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/outdated/002_force_repeat_000 +++ /dev/null @@ -1,80 +0,0 @@ -Index: b/src/headers/message.h -=================================================================== ---- a/src/headers/message.h 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/headers/message.h 2008-02-17 22:40:43.000000000 +0200 -@@ -92,6 +92,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ -+ " -F Always force repeat mode.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ -Index: b/src/daemon/gpm.c -=================================================================== ---- a/src/daemon/gpm.c 2008-02-16 16:14:40.000000000 +0200 -+++ b/src/daemon/gpm.c 2008-02-17 22:40:43.000000000 +0200 -@@ -330,7 +330,8 @@ static inline char *getMouseData(int fd, - if((i=m_type->packetlen-howmany)) /* still to get */ - do { - j = read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || option.force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i -= j; - } while (i && j); -@@ -445,7 +446,7 @@ static inline int processMouse(int fd, G - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) { -+ if (kd_mode!=KD_TEXT || option.force_repeat) { - if (fifofd != -1 && ! opt_rawrep) { - if (m_type->absolute) { /* hof Wed Feb 3 21:43:28 MET 1999 */ - /* prepare the values from a absolute device for repeater mode */ -@@ -997,7 +998,7 @@ int old_main() - if (ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS,GPM_MESS_IOCTL_KDGETMODE); - close(fd); -- if(kd_mode != KD_TEXT && !option.repeater) { -+ if(kd_mode != KD_TEXT && !option.repeater && !option.force_repeat) { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); - readySet=connSet; -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-17 22:39:31.000000000 +0200 -+++ b/src/gpn.c 2008-02-17 22:40:43.000000000 +0200 -@@ -234,7 +234,7 @@ struct Gpm_Type *find_mouse_by_name(char - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -262,6 +262,10 @@ void cmdline(int argc, char **argv) - if (option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'F': option.repeater++; option.force_repeat = 1; -+ if (option.repeater_type == 0) -+ option.repeater_type = "msc"; -+ break; - case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); - gpm_report(GPM_PR_DEBUG,"options: %s",optarg); - opt_options = optarg; break; /* GO AWAY */ -Index: b/src/headers/daemon.h -=================================================================== ---- a/src/headers/daemon.h 2008-02-17 22:42:33.000000000 +0200 -+++ b/src/headers/daemon.h 2008-02-17 22:42:56.000000000 +0200 -@@ -27,6 +27,7 @@ - - struct options { - int autodetect; /* -u [aUtodetect..'A' is not available] */ -+ int force_repeat; /* force click repeat */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/reject/001_missing_V_option.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/reject/001_missing_V_option.patch deleted file mode 100644 index cb2ed153..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/debian/reject/001_missing_V_option.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: b/src/gpn.c -=================================================================== ---- a/src/gpn.c 2008-02-25 05:18:28.000000000 +0200 -+++ b/src/gpn.c 2008-02-25 05:19:23.000000000 +0200 -@@ -283,6 +283,7 @@ void cmdline(int argc, char **argv) - case 'u': option.autodetect = 1; break; - case 'T': opt_test++; break; - case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); -+ case 'V': /* Compat code */ break; - case '2': opt_three = -1; break; - case '3': opt_three = 1; break; - default: exit(usage("commandline")); diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/esr-manpage1 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/esr-manpage1 deleted file mode 100644 index 714213de..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/esr-manpage1 +++ /dev/null @@ -1,47 +0,0 @@ -From: esr@thyrsus.com -To: rubini@gnu.org -Subject: problems in gpm-types.7 -Date: Sat, 20 Nov 2004 23:02:13 -0500 -> -This is automatically generated email about problems in a man page for which -you appear to be responsible. If you are not the right person or list, tell -me and I will attempt to correct my database. - -See http://catb.org/~esr/doclifter/problems.html for details on how and -why these patches were generated. Feel free to email me with any questions. -Note: These patches do not change the mod date of any manual page. You -may wish to do that by hand. - -Problems with gpm-types.7: - -My records indicate that you have accepted this patch, so this is just -a reminder. Please try to get a release with the patch incorporated -to the Fedora folks in time for Fedora Core 4. - -1. Missing or garbled name section. The most common form of garbling -is a missing - or extra -. Or your manual page may have been generated -by a tool that doesn't emit a NAME section as it should. These -problems make it impossible to lift the page to DocBook. They -can also confuse some implementations of man -k. - ---- gpm-types.7 2003-02-16 19:50:16.000000000 -0500 -+++ gpm-types.7 2003-02-16 19:51:06.000000000 -0500 -@@ -1,8 +1,7 @@ - .TH GPM-TYPES 7 "July 2000" - .UC 4 - .SH NAME --This manual page describes what pointer types (mice, tablets, --etc) are currently managed by gpm. -+gpm-types \- pointer types (mice, tablets, etc.) managed by gpm. - .br - The information below is extracted from the texinfo file, which is the - preferred source of information. ------------------------------ - --- - Eric S. Raymond -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/jaroslav-liblow.diff b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/jaroslav-liblow.diff deleted file mode 100644 index 86b835c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/jaroslav-liblow.diff +++ /dev/null @@ -1,13 +0,0 @@ -*** liblow.old Wed Sep 27 21:59:54 2006 ---- liblow.c Wed Sep 27 21:59:59 2006 -*************** -*** 258,263 **** ---- 258,265 ---- - goto err; - } - /* do we really need this check ? */ -+ if(option.consolename==NULL) goto err; -+ if(tty==NULL) goto err; - if(strncmp(tty,option.consolename,strlen(option.consolename)-1) - || !isdigit(tty[strlen(option.consolename)-1])) { - gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed"); diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/luc-gpm_etouch.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/luc-gpm_etouch.patch deleted file mode 100644 index 2bb1769e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/luc-gpm_etouch.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff -Naur gpm-1.20.1_old/doc/README.etouch gpm-1.20.1/doc/README.etouch ---- gpm-1.20.1_old/doc/README.etouch Thu Jan 1 01:00:00 1970 -+++ gpm-1.20.1/doc/README.etouch Tue Nov 22 10:43:06 2005 -@@ -0,0 +1,52 @@ -+ -+This file tells how to use gpm and X with a Elotouch screen with -+serial interface at 9600 Baud No parity. -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done in console mode using the program "elocalib" -+available from http://www.dobit.com/emblin/pub/elocalib.tgz -+See also elocalib --help -+To start calibration at console 128x48, for screen 1024x786 -+> elocalib /dev/ttyS0 -c128 -r48 -w1024 -h768 -+ -+Touch the upper-left corner and write down the coordinates Xmin, Ymin -+Touch the bottom-right corner and write down the coordinates Xmax, Ymax -+Update the file gpm-calibration with this coordinates -+ -+> cat /usr/local/etc/gpm-calibration -+# EloTouch calibration coordinates Xmin Ymin Xmax Ymax -+4010 80 80 4010 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+> gpm -m /dev/ttyS0 -t etouch -o clickontouch -Rsumma -+ -+ -+ X OPERATION -+ ----------- -+ -+In order to use the touchscreen in X, you should install in your -+system the "gpmsumma" module -+available from http://www.annet.pl/~anowak/mtouch/gpmsumma_drv.o -+ or from http://www.dobit.com/emblin/pub/gpm_etouch.tgz -+ -+/usr/lib/X11/modules/input/gpmsumma_drv.o -+ -+ -+Then add the following sections to your XF86config: -+ -+Section "InputDevice" -+ Identifier "EloTouch" -+ Driver "gpmsumma" -+ Option "Device" "/dev/gpmdata" -+ Option "SendCoreEvents" "On" -+EndSection -+ -+Section "ServerLayout" -+ InputDevice "EloTouch" "SendCoreEvents" -+ ... -+EndSection -diff -Naur gpm-1.20.1_old/src/headers/message.h gpm-1.20.1/src/headers/message.h ---- gpm-1.20.1_old/src/headers/message.h Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/headers/message.h Fri Nov 18 11:47:28 2005 -@@ -192,7 +192,7 @@ - #define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" - #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" - #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -- -+#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - - /* warnings */ - #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -diff -Naur gpm-1.20.1_old/src/mice.c gpm-1.20.1/src/mice.c ---- gpm-1.20.1_old/src/mice.c Tue Dec 24 23:57:16 2002 -+++ gpm-1.20.1/src/mice.c Tue Nov 22 10:42:22 2005 -@@ -1391,6 +1391,88 @@ - #undef DIF_TIME - } - -+/* -+ * This decoder is copied and adapted from the above mtouch. -+ */ -+static int elo_click_ontouch = 0; /* the bigger the smoother */ -+static int M_etouch(Gpm_Event *state, unsigned char *data) -+{ /* -+ * This is a simple decoder for the EloTouch touch screen devices. -+ * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 -+ * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) -+ * s=status bit 0=init touch 1=stream touch 2=release -+ */ -+#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch -+ else first Move then Touch*/ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ -+ #define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -+ #define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ -+ if (data[2]&0x04) /* FINGER UP - Release */ -+ { upx = avgx; /* ignore this x, y */ -+ upy = avgy; /* store Finger UP possition */ -+ GET_TIME(uptv); /* set time for the next finger-down */ -+ tv.tv_sec = 0; /* NO DRAG */ -+ avgx=-1; /* FINGER IS UP */ -+ state->buttons = 0; -+ return 0; -+ } -+ -+ /* NOW WE HAVe FINGER DOWN */ -+ x = data[3] | (data[4]<<8); x&=0xfff; -+ y = data[5] | (data[6]<<8); x&=0xfff; -+ x = REALPOS_MAX * (x - gunze_calib[0])/(gunze_calib[2]-gunze_calib[0]); -+ y = REALPOS_MAX * (y - gunze_calib[1])/(gunze_calib[3]-gunze_calib[1]); -+ if (x<0) x = 0; if (x > REALPOS_MAX) x = REALPOS_MAX; -+ if (y<0) y = 0; if (y > REALPOS_MAX) y = REALPOS_MAX; -+ -+ if (avgx < 0) /* INITIAL TOUCH, FINGER WAS UP */ -+ { GET_TIME(tv); -+ state->buttons = 0; -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { /* if Initial Touch immediate after finger UP then start DRAG */ -+ x=upx; y=upy; /* A:start DRAG at finger-UP position */ -+ if (elo_click_ontouch==0) state->buttons = GPM_B_LEFT; -+ } -+ else /* 1:MOVE to Initial Touch position */ -+ { upx=x; upy=y; /* store position of Initial Touch into upx, upy */ -+ if (elo_click_ontouch==0) tv.tv_sec=0; /* no DRAG */ -+ } -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ } /* endof INITIAL TOUCH */ -+ -+ -+ state->buttons = 0; /* Motion event */ -+ if (tv.tv_sec) /* draging or elo_click_ontouch */ -+ { state->buttons = GPM_B_LEFT; -+ if (elo_click_ontouch) -+ { x=avgx=upx; /* 2:BUTTON PRESS at Initial Touch position */ -+ y=avgy=upy; -+ tv.tv_sec=0; /* so next time 3:MOVE again until Finger UP*/ -+ } /* else B:continue DRAG to current possition */ -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ return 0; -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ -+ - /* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - /* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - /* workstations */ -@@ -2123,6 +2205,61 @@ - return type; - } - -+ -+/* simple initialization for the elo touchscreen */ -+static Gpm_Type *I_etouch(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ struct termios tty; -+ FILE *f; -+ char s[80]; -+ int i, calibok = 0; -+ -+ /* Calibration config file (copied from I_gunze, below :) */ -+ #define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" -+ /* accept a few options */ -+ static argv_helper optioninfo[] = { -+ {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value: !0}, -+ {"", ARGV_END} -+ }; -+ parse_argv(optioninfo, argc, argv); -+ -+ /* Set speed to 9600bps (copied from I_summa, above :) */ -+ tcgetattr(fd, &tty); -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = B9600|CS8|CREAD|CLOCAL|HUPCL; -+ tcsetattr(fd, TCSAFLUSH, &tty); -+ -+ /* retrieve calibration, if not existent, use defaults (uncalib) */ -+ f = fopen(ELO_CALIBRATION_FILE, "r"); -+ if (f) { -+ fgets(s, 80, f); /* discard the comment */ -+ if (fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib+1, -+ gunze_calib+2, gunze_calib+3) == 4) -+ calibok = 1; -+ /* Hmm... check */ -+ for (i=0; i<4; i++) -+ if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; -+ if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ fclose(f); -+ } -+ if (!calibok) { -+ gpm_report(GPM_PR_ERR,GPM_MESS_ELO_CALIBRATE, option.progname, ELO_CALIBRATION_FILE); -+ /* "%s: etouch: calibration file %s absent or invalid, using defaults" */ -+ gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ -+ gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ -+ } -+ return type; -+} -+ -+ -+ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static Gpm_Type *I_wp(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) -@@ -2239,6 +2376,9 @@ - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {"etouch", "EloTouch touch-screens (only button-1 events, by now)", -+ "", M_etouch, I_etouch, STD_FLG, -+ {0xFF, 0x55, 0xFF, 0x54}, 7, 1, 0, 1, NULL}, - #ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/lucas-03-broken_dev.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/lucas-03-broken_dev.patch deleted file mode 100644 index 1053053e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/lucas-03-broken_dev.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.20.1/src/lib/liblow.c.orig 2006-03-07 12:06:59.000000000 -0300 -+++ gpm-1.20.1/src/lib/liblow.c 2006-03-07 12:09:30.000000000 -0300 -@@ -217,6 +217,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag - /* check whether we know what name the console is: what's with the lib??? */ - if(checked_con == 0) { - option.consolename = Gpm_get_console(); -+ if (!option.console) { -+ gpm_report(GPM_PR_ERR,"unable to open gpm console, check your /dev filesystem!\n"); -+ goto err; -+ } - checked_con++; - } - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-destdir b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-destdir deleted file mode 100644 index 4347e656..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-destdir +++ /dev/null @@ -1,21 +0,0 @@ -Makefile.include.in utilizes DESTDIR, but it currently doesnt do anything with -it :) - -here's a small change where the behavior is to set ROOT equal to DESTDIR only -if the user hasnt specified ROOT via cmdline - ---- Makefile.include.in -+++ Makefile.include.in -@@ -7,3 +7,5 @@ - ROOT = --DESTDIR = $(ROOT) -+ifndef ROOT -+ROOT = $(DESTDIR) -+endif - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-gunze1 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-gunze1 deleted file mode 100644 index cc260a3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-gunze1 +++ /dev/null @@ -1,23 +0,0 @@ -this one is from Fedora ... - -gunze_calib is declared as int[4], so referring to idx #4 is -obviously a bad idea :) - ---- gpm-1.20.1/src/mice.c -+++ gpm-1.20.1/src/mice.c -@@ -2112,7 +2112,7 @@ - for (i=0; i<4; i++) - if (gunze_calib[i] & ~1023) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-parallel-build b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-parallel-build deleted file mode 100644 index 473a51aa..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-parallel-build +++ /dev/null @@ -1,77 +0,0 @@ -if you try to build with `make -j` it'll break for two reasons ... - -(1) the toplevel makefile's all target depends on 'dep' and 'do-all' ... if -you build this in parallel on a fast machine, 'do-all' will start executing -before 'dep' has finished processing, causing the build to fail. here's the -small fix for that (i indented the 'done' to match the rest of the shell -code): - ---- Makefile.in -+++ Makefile.in -@@ -25,3 +25,3 @@ - --all: dep do-all -+all: do-all - -@@ -61,3 +61,3 @@ - # do-all goes to all subdirectories and does all --do-%: -+do-%: dep - @target=`echo $@ | $(SED) -e 's/^do-//'`; \ -@@ -69,3 +69,3 @@ - fi; \ --done -+ done - - -(2) the doc subdir's all target depends on $(MANPAGES). the $(MANPAGES) rule -executes a for loop on all the $(MANPAGES). the problem is that make will -fork 5 children (1 per manpge) and try to execute the $(MANPAGES) target and -each child will stomp the work of the others. the fix is to put all the -manpages under one target ('gpm.man') and have all depend on that instead of -$(MANPAGES). also, i moved the 'all' to the top so that way it's the default -target when you run just `make`. - ---- doc/Makefile.in -+++ doc/Makefile.in -@@ -32,6 +32,8 @@ - - MANPAGES = gpm.8 mev.1 gpm-root.1 gpm-types.7 mouse-test.1 - -+all: $(srcdir)/gpm.info gpm.man -+ - # HTML (texi2html) - %.html: %.texinfo - if [ $(TEXI2HTML) != "no" ]; then $(TEXI2HTML) $< ;fi -@@ -55,13 +57,13 @@ - $(AWK) -f $(srcdir)/mktxt $< > $@ - - # MAN (-) --$(MANPAGES): doc.gpm $(srcdir)/manpager -+gpm.man: doc.gpm $(srcdir)/manpager - $(AWK) -f $(srcdir)/manpager doc.gpm - for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ - expand $$i | sed s/^'[ ]*'//g > $$i.new; \ - mv $$i.new $$i; \ - done; -- -+ touch gpm.man - - # DVI - # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -@@ -97,8 +99,6 @@ - - # Main portion - --all: $(srcdir)/gpm.info $(MANPAGES) -- - # why gpmdoc.ps and gpm.ps?? - # there is no gpm.ps in my tree and no rule to generate gpm.ps. - gpmdoc.ps: gpm.ps - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-sed1 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-sed1 deleted file mode 100644 index c6faf643..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-sed1 +++ /dev/null @@ -1,16 +0,0 @@ -our ppc64 team hit a snag with gpm and linux headers based on 2.6 kernel: - -http://bugs.gentoo.org/show_bug.cgi?id=66222 - -simple fix is to change the second '*' glob to a '+': -- $(SED) 's/^\(.*\)\.o\([ :]*\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done -+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done - -this hasnt caused any known regressions on any other arch that has tested gpm -in Gentoo (alpha/amd64/arm/hppa/ia64/mips/ppc/ppc64/sparc/x86) --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-serialconabort b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-serialconabort deleted file mode 100644 index 7e99f3d6..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-serialconabort +++ /dev/null @@ -1,47 +0,0 @@ -here's a patch which detects & aborts if gpm is run on a serial console - ---- src/headers/message.h -+++ src/headers/message.h -@@ -125,2 +125,3 @@ - #define GPM_MESS_OPEN_CON "Opening console failed." -+#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." - #define GPM_MESS_READ_FIRST "Error in read()ing first: %s" - ---- ./src/gpm.c.org Sat Feb 23 16:42:23 2002 -+++ ./src/gpm.c Tue Mar 12 00:20:19 2002 -@@ -38,2 +38,3 @@ - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ -@@ -178,8 +154,21 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(option.consolename, mode)) < 0) -- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(option.consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (si.line > 0) -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); -+ } -+ } - return fd; -+ } else -+ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON); - } - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-setgid1 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-setgid1 deleted file mode 100644 index 44fee9bc..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/mike-setgid1 +++ /dev/null @@ -1,25 +0,0 @@ -here's a small patch to make sure setgid/setuid actually worked - ---- src/prog/gpm-root.y -+++ src/prog/gpm-root.y -@@ -433,9 +433,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); - --mike -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/nico-consolename1 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/nico-consolename1 deleted file mode 100644 index eb1f4e38..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/nico-consolename1 +++ /dev/null @@ -1,33 +0,0 @@ -well, I noticed that my vim caught a segfault in the linux console -everytime it called Gpm_Open() a second time. - -I've tracked down this problem to the initialization of the option -variable in Gpm_Open(). It's initialized to NULL everytime Gpm_Open() is -called, but to the value of Gpm_get_console() only the first time. -Also this variable is declared extern but included from a header file, too. -It works for me now, with the patch below. - -Nico Huber - -PS. I'm not subscribed to this list, so please CC me when replying. - ---- liblow.c.orig 2005-01-28 05:18:35.000000000 +0100 -+++ liblow.c 2005-01-28 05:19:58.000000000 +0100 -@@ -193,5 +193,4 @@ - char *term = NULL; - int i; -- extern struct options option; - static int checked_con = 0; - struct sockaddr_un addr; -@@ -200,6 +199,4 @@ - char* sock_name = 0; - -- option.consolename = NULL; -- - gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt deleted file mode 100644 index 707b19be..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/rodney-wheel-patch-1.99.2.1.txt +++ /dev/null @@ -1,138 +0,0 @@ -diff -aurp gpm-1.99.2.1-orig/src/daemon/processmouse.c gpm-1.99.2.1/src/daemon/processmouse.c ---- gpm-1.99.2.1-orig/src/daemon/processmouse.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/daemon/processmouse.c 2008-03-14 21:30:32.000000000 +1100 -@@ -159,7 +159,11 @@ int processMouse(int fd, Gpm_Event *even - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ /* rodney 13/mar/2008 wheel movement similar to mouse movement -+ * must also be excluded from time (click) processing */ -+ if (!event->dx && !event->dy -+ && !event->wdx && !event->wdy -+ && (event->buttons==oldB) ) - do { /* so to break */ - static long awaketime; - /* -diff -aurp gpm-1.99.2.1-orig/src/headers/daemon.h gpm-1.99.2.1/src/headers/daemon.h ---- gpm-1.99.2.1-orig/src/headers/daemon.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/daemon.h 2008-03-14 21:36:17.000000000 +1100 -@@ -60,8 +60,10 @@ typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -+ /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - -+ /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - -diff -aurp gpm-1.99.2.1-orig/src/headers/gpm.h gpm-1.99.2.1/src/headers/gpm.h ---- gpm-1.99.2.1-orig/src/headers/gpm.h 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/headers/gpm.h 2008-03-14 21:32:49.000000000 +1100 -@@ -70,6 +70,17 @@ extern "C" { - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" - - /*....................................... Cfg buttons */ -+/* Each button has one bit in the 16 bit buttons field. -+ * Mouse movement and wheel movement are not associated with a button -+ * i.e. buttons=GPM_B_NONE in these cases -+ * (except for ms3 mouse, for reasons unknown?) -+ * The middle button if pressed down (or clicked) is independent of -+ * the wheel "device" which it happens to be associated with -+ * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel -+ * could be rolled forward then backward -+ * and this would generate a 'click' event on 'button 5' GPM_B_UP, -+ * but really the expected behaviour of wheel is movement, typically -+ * used for jump scrolling or for jumping between fields on a form. */ - - #define GPM_B_DOWN 32 - #define GPM_B_UP 16 -@@ -124,10 +135,17 @@ enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, G - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, x, y; /* displacement x,y for this event, and absolute x,y */ - enum Gpm_Etype type; -+ /* clicks e.g. double click are determined by time-based processing */ - int clicks; - enum Gpm_Margin margin; -+ /* wdx/y: displacement of wheels in this event. Absolute values are not -+ * required, because wheel movement is typically used for scrolling -+ * or selecting fields, not for cursor positioning. The application -+ * can determine when the end of file or form is reached, and not -+ * go any further. -+ * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - } Gpm_Event; - -diff -aurp gpm-1.99.2.1-orig/src/lib/liblow.c gpm-1.99.2.1/src/lib/liblow.c ---- gpm-1.99.2.1-orig/src/lib/liblow.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/lib/liblow.c 2008-03-14 21:44:12.000000000 +1100 -@@ -198,7 +198,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - char* sock_name = 0; - static char *consolename = NULL; - -- gpm_report(GPM_PR_DEBUG,"VC: %d",flag); -+ // gpm_report(GPM_PR_DEBUG,"VC: %d",flag); - - /*....................................... First of all, check xterm */ - -diff -aurp gpm-1.99.2.1-orig/src/mice.c gpm-1.99.2.1/src/mice.c ---- gpm-1.99.2.1-orig/src/mice.c 2008-02-23 06:05:03.000000000 +1100 -+++ gpm-1.99.2.1/src/mice.c 2008-03-14 21:39:42.000000000 +1100 -@@ -552,9 +552,10 @@ static int R_imps2(Gpm_Event *state, int - (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; -- buffer[3] = -- (state->buttons & GPM_B_UP ? -1 : 0) + -- (state->buttons & GPM_B_DOWN ? 1 : 0); -+ if (state->wdy > 0) buffer[3] = 0xff; -+ if (state->wdy < 0) buffer[3] = 0x01; -+ if (state->wdx > 0) buffer[3] = 0xfe; -+ if (state->wdx < 0) buffer[3] = 0x02; - - return write(fd,buffer,4); - -@@ -651,20 +652,25 @@ static int M_imps2(Gpm_Event *state, un - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* The wheels.. */ -- switch (data[3] & 0x0f) { -- case 0x0e: state->wdx = +1; break; -- case 0x02: state->wdx = -1; break; -- case 0x0f: state->wdy = +1; break; -- case 0x01: state->wdy = -1; break; -+ unsigned char wheel = data[3] & 0x0f; -+ if (wheel > 0) { -+ // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement -+ // to avoid single/double/triple click processing: -+ switch (wheel) { -+ /* rodney 13/mar/2008 -+ * The use of GPM_B_UP / GPM_B_DOWN is very unclear; -+ * only mouse type ms3 uses these -+ * For this mouse, we only support the relative movement -+ * i.e. no button is set (same as mouse movement), wdy changes +/- -+ * according to wheel movement (+ for rolling away from user) -+ * wdx (horizontal scroll) is for a second wheel. They do exist! */ -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ } - } -- -- /* old code: -- - did it signed: -- state->buttons |= (data[3]<0) * GPM_B_UP + (data[3]>0) * GPM_B_DOWN; -- - and unsigned: -- state->buttons |= (data[3]>127) * GPM_B_UP + (data[3]<127) * GPM_B_DOWN; -- */ -- -+ - return 0; - - } diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 deleted file mode 100644 index d1541ba3..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/samuel-liblow-patch-gpm-1.20.3 +++ /dev/null @@ -1,21 +0,0 @@ ---- gpm-1.20.3~pre3/src/lib/liblow.c.orig 2008-03-21 19:48:29.000000000 +0000 -+++ gpm-1.20.3~pre3/src/lib/liblow.c 2008-03-21 19:49:00.000000000 +0000 -@@ -249,7 +249,7 @@ - gpm_report(GPM_PR_OOPS,GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename)-1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); -- } else { /* use your current vc */ -+ } else if (flag==0) { /* use your current vc */ - if (isatty(0)) tty = ttyname(0); /* stdin */ - if (!tty && isatty(1)) tty = ttyname(1); /* stdout */ - if (!tty && isatty(2)) tty = ttyname(2); /* stderr */ -@@ -259,7 +259,8 @@ - } - - conn->vc=atoi(&tty[strlen(consolename)-1]); -- } -+ } else /* a default handler -- use console */ -+ tty=strdup(consolename); - - if (gpm_consolefd == -1) - if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) { diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch deleted file mode 100644 index f16f063c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/thomas-0001-Avoid-reusing-of-va_list.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 1d829d74e667262300a942b70ae0965578c86854 Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:33:40 +0200 -Subject: [PATCH] Avoid reusing of va_list - -This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=246219 -(gpm uses variable argument lists incorrectly) - -Signed-off-by: Tomas Janousek ---- - src/report.c | 33 +++++++++++++++++++++++---------- - 1 files changed, 23 insertions(+), 10 deletions(-) - -diff --git a/src/report.c b/src/report.c -index 9bfb9d9..80be414 100644 ---- a/src/report.c -+++ b/src/report.c -@@ -72,9 +72,16 @@ - void gpm_report(int line, char *file, int stat, char *text, ... ) - { - FILE *console = NULL; -- va_list ap; -+ va_list ap, ap3; -+#ifdef HAVE_VSYSLOG -+ va_list ap2; -+#endif - - va_start(ap,text); -+ va_copy(ap3, ap); -+#ifdef HAVE_VSYSLOG -+ va_copy(ap2, ap); -+#endif - - switch(option.run_status) { - /******************** STARTUP *****************/ -@@ -83,7 +90,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - fprintf(stderr,GPM_STRING_INFO); - vfprintf(stderr,text,ap); -@@ -93,7 +100,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - fprintf(stderr,GPM_STRING_WARN); - vfprintf(stderr,text,ap); -@@ -103,7 +110,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_ERR); - vfprintf(stderr,text,ap); -@@ -113,7 +120,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -130,14 +137,14 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_INFO: - #ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); -- vsyslog(LOG_INFO | LOG_USER, text, ap); -+ vsyslog(LOG_INFO | LOG_USER, text, ap2); - #endif - break; - - case GPM_STAT_WARN: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); -- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); -+ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_WARN); -@@ -150,7 +157,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_ERR: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -@@ -161,7 +168,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - if((console = fopen(option.consolename,"a")) != NULL) { - fprintf(console,GPM_STRING_ERR); -- vfprintf(console,text,ap); -+ vfprintf(console,text,ap3); - fprintf(console,"\n"); - fclose(console); - } -@@ -170,7 +177,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - case GPM_STAT_OOPS: - #ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); -- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); -+ vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); - #endif - fprintf(stderr,GPM_STRING_OOPS); - vfprintf(stderr,text,ap); -@@ -208,6 +215,12 @@ void gpm_report(int line, char *file, int stat, char *text, ... ) - - break; - } /* switch for current modus */ -+ -+ va_end(ap); -+ va_end(ap3); -+#ifdef HAVE_VSYSLOG -+ va_end(ap2); -+#endif - } /* gpm_report */ - - --- -1.5.2.2 - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch deleted file mode 100644 index 3af8049a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.20.1/thomas-0002-Replace-OPEN_MAX-with-sysconf-_SC_OPEN_MAX.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8d9d39bf4733590730170644d39e11a1e754795b Mon Sep 17 00:00:00 2001 -From: Tomas Janousek -Date: Wed, 25 Jul 2007 11:38:27 +0200 -Subject: [PATCH] Replace OPEN_MAX with sysconf(_SC_OPEN_MAX) - -The OPEN_MAX constant was removed in Linux 2.6.23 -(commit 77293034696e3e0b6c8b8fc1f96be091104b3d2b) -and sysconf is the POSIX way to do it. - -Signed-off-by: Tomas Janousek ---- - src/prog/gpm-root.y | 4 +++- - src/special.c | 4 +++- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index 2be902f..7910ce6 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; -diff --git a/src/special.c b/src/special.c -index 7fad664..ecb2d16 100644 ---- a/src/special.c -+++ b/src/special.c -@@ -157,7 +157,9 @@ int processSpecial(Gpm_Event *event) - open(GPM_NULL_DEV,O_RDONLY); /* stdin */ - open(option.consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i -To: spida //at\\ spida.net -Subject: gpm-calib.conf -Hi Timo! - -Das Dateiformat sieht wie folgt aus: - -ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max - -wobei alle e* die Reichweite der Koordinaten angeben, die aus dem -Event-Interface kommen und alle r* die Bilschirmkoordinaten sind, auf -die abgebildet wird. Alle Werte werden nur von Leerzeichen getrennt. -Das eGalax gibt über das Event-Interface ungefähr Werte zwischen 0 und -2000 für beide Achsen aus. Die Bildschirmkoordinaten sollten immer auf 0 -beim Minimum und auf der Bildschirmauflösung minus 1 beim Maximum -stehen. Für Textmodi entspricht die Auflösung der Textauflösung. Bei -Framebuffer-Konsolen kann ich es nicht mit Sicherheit sagen. - -Für 800x600 auf dem eGalax sollte die Datei also ungefähr so aussehen: - -50 1950 50 1950 0 799 0 599 - -Gruß, Micha. diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.3/gpm-evabs.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.3/gpm-evabs.patch deleted file mode 100644 index da23b490..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.3/gpm-evabs.patch +++ /dev/null @@ -1,327 +0,0 @@ -diff -ur gpm-1.99.2.2/src/daemon/cmdline.c gpm-1.99.2.2-patched/src/daemon/cmdline.c ---- gpm-1.99.2.2/src/daemon/cmdline.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/cmdline.c 2008-03-25 22:59:16.000000000 +0100 -@@ -32,7 +32,7 @@ - void cmdline(int argc, char **argv) - { - extern struct options option; -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; -+ char options[]="a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TuvV::23"; - int opt; - - /* initialize for the dual mouse */ -@@ -47,6 +47,7 @@ - opt_age_limit = atoi(optarg); break; - case 'b': (which_mouse->opt_baud) = atoi(optarg); break; - case 'B': (which_mouse->opt_sequence) = optarg; break; -+ case 'c': (which_mouse->opt_calib) = optarg; break; - case 'd': (which_mouse->opt_delta) = atoi(optarg); break; - case 'D': option.run_status = GPM_RUN_DEBUG; break; - case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg); break; -diff -ur gpm-1.99.2.2/src/daemon/gpm.c gpm-1.99.2.2-patched/src/daemon/gpm.c ---- gpm-1.99.2.2/src/daemon/gpm.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/gpm.c 2008-03-25 21:14:32.000000000 +0100 -@@ -73,9 +73,11 @@ - - struct mouse_features mouse_table[3] = { - { -- DEF_TYPE, DEF_DEV, DEF_SEQUENCE, -+ DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, -+ DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (char *)NULL /* extra */, - (Gpm_Type *)NULL, - -1 -diff -ur gpm-1.99.2.2/src/daemon/processmouse.c gpm-1.99.2.2-patched/src/daemon/processmouse.c ---- gpm-1.99.2.2/src/daemon/processmouse.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/processmouse.c 2008-03-25 22:59:11.000000000 +0100 -@@ -55,6 +55,8 @@ - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; -+ int tempx, tempy; -+ static int oldx, oldy; - - oldT = event->type; - -@@ -77,6 +79,12 @@ - FD_ZERO(&fdSet); - FD_SET(fd,&fdSet); - -+ /* use uncalibrated values as base values */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ nEvent.x = oldx; -+ nEvent.y = oldy; -+ } -+ - do { /* cluster loop */ - if(((data=getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun))(&nEvent,data)==-1) ) { -@@ -123,6 +131,31 @@ - - } while (i++ <(which_mouse->opt_cluster) && nEvent.buttons==oldB && FD_ISSET(fd,&fdSet)); - -+ /* apply calibration */ -+ if((which_mouse->opt_calib!=NULL)&&(which_mouse->m_type->absolute)){ -+ /* save uncalibrated values for use next time around */ -+ oldx = nEvent.x; -+ oldy = nEvent.y; -+ -+ /* do calculations in a larger variable */ -+ tempx = nEvent.x; -+ tempy = nEvent.y; -+ tempx -= which_mouse->opt_dminx; -+ tempx *= ( which_mouse->opt_omaxx - which_mouse->opt_ominx ); -+ tempx /= ( which_mouse->opt_dmaxx - which_mouse->opt_dminx ); -+ tempx += which_mouse->opt_ominx; -+ -+ tempy -= which_mouse->opt_dminy; -+ tempy *= ( which_mouse->opt_omaxy - which_mouse->opt_ominy ); -+ tempy /= ( which_mouse->opt_dmaxy - which_mouse->opt_dminy ); -+ tempy += which_mouse->opt_ominy; -+ -+ nEvent.x = tempx; -+ nEvent.y = tempy; -+ -+ event->dx = (nEvent.x) - (event->x); -+ event->dy = (nEvent.y) - (event->y); -+ } - } /* if(eventFlag) */ - - /*....................................... update the button number */ -@@ -144,11 +177,63 @@ - } - rept1=rept2; - -- event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ /* if the values are calibrated, this is not necessary */ -+ if(which_mouse->opt_calib==NULL) -+ event->dy=event->dy*((win.ws_col/win.ws_row)+1); -+ - event->x=nEvent.x; - event->y=nEvent.y; - } -- repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ -+ -+ /* not all relative repeaters can handle big changes, -+ so repackage into several smaller updates */ -+ if (!repeated_type->absolute) { -+ int remx, remy; -+ remx = event->dx; -+ remy = event->dy; -+ -+ do { -+ if (remx<0) { -+ if (remx>=-127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = -127; -+ remx += 127; -+ } -+ } -+ if (remx>0) { -+ if (remx<=127) { -+ event->dx = remx; -+ remx = 0; -+ } else { -+ event->dx = 127; -+ remx -= 127; -+ } -+ } -+ if (remy<0) { -+ if (remy>=-127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = -127; -+ remy += 127; -+ } -+ } -+ if (remy>0) { -+ if (remy<=127) { -+ event->dy = remy; -+ remy = 0; -+ } else { -+ event->dy = 127; -+ remy -= 127; -+ } -+ } -+ repeated_type->repeat_fun(event, fifofd); -+ } while((remx!= 0)||(remy!=0)); -+ } -+ else -+ repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } /* first if of these three */ -diff -ur gpm-1.99.2.2/src/daemon/startup.c gpm-1.99.2.2-patched/src/daemon/startup.c ---- gpm-1.99.2.2/src/daemon/startup.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/daemon/startup.c 2008-03-25 21:51:07.000000000 +0100 -@@ -36,6 +36,7 @@ - void startup(int argc, char **argv) - { - int i, opt; -+ FILE* calib_file; - - static struct { - char *in; -@@ -104,6 +105,21 @@ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if (!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); -+ if (which_mouse->opt_calib!=NULL) { -+ calib_file = fopen(which_mouse->opt_calib,"r"); -+ if (calib_file) { -+ if (fscanf(calib_file, "%i %i %i %i %i %i %i %i", -+ &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, -+ &which_mouse->opt_ominx, &which_mouse->opt_omaxx, &which_mouse->opt_ominy, &which_mouse->opt_omaxy)!= 8) -+ which_mouse->opt_calib = NULL; -+ if ((which_mouse->opt_dminx>=which_mouse->opt_dmaxx)|| -+ (which_mouse->opt_dminy>=which_mouse->opt_dmaxy)|| -+ (which_mouse->opt_ominx>=which_mouse->opt_omaxx)|| -+ (which_mouse->opt_ominy>=which_mouse->opt_omaxy)) -+ which_mouse->opt_calib = NULL; -+ } -+ fclose(calib_file); -+ } - } - - /* Check repeater status */ -diff -ur gpm-1.99.2.2/src/headers/daemon.h gpm-1.99.2.2-patched/src/headers/daemon.h ---- gpm-1.99.2.2/src/headers/daemon.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/daemon.h 2008-03-25 21:35:10.000000000 +0100 -@@ -82,7 +82,8 @@ - struct mouse_features { - char *opt_type, - *opt_dev, -- *opt_sequence; -+ *opt_sequence, -+ *opt_calib; - int opt_baud, - opt_sample, - opt_delta, -@@ -92,7 +93,15 @@ - opt_time, - opt_cluster, - opt_three, -- opt_glidepoint_tap; -+ opt_glidepoint_tap, -+ opt_dminx, -+ opt_dmaxx, -+ opt_dminy, -+ opt_dmaxy, -+ opt_ominx, -+ opt_omaxx, -+ opt_ominy, -+ opt_omaxy; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -142,6 +151,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -151,6 +161,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/gpmCfg.h gpm-1.99.2.2-patched/src/headers/gpmCfg.h ---- gpm-1.99.2.2/src/headers/gpmCfg.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/gpmCfg.h 2008-03-25 21:33:05.000000000 +0100 -@@ -48,6 +48,7 @@ - #define DEF_DEV NULL /* use the type-related one */ - #define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" - #define DEF_SEQUENCE "123" /* how buttons are reordered */ -+#define DEF_CALIB NULL /* don't load calibration data */ - #define DEF_BAUD 1200 - #define DEF_SAMPLE 100 - #define DEF_DELTA 25 -@@ -57,6 +58,16 @@ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -+#define DEF_DMINX 0 -+#define DEF_DMAXX 1 -+#define DEF_DMINY 0 -+#define DEF_DMAXY 1 -+ -+#define DEF_OMINX 0 -+#define DEF_OMAXX 1 -+#define DEF_OMINY 0 -+#define DEF_OMAXY 1 -+ - /* 10 on old computers (<=386), 0 on current machines */ - #define DEF_CLUSTER 0 /* maximum number of clustered events */ - -diff -ur gpm-1.99.2.2/src/headers/message.h gpm-1.99.2.2-patched/src/headers/message.h ---- gpm-1.99.2.2/src/headers/message.h 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/headers/message.h 2008-03-25 21:37:00.000000000 +0100 -@@ -75,6 +75,7 @@ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ -+ " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ -diff -ur gpm-1.99.2.2/src/mice.c gpm-1.99.2.2-patched/src/mice.c ---- gpm-1.99.2.2/src/mice.c 2008-03-17 17:31:07.000000000 +0100 -+++ gpm-1.99.2.2-patched/src/mice.c 2008-03-25 21:45:16.000000000 +0100 -@@ -140,6 +140,27 @@ - } - return 0; - } -+ -+static int M_evabs (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_ABS) { -+ if (thisevent.code == ABS_X) -+ state->x = thisevent.value; -+ else if (thisevent.code == ABS_Y) -+ state->y = thisevent.value; -+ } else if (thisevent.type == EV_KEY) { -+ switch(thisevent.code) { -+ case BTN_LEFT: state->buttons ^= GPM_B_LEFT; break; -+ case BTN_MIDDLE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_RIGHT: state->buttons ^= GPM_B_RIGHT; break; -+ case BTN_SIDE: state->buttons ^= GPM_B_MIDDLE; break; -+ case BTN_TOUCH: state->buttons ^= GPM_B_LEFT; break; -+ } -+ } -+ return 0; -+} - #endif /* HAVE_LINUX_INPUT_H */ - - static int M_ms_plus(Gpm_Event *state, unsigned char *data) -@@ -2153,6 +2174,9 @@ - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, -+ {"evabs", "Linux Event Device - absolute mode", -+ "", M_evabs, I_empty, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 1, NULL}, - #endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/rejected/paste.debian.net/plain/154 b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/rejected/paste.debian.net/plain/154 deleted file mode 100644 index 78571944..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/rejected/paste.debian.net/plain/154 +++ /dev/null @@ -1,34 +0,0 @@ -diff -Naur gpm-1.19.6.old/contrib/control/gpm_has_mouse_control.c gpm-1.19.6/contrib/control/gpm_has_mouse_control.c ---- gpm-1.19.6.orig/contrib/control/gpm_has_mouse_control.c 1970-01-01 01:00:00.000000000 +0100 -+++ gpm-1.19.6/control/control/gpm_has_mouse_control.c 2004-08-09 18:41:53.000000000 +0200 -@@ -0,0 +1,20 @@ -+#include -+#include -+#include -+#include -+#include -+ -+int main (int argc, char **argv) -+{ -+ int fd; -+ int mode; -+ fd = open ("/dev/tty0", O_RDONLY); -+ if (fd == -1) -+ fd = open ("/dev/vc/0", O_RDONLY); -+ if (fd == -1) -+ perror ("open"); -+ if (ioctl (fd, KDGETMODE, &mode) != 0) -+ perror ("ioctl"); -+ exit(mode); -+} -+ -diff -Naur gpm-1.19.6.old/contrib/control/Makefile gpm-1.19.6/contrib/control/Makefile ---- gpm-1.19.6.orig/contrib/control/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ gpm-1.19.6/contrib/control/Makefile 2004-08-09 18:41:53.000000000 +0200 -@@ -0,0 +1,5 @@ -+all: gpm_has_mouse_control.c -+ gcc -o gpm_has_mouse_control -Wall gpm_has_mouse_control.c -+ -+clean: -+ -rm -f gpm_has_mouse_control - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/rejected/paste.debian.net/plain/154.reason b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/rejected/paste.debian.net/plain/154.reason deleted file mode 100644 index c9fb96e8..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/rejected/paste.debian.net/plain/154.reason +++ /dev/null @@ -1,3 +0,0 @@ -- gcc hardcoded -- no error handling -- no description diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch deleted file mode 100644 index cdc72236..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch +++ /dev/null @@ -1,101 +0,0 @@ -diff -urN gpm-1.99.5/doc/README.1.20.2 gpm-1.99.5-patched/doc/README.1.20.2 ---- gpm-1.99.5/doc/README.1.20.2 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5-patched/doc/README.1.20.2 1970-01-01 01:00:00.000000000 +0100 -@@ -1,54 +0,0 @@ -- -- -- Dear reader, -- -- -- you are reading this document, because you saw that there is a new -- release of gpm available, gpm 1.20.2. -- -- Unfortunately this release is broken, but that's not a big problem. -- -- gpm is broken for some time and I did not spent any time to the project -- for about two years. -- -- Some weeks ago, I was contacted by someone asking me to write a very -- small feature for gpm (a small client program, included in this -- release). I answered the person that I do not have the time to code -- that part, but if he really insists that I should write that code, -- he should think about sponsoring me [0]. -- -- Some days later I recieved an email that he wanted to sponsor me. -- I was a little bit surprised, because it was the first person really -- considering my sponsoring plans. -- -- So I coded that small program and had some views in the old code of -- gpm. There's so much information in it, so many hacks, so many dirty -- tricks and there are still many people using it. -- -- So I considered to try to spent more time to gpm, perhaps even creating -- a more clean (and better maintainable) version of it. -- -- But I _am_ actually a pretty busy person, working almost all time, if not -- doing sports (just about 6 hours a week) or sleeping. -- -- So I thought, perhaps you can help me to get more time for coding FOSS [1] -- in general or gpm in specific: -- -- My idea is, that if you consider sponsoring my work, I can begin to work less -- "traditionally" and also finance my second study in computer science, which -- I will begin in autumn 2008, if I have the money to do it (living in -- Switzerland is not that cheap). -- -- I am looking forward to get any feedback from you about this idea -- at nico-gpm-sponsoring (at) schottelius.org. -- -- Thanks for reading, -- -- -- Nico Schottelius, 12. May 2007 -- -- -- P.S.: GPM is alive! -- -- [0]: Sponsoring information: http://nico.schottelius.org/about/support -- [1]: FOSS: http://nico.schottelius.org/documentations/foss/the-term-foss/ -diff -urN gpm-1.99.5/doc/README.evabs gpm-1.99.5-patched/doc/README.evabs ---- gpm-1.99.5/doc/README.evabs 1970-01-01 01:00:00.000000000 +0100 -+++ gpm-1.99.5-patched/doc/README.evabs 2008-04-06 16:11:30.000000000 +0200 -@@ -0,0 +1,39 @@ -+ -+This file tells how to use gpm with the driver for event-devices -+that use absolut coordiantes (evabs) like touchscreens. It was -+desigened and tested for eGalax controllers, but should work with -+others as well. -+ -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done with a configfile. It consists of a single -+line of 8 integers: -+ -+ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max -+ -+The first four values (prefixed withe here) show the minimum and -+maximum values of coordinates the event-device delivers for -+x- and y-axis, respectivly. The last four values show range of -+coordinates to which the input should be scaled, for example your -+screen resolution. This works for text-mode, too. -+ -+An example for an 800x600 screen would look like this: -+ -+50 1950 50 1950 0 799 0 599 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+You need to use the evabs devicetype to use this feature, a -+device that delivers the absolute coordinates a config-file -+that describes how to scale these coordinates, and a repeater- -+device used for output. -+The pseudo-file /proc/bus/input/devices should tell you which -+event-device to use. -+ -+Usage example: -+ -+gpm -t evabs -m /dev/input/event2 -c /etc/gpm-calib.conf -R ps2 diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.modified b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.modified deleted file mode 100644 index a5c18071..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.modified +++ /dev/null @@ -1,43 +0,0 @@ -diff -urN gpm-1.99.5/doc/README.evabs gpm-1.99.5-patched/doc/README.evabs ---- gpm-1.99.5/doc/README.evabs 1970-01-01 01:00:00.000000000 +0100 -+++ gpm-1.99.5-patched/doc/README.evabs 2008-04-06 16:11:30.000000000 +0200 -@@ -0,0 +1,39 @@ -+ -+This file tells how to use gpm with the driver for event-devices -+that use absolut coordiantes (evabs) like touchscreens. It was -+desigened and tested for eGalax controllers, but should work with -+others as well. -+ -+ -+ CALIBRATION -+ ----------- -+ -+Calibration is done with a configfile. It consists of a single -+line of 8 integers: -+ -+ex_min ex_max ey_min ey_max sx_min sx_max sy_min sy_max -+ -+The first four values (prefixed withe here) show the minimum and -+maximum values of coordinates the event-device delivers for -+x- and y-axis, respectivly. The last four values show range of -+coordinates to which the input should be scaled, for example your -+screen resolution. This works for text-mode, too. -+ -+An example for an 800x600 screen would look like this: -+ -+50 1950 50 1950 0 799 0 599 -+ -+ -+ GPM OPERATION -+ ------------- -+ -+You need to use the evabs devicetype to use this feature, a -+device that delivers the absolute coordinates a config-file -+that describes how to scale these coordinates, and a repeater- -+device used for output. -+The pseudo-file /proc/bus/input/devices should tell you which -+event-device to use. -+ -+Usage example: -+ -+gpm -t evabs -m /dev/input/event2 -c /etc/gpm-calib.conf -R ps2 diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.reason b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.reason deleted file mode 100644 index 6ece1f6f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.5/www.spida.net/tmp/gpm-evabs-doc.patch.reason +++ /dev/null @@ -1 +0,0 @@ -No need to modify the 1.20.2 README for evabs doc. diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/commit-36f0509 b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/commit-36f0509 deleted file mode 100644 index 09b36112..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/commit-36f0509 +++ /dev/null @@ -1,45 +0,0 @@ -commit 36f0509100b0e851f93f0a544950539c0af83937 -Author: Bernhard Fischer -Date: Tue Apr 15 17:29:05 2008 +0200 - - remove unused f_fgcmd - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index a01caa8..dda6904 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -179,7 +179,6 @@ Draw *cfg_alloc(void); - - enum F_call {F_CREATE, F_POST, F_INVOKE, F_DONE}; - int f_bgcmd(int mode, DrawItem *self, int uid); --int f_fgcmd(int mode, DrawItem *self, int uid); - int f_jptty(int mode, DrawItem *self, int uid); - int f_mktty(int mode, DrawItem *self, int uid); - int f_menu(int mode, DrawItem *self, int uid); -@@ -287,7 +286,6 @@ struct funcName { - int (*fun)(); - }; - struct funcName funcList[] = { -- {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, -@@ -441,18 +439,6 @@ void f__fix(struct passwd *pass) - } - - /*---------------------------------------------------------------------*/ --int f_fgcmd(int mode, DrawItem *self, int uid) --{ -- self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ -- switch (mode) { -- case F_CREATE: -- case F_POST: break; -- case F_INVOKE: ; /* MISS */ -- } -- return 0; --} -- --/*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { - int i; diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/commit-9b45502 b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/commit-9b45502 deleted file mode 100644 index 2b084aa4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/commit-9b45502 +++ /dev/null @@ -1,132 +0,0 @@ -commit 9b45502d530adad84c7a7325601a8642741a510d -Author: Bernhard Fischer -Date: Tue Apr 15 17:16:13 2008 +0200 - - remove unneeded functions - - Remove f_debug and f_debug_one since they are ifdefed out. - Remove f_lock; Use the vlock program if you want to lock terminals. - -diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y -index e30a5d4..a01caa8 100644 ---- a/src/prog/gpm-root.y -+++ b/src/prog/gpm-root.y -@@ -178,13 +178,11 @@ Draw *cfg_alloc(void); - /* prototypes for predefined functions */ - - enum F_call {F_CREATE, F_POST, F_INVOKE, F_DONE}; --int f_debug(int mode, DrawItem *self, int uid); - int f_bgcmd(int mode, DrawItem *self, int uid); - int f_fgcmd(int mode, DrawItem *self, int uid); - int f_jptty(int mode, DrawItem *self, int uid); - int f_mktty(int mode, DrawItem *self, int uid); - int f_menu(int mode, DrawItem *self, int uid); --int f_lock(int mode, DrawItem *self, int uid); - int f_load(int mode, DrawItem *self, int uid); - int f_free(int mode, DrawItem *self, int uid); - int f_time(int mode, DrawItem *self, int uid); -@@ -289,13 +287,11 @@ struct funcName { - int (*fun)(); - }; - struct funcName funcList[] = { -- {"f.debug",T_FUNC,f_debug}, - {"f.fgcmd",T_FUN2,f_fgcmd}, - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, -- {"f.lock",T_FUN2,f_lock}, /* "lock one", "lock all" */ - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, -@@ -445,58 +441,6 @@ void f__fix(struct passwd *pass) - } - - /*---------------------------------------------------------------------*/ --static int f_debug_one(FILE *f, Draw *draw) --{ -- DrawItem *ip; -- static int tc=0; -- int i; -- --#define LINE(args) for(i=0;ibuttons,draw->width,draw->height)); -- LINE((f,"UID %i\n",draw->uid)); -- LINE((f,"fore %i - back %i\n",draw->fore,draw->back)); -- LINE((f,"bord %i - head %i\n",draw->bord,draw->head)); -- LINE((f,"---> \"%s\" %li\n",draw->title,(long)(draw->mtime))); -- for (ip=draw->menu; ip; ip=ip->next) { -- LINE((f," %i \"%s\" (%p)\n",ip->type,ip->name,ip->fun)); -- if (ip->fun == f_menu) { -- tc++; f_debug_one(f,(Draw *)ip->clientdata); tc--; -- } -- } --#undef LINE -- return 0; --} -- --int f_debug(int mode, DrawItem *self, int uid) --{ -- -- mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ --#if 0 /* Disabled on account of security concerns; the way -- * "/tmp/root-debug" is used is gratuitously -- * open to symlink abuse */ -- -- FILE *f; -- Draw *dp; -- -- switch (mode) { -- case F_POST: -- if (!(f=fopen("/tmp/root-debug","a"))) return 1; -- for(dp=drawList; dp; dp=dp->next) -- f_debug_one(f,dp); -- fprintf(f,"\n\n"); -- fclose(f); -- -- case F_CREATE: -- case F_INVOKE: -- break; -- } --#endif /* 0 */ -- return 0; --} -- -- --/*---------------------------------------------------------------------*/ - int f_fgcmd(int mode, DrawItem *self, int uid) - { - self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ -@@ -620,31 +564,6 @@ int f_menu(int mode, DrawItem *self, int uid) - return 0; /* just a placeholder, recursion is performed in main() */ - } - --/*---------------------------------------------------------------------*/ --int f_lock(int mode, DrawItem *self, int uid) --{ -- mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ --#if 0 /* some kind of interesting ...: if never */ -- int all; -- static DrawItem msg = { -- 0, -- 10, -- "Enter your password to unlock", -- NULL, NULL, NULL, NULL -- }; -- static Draw -- -- -- switch (mode) { -- case F_CREATE: /* either "one" or anything else */ -- if (strcmp(self->arg,"one")) self->arg[0]='a'; -- case F_POST: break; -- case F_INVOKE: /* the biggest of all... */ -- } -- --#endif -- return 0; --} - - /*---------------------------------------------------------------------*/ - int f_load(int mode, DrawItem *self, int uid) diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-add-install-exec.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-add-install-exec.patch deleted file mode 100644 index 9f0fa56d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-add-install-exec.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -rdup gpm-1.99.5.old7/Makefile.in gpm-1.99.5/Makefile.in ---- gpm-1.99.5.old7/Makefile.in 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/Makefile.in 2008-04-15 13:46:27.000000000 +0200 -@@ -44,6 +44,9 @@ install: check installdirs do-install - install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -+install-exec: installdirs -+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install -+ - installdirs: - $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-fix-drivers-etouch.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-fix-drivers-etouch.patch deleted file mode 100644 index 4b3af261..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-fix-drivers-etouch.patch +++ /dev/null @@ -1,15 +0,0 @@ -\\\\ -\\ drivers/etouch/i.c: In function 'I_etouch': -\\ drivers/etouch/i.c:74: error: array subscript is above array bounds -diff -rdup gpm-1.99.5.old4/src/drivers/etouch/i.c gpm-1.99.5/src/drivers/etouch/i.c ---- gpm-1.99.5.old4/src/drivers/etouch/i.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/drivers/etouch/i.c 2008-04-15 13:32:22.000000000 +0200 -@@ -71,7 +71,7 @@ Gpm_Type *I_etouch(int fd, unsigned shor - for (i=0; i<4; i++) - if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0; - if (gunze_calib[0] == gunze_calib[2]) calibok = 0; -- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; -+ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; - fclose(f); - } - if (!calibok) { diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-missing-return-in-main.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-missing-return-in-main.patch deleted file mode 100644 index 37d8919b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-missing-return-in-main.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -rdup gpm-1.99.5.old/src/daemon/old_main.c gpm-1.99.5/src/daemon/old_main.c ---- gpm-1.99.5.old/src/daemon/old_main.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/daemon/old_main.c 2008-04-15 13:25:49.000000000 +0200 -@@ -261,4 +261,5 @@ int old_main() - - if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB); - } /* while(1) */ -+ return 0; - } diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-susv3-legacy.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-susv3-legacy.patch deleted file mode 100644 index 92e94828..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-susv3-legacy.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff -rdup gpm-1.99.5.old/src/daemon/old_main.c gpm-1.99.5/src/daemon/old_main.c ---- gpm-1.99.5.old/src/daemon/old_main.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/daemon/old_main.c 2008-04-15 13:22:49.000000000 +0200 -@@ -88,7 +88,7 @@ int old_main() - /* control node */ - - if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB); -- bzero((char *)&ctladdr,sizeof(ctladdr)); -+ memset((char *)&ctladdr, 0, sizeof(ctladdr)); - ctladdr.sun_family=AF_UNIX; - strcpy(ctladdr.sun_path,GPM_NODE_CTL); - unlink(GPM_NODE_CTL); -diff -rdup gpm-1.99.5.old/src/daemon/processconn.c gpm-1.99.5/src/daemon/processconn.c ---- gpm-1.99.5.old/src/daemon/processconn.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/daemon/processconn.c 2008-04-15 13:22:37.000000000 +0200 -@@ -49,7 +49,7 @@ int processConn(int fd) /* returns newfd - - /*....................................... Accept */ - -- bzero((char *)&addr,sizeof(addr)); -+ memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - - len=sizeof(addr); -diff -rdup gpm-1.99.5.old/src/lib/liblow.c gpm-1.99.5/src/lib/liblow.c ---- gpm-1.99.5.old/src/lib/liblow.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/lib/liblow.c 2008-04-15 13:23:15.000000000 +0200 -@@ -289,7 +289,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - } - - #ifndef SO_PEERCRED -- bzero((char *)&addr,sizeof(addr)); -+ memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - if (!(sock_name = tempnam (0, "gpm"))) { - gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno)); -@@ -303,7 +303,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag - } - #endif - -- bzero((char *)&addr,sizeof(addr)); -+ memset((char *)&addr, 0, sizeof(addr)); - addr.sun_family=AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL); ---- gpm-1.99.5.old5/src/drivers/synaptics/synaptics.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/drivers/synaptics/synaptics.c 2008-04-15 13:35:53.000000000 +0200 -@@ -2121,9 +2121,9 @@ void tp_read_config_file (char* config_f - break; - - case Flag_Param: -- if (index ("YyTt1", token [0])) { -+ if (strchr ("YyTt1", token [0])) { - *(param_data [param].addr.flag_p) = 1; -- } else if (index ("NnFf0", token [0])) { -+ } else if (strchr ("NnFf0", token [0])) { - *(param_data [param].addr.flag_p) = 0; - } else { - gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid", diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-wrong-include-for-ioctl.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-wrong-include-for-ioctl.patch deleted file mode 100644 index a9458267..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/gpm-1.99.5-wrong-include-for-ioctl.patch +++ /dev/null @@ -1,15 +0,0 @@ -Only in gpm-1.99.5/src/daemon: old_main.P -Only in gpm-1.99.5/src/daemon: old_main.o -diff -rdup gpm-1.99.5.old3/src/daemon/open_console.c gpm-1.99.5/src/daemon/open_console.c ---- gpm-1.99.5.old3/src/daemon/open_console.c 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/daemon/open_console.c 2008-04-15 13:30:03.000000000 +0200 -@@ -21,7 +21,7 @@ - - #include /* open and co. */ - #include /* stat() */ --#include /* ioctl */ -+#include /* ioctl() */ - - /* Linux specific (to be outsourced in gpm2 */ - #include /* for serial console check */ -Only in gpm-1.99.5/src/daemon: open_console.d diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch deleted file mode 100644 index 218fcac0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch +++ /dev/null @@ -1,21 +0,0 @@ -\\\\ -\\ src/prog/gpm-root.y:449: error: 'f_debug_one' defined but not used -diff -rdup gpm-1.99.5.old6/src/prog/gpm-root.y gpm-1.99.5/src/prog/gpm-root.y ---- gpm-1.99.5.old6/src/prog/gpm-root.y 2008-04-01 23:43:48.000000000 +0200 -+++ gpm-1.99.5/src/prog/gpm-root.y 2008-04-15 13:40:36.000000000 +0200 -@@ -445,6 +445,7 @@ void f__fix(struct passwd *pass) - } - - /*---------------------------------------------------------------------*/ -+#ifdef DEBUG - static int f_debug_one(FILE *f, Draw *draw) - { - DrawItem *ip; -@@ -467,6 +468,7 @@ static int f_debug_one(FILE *f, Draw *dr - #undef LINE - return 0; - } -+#endif - - int f_debug(int mode, DrawItem *self, int uid) - { diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch.reason b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch.reason deleted file mode 100644 index f3fc8e3c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/reject/gpm-1.99.5-conditional-debugstuff.patch.reason +++ /dev/null @@ -1 +0,0 @@ -Should cleanup all debug stuff in gpm-root better diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-blah.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-blah.patch deleted file mode 100644 index 14395301..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-blah.patch +++ /dev/null @@ -1,437 +0,0 @@ -diff --git a/Makefile.in b/Makefile.in -index 357764b..d22527d 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -48,9 +48,9 @@ install-exec: installdirs - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install - - installdirs: -- $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ -+ @MKDIR_P@ $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ -- $(MKDIR) $(lispdir) ; \ -+ @MKDIR_P@ $(lispdir) ; \ - fi - - ### GENERIC -diff --git a/Makefile.include.in b/Makefile.include.in -index 913172f..b2527c5 100644 ---- a/Makefile.include.in -+++ b/Makefile.include.in -@@ -58,8 +58,6 @@ AR = ar - ETAGS = etags - AWK = awk - CP = cp -a --MKDIR = mkdir -p # linux specific, but who cares ? -- # gpm is linux specific, too. - RM = rm - - -diff --git a/acinclude.m4 b/acinclude.m4 -new file mode 100644 -index 0000000..c83a5a8 ---- /dev/null -+++ b/acinclude.m4 -@@ -0,0 +1,36 @@ -+dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ -+AC_DEFUN(ITZ_SYS_ELF, -+[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, -+[AC_EGREP_CPP(win, -+[#ifdef __ELF__ -+win -+#else -+lose -+#endif -+],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) -+if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then -+ PICFLAGS="-DPIC -fPIC" -+ SOLDFLAGS="-fPIC -shared -Wl,-soname," -+else -+ PICFLAGS= -+ SOLDFLAGS= -+fi -+]) -+AC_DEFUN(ITZ_PATH_SITE_LISP, -+[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, -+[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | -+sed -e '/^$/d' | sed -n -e 2p` -+case x${itz_cv_path_site_lisp} in -+x*site-lisp*) ;; -+x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; -+esac]) -+]) -+AC_DEFUN(ITZ_CHECK_TYPE, -+[AC_CACHE_CHECK([for $1],itz_cv_type_$1, -+AC_TRY_COMPILE([ -+#include <$2> -+],[ -+$1 dummy; -+return 0; -+],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) -+]) -diff --git a/aclocal.m4 b/aclocal.m4 -deleted file mode 100644 -index c83a5a8..0000000 ---- a/aclocal.m4 -+++ /dev/null -@@ -1,36 +0,0 @@ --dnl $Id: aclocal.m4,v 1.2 2002/05/28 19:13:50 nico Exp $ --AC_DEFUN(ITZ_SYS_ELF, --[AC_CACHE_CHECK([whether system is ELF],itz_cv_sys_elf, --[AC_EGREP_CPP(win, --[#ifdef __ELF__ --win --#else --lose --#endif --],[itz_cv_sys_elf=yes],[itz_cv_sys_elf=no])]) --if test ${itz_cv_sys_elf} = yes && test x${ac_cv_prog_gcc} = xyes ; then -- PICFLAGS="-DPIC -fPIC" -- SOLDFLAGS="-fPIC -shared -Wl,-soname," --else -- PICFLAGS= -- SOLDFLAGS= --fi --]) --AC_DEFUN(ITZ_PATH_SITE_LISP, --[AC_CACHE_CHECK([where to install Emacs Lisp files],itz_cv_path_site_lisp, --[eval itz_cv_path_site_lisp=`${EMACS} -batch -l ${srcdir}/exec.el -exec "(mapcar 'print load-path)" 2>/dev/null | --sed -e '/^$/d' | sed -n -e 2p` --case x${itz_cv_path_site_lisp} in --x*site-lisp*) ;; --x*) itz_cv_path_site_lisp='${datadir}/emacs/site-lisp' ;; --esac]) --]) --AC_DEFUN(ITZ_CHECK_TYPE, --[AC_CACHE_CHECK([for $1],itz_cv_type_$1, --AC_TRY_COMPILE([ --#include <$2> --],[ --$1 dummy; --return 0; --],[itz_cv_type_$1=yes],[itz_cv_type_$1=no])) --]) -diff --git a/autogen.sh b/autogen.sh -new file mode 100755 -index 0000000..12e6747 ---- /dev/null -+++ b/autogen.sh -@@ -0,0 +1,9 @@ -+#!/bin/sh -e -+ -+[ -d config ] || mkdir config -+${ACLOCAL-aclocal} -I config -+${LIBTOOLIZE-libtoolize} --force --copy -+${AUTOHEADER-autoheader} -+${AUTOMAKE-automake} --add-missing --copy 2> /dev/null || true -+${AUTOCONF-autoconf} -+ -diff --git a/configure.ac b/configure.ac -index f8bba91..c1d175a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2,15 +2,18 @@ dnl Process this file with autoconf to produce a configure script. - dnl written jan/1997 - T.E.Dickey - - AC_PREREQ(2.61) --AC_INIT(src/daemon/main.c) --AC_CONFIG_HEADER(src/headers/config.h) - --release=1.99.6 --release_date="no date yet" --revgit=`git-rev-parse --short HEAD` --AC_DEFINE_UNQUOTED(GPM_RELEASE,"$release", "Release number") --AC_DEFINE_UNQUOTED(GPM_RELEASE_DATE,"$release_date", "Release date") --AC_DEFINE_UNQUOTED(GPM_RELEASE_GIT,"$revgit", "Result from git-rev-parse") -+AC_INIT([gpm],[1.99.6],[http://unix.schottelius.org/gpm/]) -+AC_CONFIG_SRCDIR([src/daemon/main.c]) -+AC_CONFIG_AUX_DIR([config]) -+AC_CONFIG_HEADER([src/headers/config.h]) -+ -+AC_CANONICAL_HOST -+ -+revgit="`git-rev-parse --short HEAD`" -+builddate="`date +%Y%m%d\ %T\ %z`" -+AC_DEFINE_UNQUOTED([GPM_RELEASE_GIT],["$revgit"],[git short revision]) -+AC_DEFINE_UNQUOTED([GPM_RELEASE_DATE],["$builddate"],[build date]) - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. -@@ -31,6 +34,7 @@ fi - AC_PROG_CC - AC_PROG_RANLIB - AC_PROG_INSTALL -+AC_PROG_MKDIR_P - AC_PROG_YACC - AC_PROG_LN_S - -diff --git a/install-sh b/install-sh -deleted file mode 100755 -index ab74c88..0000000 ---- a/install-sh -+++ /dev/null -@@ -1,238 +0,0 @@ --#!/bin/sh --# --# install - install a program, script, or datafile --# This comes from X11R5. --# --# Calling this script install-sh is preferred over install.sh, to prevent --# `make' implicit rules from creating a file called install from it --# when there is no Makefile. --# --# This script is compatible with the BSD install script, but was written --# from scratch. --# -- -- --# set DOITPROG to echo to test this script -- --# Don't use :- since 4.3BSD and earlier shells don't like it. --doit="${DOITPROG-}" -- -- --# put in absolute paths if you don't have them in your path; or use env. vars. -- --mvprog="${MVPROG-mv}" --cpprog="${CPPROG-cp}" --chmodprog="${CHMODPROG-chmod}" --chownprog="${CHOWNPROG-chown}" --chgrpprog="${CHGRPPROG-chgrp}" --stripprog="${STRIPPROG-strip}" --rmprog="${RMPROG-rm}" --mkdirprog="${MKDIRPROG-mkdir}" -- --tranformbasename="" --transform_arg="" --instcmd="$mvprog" --chmodcmd="$chmodprog 0755" --chowncmd="" --chgrpcmd="" --stripcmd="" --rmcmd="$rmprog -f" --mvcmd="$mvprog" --src="" --dst="" --dir_arg="" -- --while [ x"$1" != x ]; do -- case $1 in -- -c) instcmd="$cpprog" -- shift -- continue;; -- -- -d) dir_arg=true -- shift -- continue;; -- -- -m) chmodcmd="$chmodprog $2" -- shift -- shift -- continue;; -- -- -o) chowncmd="$chownprog $2" -- shift -- shift -- continue;; -- -- -g) chgrpcmd="$chgrpprog $2" -- shift -- shift -- continue;; -- -- -s) stripcmd="$stripprog" -- shift -- continue;; -- -- -t=*) transformarg=`echo $1 | sed 's/-t=//'` -- shift -- continue;; -- -- -b=*) transformbasename=`echo $1 | sed 's/-b=//'` -- shift -- continue;; -- -- *) if [ x"$src" = x ] -- then -- src=$1 -- else -- # this colon is to work around a 386BSD /bin/sh bug -- : -- dst=$1 -- fi -- shift -- continue;; -- esac --done -- --if [ x"$src" = x ] --then -- echo "install: no input file specified" -- exit 1 --else -- true --fi -- --if [ x"$dir_arg" != x ]; then -- dst=$src -- src="" -- -- if [ -d $dst ]; then -- instcmd=: -- else -- instcmd=mkdir -- fi --else -- --# Waiting for this to be detected by the "$instcmd $src $dsttmp" command --# might cause directories to be created, which would be especially bad --# if $src (and thus $dsttmp) contains '*'. -- -- if [ -f $src -o -d $src ] -- then -- true -- else -- echo "install: $src does not exist" -- exit 1 -- fi -- -- if [ x"$dst" = x ] -- then -- echo "install: no destination specified" -- exit 1 -- else -- true -- fi -- --# If destination is a directory, append the input filename; if your system --# does not like double slashes in filenames, you may need to add some logic -- -- if [ -d $dst ] -- then -- dst="$dst"/`basename $src` -- else -- true -- fi --fi -- --## this sed command emulates the dirname command --dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` -- --# Make sure that the destination directory exists. --# this part is taken from Noah Friedman's mkinstalldirs script -- --# Skip lots of stat calls in the usual case. --if [ ! -d "$dstdir" ]; then --defaultIFS=' --' --IFS="${IFS-${defaultIFS}}" -- --oIFS="${IFS}" --# Some sh's can't handle IFS=/ for some reason. --IFS='%' --set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` --IFS="${oIFS}" -- --pathcomp='' -- --while [ $# -ne 0 ] ; do -- pathcomp="${pathcomp}${1}" -- shift -- -- if [ ! -d "${pathcomp}" ] ; -- then -- $mkdirprog "${pathcomp}" -- else -- true -- fi -- -- pathcomp="${pathcomp}/" --done --fi -- --if [ x"$dir_arg" != x ] --then -- $doit $instcmd $dst && -- -- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && -- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && -- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && -- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi --else -- --# If we're going to rename the final executable, determine the name now. -- -- if [ x"$transformarg" = x ] -- then -- dstfile=`basename $dst` -- else -- dstfile=`basename $dst $transformbasename | -- sed $transformarg`$transformbasename -- fi -- --# don't allow the sed command to completely eliminate the filename -- -- if [ x"$dstfile" = x ] -- then -- dstfile=`basename $dst` -- else -- true -- fi -- --# Make a temp file name in the proper directory. -- -- dsttmp=$dstdir/#inst.$$# -- --# Move or copy the file name to the temp name -- -- $doit $instcmd $src $dsttmp && -- -- trap "rm -f ${dsttmp}" 0 && -- --# and set any options; do chmod last to preserve setuid bits -- --# If any of these fail, we abort the whole thing. If we want to --# ignore errors from any of these, just make sure not to ignore --# errors from the above "$doit $instcmd $src $dsttmp" command. -- -- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && -- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && -- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && -- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && -- --# Now rename the file to the real destination. -- -- $doit $rmcmd -f $dstdir/$dstfile && -- $doit $mvcmd $dsttmp $dstdir/$dstfile -- --fi && -- -- --exit 0 -diff --git a/src/headers/message.h b/src/headers/message.h -index 9a869a4..8344163 100644 ---- a/src/headers/message.h -+++ b/src/headers/message.h -@@ -62,7 +62,7 @@ - /* messages */ - - /* info */ --#define GPM_MESS_VERSION "gpm " GPM_RELEASE " git:" GPM_RELEASE_GIT ", " GPM_RELEASE_DATE -+#define GPM_MESS_VERSION "gpm " PACKAGE_VERSION " git:" GPM_RELEASE_GIT ", " GPM_RELEASE_DATE - #define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." - #define GPM_MESS_KILLED "Killed gpm(%d)." - #define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -diff --git a/src/lib/libxtra.c b/src/lib/libxtra.c -index 8ea119c..fa5471a 100644 ---- a/src/lib/libxtra.c -+++ b/src/lib/libxtra.c -@@ -38,7 +38,7 @@ - * these two functions return version information - */ - --static char *gpml_ver_s=GPM_RELEASE; -+static char *gpml_ver_s=PACKAGE_VERSION; - static int gpml_ver_i = 0; - - char *Gpm_GetLibVersion(int *where) diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-configure-mkdir.patch b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-configure-mkdir.patch deleted file mode 100644 index 0271ab75..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.6/bernhard.fischer/uclibc.org/~aldot/gpm/gpm-1.99.5-configure-mkdir.patch +++ /dev/null @@ -1,46 +0,0 @@ -let configure figure out a program to use for recursive mkdir - - It uses either 'mkdir -p' or 'install-sh -d'. - -diff --git a/Makefile.in b/Makefile.in -index 357764b..d22527d 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -48,9 +48,9 @@ install-exec: installdirs - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install - - installdirs: -- $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ -+ @MKDIR_P@ $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ - if test "x@ELISP@" != "x" ; then \ -- $(MKDIR) $(lispdir) ; \ -+ @MKDIR_P@ $(lispdir) ; \ - fi - - ### GENERIC -diff --git a/Makefile.include.in b/Makefile.include.in -index 913172f..b2527c5 100644 ---- a/Makefile.include.in -+++ b/Makefile.include.in -@@ -58,8 +58,6 @@ AR = ar - ETAGS = etags - AWK = awk - CP = cp -a --MKDIR = mkdir -p # linux specific, but who cares ? -- # gpm is linux specific, too. - RM = rm - - -diff --git a/configure.ac b/configure.ac -index f8bba91..c1d175a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -31,6 +34,7 @@ fi - AC_PROG_CC - AC_PROG_RANLIB - AC_PROG_INSTALL -+AC_PROG_MKDIR_P - AC_PROG_YACC - AC_PROG_LN_S - - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-drivers.h b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-drivers.h deleted file mode 100644 index d8819e54..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-drivers.h +++ /dev/null @@ -1,40 +0,0 @@ - Improve the regex to match Gpm_Type. - Rename "func" to "fn" to be gentle to awk; This prevents errors like - awk: cmd. line:7: func=substr($0, idx); - awk: cmd. line:7: ^ syntax error - awk: cmd. line:8: gsub(/\n/, " ", func); - awk: cmd. line:8: ^ syntax error - awk: cmd. line:8: fatal: 0 is invalid as number of arguments for gsub - -Signed-off-by: aldot ---- - scripts/generate_drivers_header.sh | 8 ++++---- - 1 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/scripts/generate_drivers_header.sh b/scripts/generate_drivers_header.sh -index 1a05a8f..34eafd4 100755 ---- a/scripts/generate_drivers_header.sh -+++ b/scripts/generate_drivers_header.sh -@@ -39,11 +39,11 @@ eof - # they have line breaks :-( - cat drivers/*/i.c | \ - awk 'BEGIN { RS="{"; } -- /Gpm_Type \*I_/ { -+ /Gpm_Type[ ][ ]*\*I_/ { - idx=index($0,"Gpm_Type *I_"); -- func=substr($0, idx); -- gsub(/\n/, " ", func); -- print func -+ fn=substr($0, idx); -+ gsub(/\n/, " ", fn); -+ print fn - }' - grep -h "^int R_" drivers/*/r.c - ) | sed -e '/^$/d' -e 's/$/;/' -e 's/ */ /g' --- -1.5.5 - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-gitversion b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-gitversion deleted file mode 100644 index edcd0044..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-gitversion +++ /dev/null @@ -1,24 +0,0 @@ - -Signed-off-by: aldot ---- - configure.ac | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 0801e44..249efaa 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -10,8 +10,8 @@ AC_CONFIG_HEADER([src/headers/config.h]) - - AC_CANONICAL_HOST - --revgit="`cat .gitversion`" --releasedate="`cat .releasedate`" -+revgit="`cat $srcdir/.gitversion`" -+releasedate="`cat $srcdir/.releasedate`" - AC_DEFINE_UNQUOTED([GPM_RELEASE_GIT],["$revgit"],[git short revision]) - AC_DEFINE_UNQUOTED([GPM_RELEASE_DATE],["$releasedate"],[release date]) - --- -1.5.5 - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-prerequisites b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-prerequisites deleted file mode 100644 index 96ffa445..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard-prerequisites +++ /dev/null @@ -1,36 +0,0 @@ - -Signed-off-by: aldot ---- - src/Makefile.in | 7 +++++-- - 1 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/src/Makefile.in b/src/Makefile.in -index 1ecd8a9..ccb61c1 100644 ---- a/src/Makefile.in -+++ b/src/Makefile.in -@@ -115,11 +115,13 @@ prog/%: prog/%.o - $(OBJECTS): headers/drivers.h - - headers/drivers.h: $(addprefix $(srcdir)/,$(GDRIVERS)) $(top_srcdir)/scripts/generate_drivers_header.sh -+ @@MKDIR_P@ $(@D) - $(top_srcdir)/scripts/generate_drivers_header.sh $(srcdir) > $@ - - #-include $(SRCSP) - --Makefile.drivers.generated: -+Makefile.drivers.generated: $(top_srcdir)/scripts/generate_drivers_makefile.sh -+ @@MKDIR_P@ $(@D) - $(top_srcdir)/scripts/generate_drivers_makefile.sh $(srcdir) > $@ - - ### INSTALL -@@ -208,5 +210,6 @@ allclean: clean - rm -f headers/config.h.in - - ### GPM2 integration --gpm2/become_daemon.c: $(srcdir)/../gpm2/daemon/become_daemon.c -+$(srcdir)/gpm2/become_daemon.c: $(top_srcdir)/gpm2/daemon/become_daemon.c -+ @@MKDIR_P@ $(@D) - cp $^ $@ --- -1.5.5 - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard1 b/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard1 deleted file mode 100644 index 3c83231c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/1.99.7/bernhard1 +++ /dev/null @@ -1,128 +0,0 @@ - -Signed-off-by: aldot ---- - configure.ac | 2 +- - scripts/generate_drivers_makefile.sh | 2 +- - src/Makefile.in | 32 +++++++++++++++++++++----------- - 3 files changed, 23 insertions(+), 13 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 3ecf063..0801e44 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -132,7 +132,7 @@ AC_SUBST(CURSES_OBJS) - AC_SUBST(SHARED_LIBS) - AC_SUBST(lispdir) - --CPPFLAGS='-I$(srcdir)/headers -I$(srcdir)/../gpm2/include $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""' -+CPPFLAGS='$(DEFS) -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\"" -include headers/config.h -I$(srcdir)/headers -I$(srcdir)/../gpm2/include -I$(builddir)/headers ' - LDFLAGS='-L$(srcdir)' - - dnl AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir") -diff --git a/scripts/generate_drivers_makefile.sh b/scripts/generate_drivers_makefile.sh -index a6d0336..b65acef 100755 ---- a/scripts/generate_drivers_makefile.sh -+++ b/scripts/generate_drivers_makefile.sh -@@ -32,7 +32,7 @@ GDRIVERS = \\ - eof - - ( -- cd $1 -+ cd $dir - ls drivers/*/*.c - ) | sed 's/$/ \\/' - -diff --git a/src/Makefile.in b/src/Makefile.in -index bccd180..1ecd8a9 100644 ---- a/src/Makefile.in -+++ b/src/Makefile.in -@@ -7,6 +7,8 @@ - # - - srcdir = @srcdir@ -+top_srcdir = @top_srcdir@ -+builddir = @builddir@ - top_builddir = .. - - ## INCLUDES -@@ -60,7 +62,10 @@ PROG = $(POBJ:.o=) - - SRCS = $(GSRC) $(LSRC) $(PSRC) - SRCSP= $(SRCS:.c=.P) lib/libcurses.P --OBJECTS = $(SRCS:.c=.o) -+OBJECTS = $(GOBJ) $(filter-out @CURSES_OBJS@,$(LOBJ)) $(POBJ) -+# All objects depend on their respective sources -+$(OBJECTS) @CURSES_OBJS@: %.o: $(srcdir)/%.c -+$(PICS): %.lo: $(srcdir)/%.c - - DEFS = @DEFS@ - -@@ -80,20 +85,26 @@ gpm: $(GOBJ) - # user-overridable flags, but it's also all the implicit rule looks at. - - # the prog rules are not very clean... --prog/%.o: prog/%.c -- $(CC) -Iheaders @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< -+prog/%.o: $(srcdir)/prog/%.c -+ @@MKDIR_P@ $(@D) -+ $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - - prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - --%.o: %.c -+ -+#Make sure that our output-dir exists. autotools would have done this -+#for us for SUBDIRS, but we do not use them here (why, btw?) -+%.o: -+ @@MKDIR_P@ $(@D) - $(CC) -MD @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - @cp $*.d $*.P; \ - sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ - -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ - #rm -f $*.d - --%.lo: %.c -+%.lo: -+ @@MKDIR_P@ $(@D) - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - - %: %.o -@@ -101,16 +112,15 @@ prog/%: prog/%.o - - ### GENERATED INCLUDES - --# FIXME: add absolute path of source files below - $(OBJECTS): headers/drivers.h - --headers/drivers.h: $(GDRIVERS) ../scripts/generate_drivers_header.sh -- ../scripts/generate_drivers_header.sh . > $@ -+headers/drivers.h: $(addprefix $(srcdir)/,$(GDRIVERS)) $(top_srcdir)/scripts/generate_drivers_header.sh -+ $(top_srcdir)/scripts/generate_drivers_header.sh $(srcdir) > $@ - - #-include $(SRCSP) - - Makefile.drivers.generated: -- ../scripts/generate_drivers_makefile.sh . > $@ -+ $(top_srcdir)/scripts/generate_drivers_makefile.sh $(srcdir) > $@ - - ### INSTALL - check: all -@@ -160,8 +170,8 @@ prog/gpm-root: prog/gpm-root.c lib/libgpm.so - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so - --prog/mouse-test: prog/mouse-test.o mice.o prog/open_console.o \ -- $(GCOMMON:.c=.o) $(GDRIVERS:.c=.o) -+prog/mouse-test: prog/mouse-test.o mice.o prog/open_console.o \ -+ $(GSRC:.c=.o) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - - $(PROG): lib/libgpm.so --- -1.5.5 - -_______________________________________________ -gpm mailing list -gpm@lists.linux.it -http://lists.linux.it/listinfo/gpm diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz deleted file mode 100644 index bf630ad0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/MS3-PATCH-ANDREW-rediffed.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/MS3-PATCH-ANDREW.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/MS3-PATCH-ANDREW.gz deleted file mode 100644 index bf1a6d33..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/MS3-PATCH-ANDREW.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/OPEN_MAX.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/OPEN_MAX.gz deleted file mode 100644 index 98d577a9..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/OPEN_MAX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/VSXXX-AA-patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/VSXXX-AA-patch.gz deleted file mode 100644 index de76a90f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/VSXXX-AA-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_1.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_1.gz deleted file mode 100644 index 969a4294..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_2.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_2.gz deleted file mode 100644 index 03d782e1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_2.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_3.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_3.gz deleted file mode 100644 index 61655fbc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/andreas_mohr_3.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_12.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_12.gz deleted file mode 100644 index d27fb356..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_12.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_3rd-final?.tar.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_3rd-final?.tar.gz deleted file mode 100644 index 2317ced5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_3rd-final?.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_c_7.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_c_7.gz deleted file mode 100644 index 0c0e799b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/diff_synaptics_c_7.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/evdev.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/evdev.patch.gz deleted file mode 100644 index 11cfee16..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/evdev.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz deleted file mode 100644 index e09018f2..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.3-owl-warnings.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz deleted file mode 100644 index 9c37a865..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.4-syn_wmode-1.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz deleted file mode 100644 index ab2a7433..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.6-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz deleted file mode 100644 index 118b8572..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.19.6-to-blaise.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.20.0-wheel.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.20.0-wheel.patch.gz deleted file mode 100644 index ef7450ba..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.20.0-wheel.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz deleted file mode 100644 index e2c494a0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm-1.20.1rc1-alt-fix_abi.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm06122002-cvs-tty.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm06122002-cvs-tty.patch.gz deleted file mode 100644 index fa16c22b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm06122002-cvs-tty.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm_synaptic_diff.gtar.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm_synaptic_diff.gtar.gz deleted file mode 100644 index 6872e2b8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm_synaptic_diff.gtar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm_unsigned_patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm_unsigned_patch.gz deleted file mode 100644 index 1f5b8862..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/gpm_unsigned_patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/repeater-patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/repeater-patch.gz deleted file mode 100644 index 4a590a94..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/repeater-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/repeater-patch.mail.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/repeater-patch.mail.gz deleted file mode 100644 index 8232d220..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/repeater-patch.mail.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/shlib-patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/shlib-patch.gz deleted file mode 100644 index 54a5cc01..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/applied/shlib-patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-1.19.3-serialconsole.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-1.19.3-serialconsole.patch deleted file mode 100644 index 65a54431..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-1.19.3-serialconsole.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- gpm-1.19.3/gpm.c.serialconsole Fri Jan 5 14:10:46 2001 -+++ gpm-1.19.3/gpm.c Fri Jan 5 14:39:28 2001 -@@ -38,6 +38,7 @@ - #include /* struct sockaddr_un */ - - #include /* VT_GETSTATE */ -+#include /* for serial console check */ - #include /* KDGETMODE */ - #include /* winsize */ - -@@ -142,10 +143,25 @@ - static inline int open_console(const int mode) - { - int fd; -- -- if ((fd=open(consolename, mode)) < 0) -- oops(consolename); -- return fd; -+ struct stat sb; -+ int maj, twelve=12; -+ struct serial_struct si; -+ -+ fd = open(consolename, mode); -+ if (fd != -1) { -+ fstat(fd, &sb); -+ maj = major(sb.st_rdev); -+ if (maj != 4 && (maj < 136 || maj > 143)) { -+ if (ioctl (fd, TIOCLINUX, &twelve) < 0) { -+ if (ioctl (fd, TIOCGSERIAL, &si) >= 0) { -+ if (si.line > 0) -+ oops("we seem to be on a serial console"); -+ } -+ } -+ } -+ return fd; -+ } else -+ oops(consolename); - } - - /*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz deleted file mode 100644 index 28865c75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-1.19.3-serialconsole.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-diff-first b/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-diff-first deleted file mode 100644 index 5d3e01ab..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-diff-first +++ /dev/null @@ -1,1047 +0,0 @@ -diff -u -w ../../gpm-1.19.6/src/debuglog.c ./debuglog.c ---- ../../gpm-1.19.6/src/debuglog.c Sun Dec 30 00:56:34 2001 -+++ ./debuglog.c Sat Dec 29 15:13:48 2001 -@@ -37,6 +37,7 @@ - # endif - #endif - -+#include /* exit */ - #include - #include - #include -@@ -74,13 +75,14 @@ - gpm_oops(char *f, int n, char *s, ...) - { - if (LOG_ERR <= gpm_debug_level) { -- int pri; - va_list ap; - - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -+ int pri; - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); -- strcpy(buf, s); strcat(buf, fmt); -+ strcpy(buf, s); -+ strcat(buf, fmt); - #endif - - va_start(ap, s); -diff -u -w ../../gpm-1.19.6/src/gpm-root.y ./gpm-root.y ---- ../../gpm-1.19.6/src/gpm-root.y Sun Dec 30 00:56:34 2001 -+++ ./gpm-root.y Sat Dec 29 15:17:40 2001 -@@ -1196,7 +1196,7 @@ - Draw *draw=NULL; - DrawItem *item; - char s[80]; -- int posty, postx, postX; -+ int posty=0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ -diff -u -w ../../gpm-1.19.6/src/gpm.c ./gpm.c ---- ../../gpm-1.19.6/src/gpm.c Sun Dec 30 00:56:34 2001 -+++ ./gpm.c Sat Dec 29 21:53:12 2001 -@@ -27,6 +27,7 @@ - #include - #include /* select(); */ - #include /* SIGPIPE */ -+#include /* time */ - #include - #include /* O_RDONLY */ - #include /* wait() */ -@@ -235,6 +251,7 @@ - } - - fd=open_console(O_WRONLY); -+ gpm_debug_log(LOG_DEBUG,"Paste %i",c); - if (ioctl(fd, TIOCLINUX, &c) < 0) - oops("ioctl(TIOCLINUX)"); - close(fd); -@@ -386,8 +407,25 @@ - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -+ -+ /* Better debug output -+ 29/12/2001 02:12. pebl*/ -+ switch (protocol->packetlength) -+ { -+ case 4: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x",data[0],data[1],data[2],data[3]); -+ break; -+ case 5: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4]); -+ break; -+ case 6: -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x %02x %02x %02x",data[0],data[1],data[2],data[3],data[4],data[5]); -+ break; -+ default: - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ } -+ - return data; - } - -@@ -532,7 +586,10 @@ - * Return information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc - */ -- if (time(NULL)<=awaketime) return 0; -+ if (time(NULL)<=awaketime){ -+ gpm_debug_log(LOG_DEBUG,"No dy, dx or buttons"); -+ return 0; -+ } - awaketime=time(NULL)+1; - break; - } -@@ -1104,7 +1169,7 @@ - continue; - } - -- gpm_debug_log(LOG_DEBUG,"selected %i times",pending); -+ gpm_debug_log(LOG_DEBUG,"select returned %i fd",pending); - - /*....................................... manage graphic mode */ - -diff -u -w ../../gpm-1.19.6/src/gpn.c ./gpn.c ---- ../../gpm-1.19.6/src/gpn.c Sun Dec 30 00:56:34 2001 -+++ ./gpn.c Sat Dec 29 14:27:12 2001 -@@ -460,7 +463,7 @@ - check_uniqueness(); - gpm_debug_log(LOG_INFO,"Signed"); - -- } /*if*/ -+ } /*if(gpm_log_daemon)*/ - - /* - * well, I used to create a symlink in the /tmp dir to be compliant with old -diff -u -w ../../gpm-1.19.6/src/libcurses.c ./libcurses.c ---- ../../gpm-1.19.6/src/libcurses.c Sun Dec 30 00:56:34 2001 -+++ ./libcurses.c Fri Dec 21 16:13:05 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -w ../../gpm-1.19.6/src/liblow.c ./liblow.c ---- ../../gpm-1.19.6/src/liblow.c Sun Dec 30 00:56:34 2001 -+++ ./liblow.c Fri Dec 21 16:13:11 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -u -w ../../gpm-1.19.6/src/mice.c ./mice.c ---- ../../gpm-1.19.6/src/mice.c Sun Dec 30 00:56:34 2001 -+++ ./mice.c Sat Dec 29 21:35:11 2001 -@@ -93,7 +93,7 @@ - - static int parse_argv(argv_helper *info, int argc, char **argv) - { -- int i, j, errors = 0; -+ int i, j=0, errors = 0; - long l; - argv_helper *p; - char *s, *t; -@@ -595,8 +605,8 @@ - * and then switch to 4-byte mode. - */ - static unsigned char prev=0; - static Gpm_Type *mytype=mice; /* it is the first */ -- unsigned char b; -+ unsigned char b = 0; - - if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2) - { -@@ -665,10 +675,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /* {"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -2045,6 +2107,7 @@ - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) -+ * Flags: - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" -diff -u -w ../../gpm-1.19.6/src/mouse-test.c ./mouse-test.c ---- ../../gpm-1.19.6/src/mouse-test.c Sun Dec 30 00:56:34 2001 -+++ ./mouse-test.c Sat Dec 29 21:55:30 2001 -@@ -335,7 +371,7 @@ - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" -- " avoid this step\r\n. Different baud rates are tried at " -+ " avoid this step.)\r\n Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec=10; /* max test time */ -@@ -375,7 +436,7 @@ - } - } - -- } /* devcount>1 */ -+ } /* while(devcount>1) */ - - mousefd=devlist->fd; - mousename=devlist->name; -diff -u -w ../../gpm-1.19.6/src/synaptics.c ./synaptics.c ---- ../../gpm-1.19.6/src/synaptics.c Sun Dec 30 00:56:34 2001 -+++ ./synaptics.c Sat Dec 29 21:20:17 2001 -@@ -212,48 +238,49 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled }}, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled }}, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled }}, -+ { "taps_enabled", Flag_Param, {&taps_enabled }}, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled }}, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled }}, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed }}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure }}, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure }}, -+ { "pressure_factor", Float_Param, {&pressure_factor }}, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor }}, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time }}, -+ { "max_toss_time", Integer_Param, {&max_toss_time }}, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time }}, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist }}, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed }}, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor }}, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed }}, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0] }}, -+ { "lower_left_action", Corner_Param, {&corner_actions [1] }}, -+ { "upper_right_action", Corner_Param, {&corner_actions [2] }}, -+ { "lower_right_action", Corner_Param, {&corner_actions [3] }}, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode }}, -+ { "finger_threshold", Integer_Param, {&finger_threshold }}, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit }}, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit }}, -+ { "tap_range", Integer_Param, {&tap_range }}, -+ { "tap_interval", Integer_Param, {&tap_interval }}, -+ { "drag_lock", Flag_Param, {&drag_lock }}, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay }}, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL }} - }; - - - /* - ** The information returned in the identification packet. -+** STIG page 10 - */ - typedef struct { - int info_model_code; -@@ -264,7 +291,19 @@ - - /* - ** The information returned in the model ID packet. -+** STIG page 11 - */ -+ -+#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -+#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -+#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -+#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -+#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -+#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -+#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -+#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ -+ -+ - typedef struct { - int info_rot180; - int info_portrait; -@@ -276,83 +315,37 @@ - int info_geometry; - } model_id_type; - --/* --** The information returned in the extended capibility packet. --*/ -- --typedef struct { -- int cap_ext; -- int cap_sleep; -- int cap_four_button; -- int cap_multi_finger; -- int cap_palm_detect; --} ext_cap_type; -- --/* --** The format of the reported absolute data. --*/ --typedef struct { -- int gesture; -- int finger; -- int left; -- int middle; -- int down; -- int right; -- int x; -- int y; -- int pressure; --} report_type; -- -- --/* --** A location record. --*/ --typedef struct { -- int x; -- int y; --} location_type; -- - - /* --** The information in the mode byte. -+** The sensor types as of STIG 2.5 -+** Page 11 - */ --#define RELATIVE_MODE 0x00 --#define ABSOLUTE_MODE 0x80 --#define LOW_REPORT_RATE 0x00 --#define HIGH_REPORT_RATE 0x40 --#define USE_1200_BAUD 0x00 --#define USE_9600_BAUD 0x08 --#define PS2_NO_SLEEP 0x00 --#define PS2_SLEEP 0x08 --#define NORMAL_REPORT 0x00 --#define EXTENDED_REPORT 0x02 --#define REPORT_W_OFF 0x00 --#define REPORT_W_ON 0x01 -- -- - static char *model_names [] = { - "Unknown", -- "Standard TouchPad", -- "Mini Module", -- "Super Module", -+ "Standard TouchPad (TM41xx134)", -+ "Mini Module (TM41xx156)", -+ "Super Module (TM41xx180)", - "", - "", - "", -- "Flexible pad", -- "Ultra-thin Module", -- "Wide pad Module", -+ "Flexible pad (discontinued)", -+ "Ultra-thin Module (TM41xx220)", -+ "Wide pad Module (TW41xx230)", - "", -- "Stamp pad Module", -- "Sub-mini Module", -- "TBD", -+ "Stamp pad Module (TM41xx240)", -+ "Sub-mini Module (TM41xx140)", -+ "MultiSwitch module (TBD)", - "", -- "Advanced Technology pad", -+ "Advanced Technology pad (TM41xx221)", - "Ultra-thin Module, connector reversed" - }; - - - /* - ** Define the information known about a sensor. -+** STIG page 14. -+** Resolution only apply for absolute mode. -+** For older models the default resulotion is 85x94. - */ - typedef struct { - char *model; -@@ -381,6 +374,76 @@ - - - /* -+** The information returned in the extended capability packet. -+** STIG page 15 -+*/ -+ -+#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -+#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -+#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -+#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -+#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ -+ -+typedef struct { -+ int cap_ext; -+ int cap_sleep; -+ int cap_four_button; -+ int cap_multi_finger; -+ int cap_palm_detect; -+} ext_cap_type; -+ -+ -+ -+/* -+** The information in the mode byte. -+** STIG Page 17 -+*/ -+#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -+#define RELATIVE_MODE 0x00 /* Bit */ -+#define HIGH_REPORT_RATE 0x40 /* Bit 6 set 0 = 80 packages per second */ -+#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -+#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -+#define USE_1200_BAUD 0x00 /* Bit */ -+#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -+#define PS2_NO_SLEEP 0x00 /* Bit */ -+#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -+#define TAPDRAG_GESTURE 0x00 /* Bit */ -+#define EXTENDED_REPORT 0x02 /* Bit 1 for serial absolute mode only */ -+#define NORMAL_REPORT 0x00 /* Bit */ -+#define REPORT_W_ON 0x01 /* Bit 0 set */ -+#define REPORT_W_OFF 0x00 /* Bit */ -+ -+ -+ -+/* -+** The format of the reported absolute data. -+*/ -+typedef struct { -+ int gesture; -+ int finger; -+ int left; -+ int middle; -+ int down; -+ int right; -+ int x; -+ int y; -+ int pressure; -+} report_type; -+ -+ -+/* -+** A location record. -+** This is needed to make an average over several packages, -+** because the reported x,y might not be that accurate. -+*/ -+typedef struct { -+ int x; -+ int y; -+} location_type; -+ -+ -+ -+/* - ** Parameters for controlling the touchpad. - */ - /* touchpad information */ -@@ -417,7 +481,8 @@ - ** - ****************************************************************************/ - -+/* Get model name, STIG page 11 */ - static char *syn_model_name (int sensor) - { - if (sensor < 0 || sensor > 16) { - return "Reserved"; -@@ -427,24 +492,27 @@ - } - - --/* convert the model id from bits to values */ -+/* convert the model id from bits to values -+* STIG page 11 -+*/ - void extract_model_id_info (int model_int, model_id_type *model) - { -- model->info_rot180 = check_bits (model_int, 0x00800000); -- model->info_portrait = check_bits (model_int, 0x00400000); -- model->info_sensor = (model_int & 0x003f0000) >> 16; -- model->info_hardware = (model_int & 0x0000fe00) >> 8; -- model->info_new_abs = check_bits (model_int, 0x00000080); -- model->info_cap_pen = check_bits (model_int, 0x00000040); -- model->info_simple_cmd = check_bits (model_int, 0x00000020); -- model->info_geometry = model_int & 0x0000000f; -+ model->info_rot180 = check_bits (model_int, INFO_ROT180_BITS); -+ model->info_portrait = check_bits (model_int, INFO_PORTRAIT_BITS); -+ model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; -+ model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; -+ model->info_new_abs = check_bits (model_int, INFO_NEW_ABS_BITS); -+ model->info_cap_pen = check_bits (model_int, INFO_CAP_PEN_BITS); -+ model->info_simple_cmd = check_bits (model_int, INFO_SIMPLE_CMD_BITS); -+ model->info_geometry = (model_int & INFO_GEOMETRY_BITS); - } - - --/* Translate the reported data into a record for processing */ -+/* Translate the reported data into a record for processing -+ * STIG page 14*/ - static sensor_info_type *syn_get_sensor_info (int sensor_id) - { -- if (sensor_id < 0 || sensor_id > 12) { -+ if (sensor_id < 0 || 12 < sensor_id ) { - return &sensor_info [0]; - } else { - return &sensor_info [sensor_id]; -@@ -519,14 +589,14 @@ - int edges) - { - gpm_debug_log (LOG_DEBUG, -- "\r%c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", -+ "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %c%c%c%c %c%c", - report.gesture ? 'g' : '-', - report.finger ? 'f' : '-', - - report.left ? 'l' : '-', - report.middle ? 'm' : '-', -- - report.right ? 'r' : '-', -+ - report.x, report.y, report.pressure, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', -@@ -637,6 +707,7 @@ - last_edges = edges; - packet_num++; - } else { -+ /* No finger on the pad */ - /* handle the tossing action if enabled */ - if (tossing_enabled && !was_tossing && - last_finger && -@@ -1045,66 +1120,127 @@ - /* Adapted from tpconfig.c by C. Scott Ananian */ - /*------------------------------------------------------------------------*/ - -+/* PS2 Synaptics is using LSB, STIG page 29. -+** -+** After power on or reset: -+** 100 samples per second -+** Resolution is 4 counts per mm -+** Scaling 1:1 -+** Stream mode is selected -+** Data reporting is disabled -+** Absolte mode is disabled -+*/ -+ -+/* Normal ps2 commands, Command set is on STIG page 33 */ -+#define PS2_RESET 0xFF /* Reset */ -+#define PS2_RESEND 0xFE /* Resend command */ -+#define PS2_ERROR 0xFC /* Error, after an resend or disconnect*/ -+#define PS2_ACK 0xFA /* Command acknowledge */ -+#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to the following byte */ -+#define PS2_READ_DEVICE 0xF2 /* Read device type */ -+#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -+#define PS2_STATUS_REQ 0xE9 /* Send status request */ -+#define PS2_RESOLUTION 0xE8 /* Set resolution, to following transmitted byte */ -+#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ -+ -+ -+/* Additional commands*/ -+#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte encodes a command*/ -+#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -+#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is recognized */ -+#define PS2_SYN_IDCODE 0x00 -+#define PS2_SYN_SET_MODE 0x14 /* Set the mode instead of sample rate (used after a sample rate cmd) */ -+ -+ -+/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -+#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -+#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -+#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -+#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -+#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -+#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -+#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ -+ -+ -+ -+ - typedef unsigned char byte; - -+/* read a byte from the ps/2 port */ -+static byte ps2_getbyte(int fd) -+{ -+ byte b; -+ -+ read(fd, &b, 1); -+ return b; -+} -+ -+ - /* write a byte to the ps/2 port, handling ACK */ - static void ps2_putbyte(int fd, - byte b) - { - byte ack; -+ - write(fd, &b, 1); - read(fd, &ack, 1); -- if (ack != 0xFA) -+ /* Should check for resend code PS2_RESEND also */ -+ if (ack != PS2_ACK) - gpm_debug_log (LOG_ERR,"Invalid ACK in synps2 initialization"); - } - --/* read a byte from the ps/2 port */ --static byte ps2_getbyte(int fd) --{ -- byte b; -- read(fd, &b, 1); -- return b; --} -- --/* use the Synaptics extended ps/2 syntax to write a special command byte */ -+/* use the Synaptics extended ps/2 syntax to write a special command byte -+* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -+* and after each a byte with the 2 first bits being the command (LSB). End it with -+* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -+* first so not have five or more PS2_SYN_CMD by coincident. -+*/ - static void ps2_send_cmd(int fd, - byte cmd) - { - int i; -+ - /* initialize with 'inert' command */ -- ps2_putbyte(fd, 0xE6); -+ ps2_putbyte(fd, PS2_SYN_INERT); - for (i=0; i<4; i++) { -- ps2_putbyte(fd, 0xE8); -+ ps2_putbyte(fd, PS2_SYN_CMD); - ps2_putbyte(fd, (cmd>>6)&0x3); - cmd<<=2; - } - } - --/* write 'cmd' to mode byte 1 */ -+/* write 'cmd' to mode byte 1. -+ * See ps2_send_cmd */ - static void ps2_set_mode1(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); - ps2_putbyte(fd, 0x0A); - } - --/* write 'cmd' to mode byte 2 */ -+/* write 'cmd' to mode byte 2 -+ * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the -+ * four PS2_SYN_CMD commands -+ */ - static void ps2_set_mode2(int fd, - byte cmd) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xF3); -- ps2_putbyte(fd, 0x14); -+ ps2_putbyte(fd, PS2_SAMPLE_RATE); -+ ps2_putbyte(fd, PS2_SYN_SET_MODE); - } - --/* read three byte status ('a','b','c') corresponding to register 'cmd' */ -+/* read three byte status ('a','b','c') corresponding to register 'cmd' -+* Special status request for synatips is given after a cmd. -+* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -+*/ - static void ps2_status_rqst(int fd, - byte cmd, - byte *bytes) - { - ps2_send_cmd(fd, cmd); -- ps2_putbyte(fd, 0xE9); -+ ps2_putbyte(fd, PS2_STATUS_REQ); - bytes [0]=ps2_getbyte(fd); - bytes [1]=ps2_getbyte(fd); - bytes [2]=ps2_getbyte(fd); -@@ -1117,8 +1253,8 @@ - { - byte bytes [3]; - -- ps2_status_rqst (fd, 0x00, bytes); -- if (bytes [1] != 0x47) { -+ ps2_status_rqst (fd, PS2_SYN_CMD_IDENTIFY, bytes); -+ if (bytes [1] != PS2_SYN_STATUS_OK) { - printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); - } else { - info->info_minor = bytes [0]; -@@ -1128,6 +1264,36 @@ - } - - -+ -+ -+/* read the extended capibility from the ps2 touchpad, STIG page 15 */ -+static void syn_read_ps2_cap (int fd, -+ ext_cap_type *cap) -+{ -+ unsigned char bytes [3]; -+ ps2_status_rqst (fd, PS2_SYN_CMD_CAPABILITIES, bytes); -+ -+ if (bytes [1] != PS2_SYN_STATUS_OK) { -+ printf ("PS/2 device doesn't appear to be a synaptics touchpad\n"); -+ } -+ -+ cap->cap_ext = check_bits (bytes[0], EXT_CAP_EXTENDED >> 16); -+ -+ /* If the extended bit is not set it should be assumed that neither of the -+ other capabilites is availible.*/ -+ if(cap->cap_ext){ -+ cap->cap_sleep = check_bits (bytes[2], EXT_CAP_SLEEP); -+ cap->cap_four_button = check_bits (bytes[2], EXT_CAP_FOUR_BUTTON); -+ cap->cap_multi_finger = check_bits (bytes[2], EXT_CAP_MULTI_FINGER); -+ cap->cap_palm_detect = check_bits (bytes[2], EXT_CAP_PALM_DETECT); -+ }else{ -+ cap->cap_sleep = 0; -+ cap->cap_four_button = 0; -+ cap->cap_multi_finger = 0; -+ cap->cap_palm_detect = 0; -+ } -+} -+ - /* read the model_id from the ps2 touchpad */ - static void syn_read_ps2_model_id (int fd, - model_id_type *model) -@@ -1135,75 +1301,97 @@ - unsigned char bytes [3]; - int model_int; - -- ps2_status_rqst (fd, 0x03, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes [0] << 16) | - (bytes [1] << 8) | -- bytes [2]); -+ (bytes [2])); - extract_model_id_info (model_int, model); - } - --/* read the extended capibility from the ps2 touchpad */ --static void syn_read_ps2_cap (int fd, -- ext_cap_type *cap) --{ -- unsigned char bytes [3]; -- ps2_status_rqst (fd, 0x02, bytes); -- cap->cap_ext = check_bits (bytes[0], 0x80); -- cap->cap_sleep = check_bits (bytes[2], 0x10); -- cap->cap_four_button = check_bits (bytes[2], 0x08); -- cap->cap_multi_finger = check_bits (bytes[2], 0x02); -- cap->cap_palm_detect = check_bits (bytes[2], 0x01); --} - - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { - unsigned char bytes [3]; - -- ps2_status_rqst (fd, 0x01, bytes); -+ ps2_status_rqst (fd, PS2_SYN_CMD_MODES, bytes); - #if DEBUG_SENT_DATA - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } - -+ -+/* -+ * Translate the incomming data to an uniform report -+ * -+ */ -+ -+/* STIG page 42 -+ * wmode = 0, newer version. Gesture, right and left are repeated. -+ * -+ * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ * STIG page 43 -+ * wmode = 0, old version < 3.2. -+ * Second is a second gesture!? -+ * -+ * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | -+ * byte 1 | finger | 0 | 0 | x-pos 12-8 | -+ * byte 2 | x-pos 0-7 | -+ * byte 3 | 1 | 0 | z-pressure 0-5 | -+ * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | -+ * byte 5 | y - pos 0-7 | -+ * -+ -+ */ -+ - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, - report_type *report) - { - int i; - -- if (((data [0] & 0xc8) == 0x80) && -- ((data [3] & 0xc8) == 0xc0) && -- ((data [0] & 0x0f) == (data [3] & 0x0f))) { -+ /* Check that this is indead an absolute 6 byte new version packet*/ -+ if (((data [0] & 0xc8) == 0x80) && /* Check static in byte 0 */ -+ ((data [3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ -+ ((data [0] & 0x0F) == (data [3] & 0x0F))) { /* check repeated date */ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [0], 0x20); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); - report->x = (((data [1] & 0x0f) << 8) | - ((data [3] & 0x10) << 8) | -- data [4]); -- report->y = (((data [1] & 0xf0) << 4) | -+ ((data [4]))); -+ report->y = (((data [1] & 0xF0) << 4) | - ((data [3] & 0x20) << 7) | -- data [5]); -+ ((data [5]))); - report->pressure = data [2]; -- } else if (((data [0] & 0xc0) == 0xc0) && -- ((data [1] & 0x60) == 0x00) && -- ((data [3] & 0xc0) == 0x80) && -- ((data [4] & 0x60) == 0x00)) { -+ } /* Old style packet maybe */ -+ else if (((data [0] & 0xC0) == 0xC0) && /* Static in byte 0*/ -+ ((data [1] & 0x60) == 0x00) && /* Static in byte 1*/ -+ ((data [3] & 0xC0) == 0x80) && /* Static in byte 3*/ -+ ((data [4] & 0x60) == 0x00)) { /* Static in byte 4*/ - report->gesture = check_bits (data [0], 0x04); - report->finger = check_bits (data [1], 0x80); - report->left = check_bits (data [0], 0x01); - report->middle = 0; - report->right = check_bits (data [0], 0x02); -- report->x = (((data [1] & 0x1f) << 8) | -- data [2]); -+ report->x = (((data [1] & 0x1F) << 8) | -+ ((data [2]))); - report->y = (((data [4] & 0x1f) << 8) | -- data [5]); -+ ((data [5]))); - report->pressure = (((data [0] & 0x30) << 2 ) | -- (data [3] & 0x3f)); -- } else { -- gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); -+ ((data [3] & 0x3f))); -+ } else { /* Garbage or not -+ * The synaptics pad keeps sending data 1 sec after last touch -+ */ -+ gpm_debug_log (LOG_NOTICE,"Garbage or tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); - report->gesture = 0; -@@ -1217,56 +1405,79 @@ - } - } - -+ -+/* STIG page 42 -+ * wmode = 1, -+ * -+ * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | -+ * byte 1 | y-pos 11-8 | x-pos 11-8 | -+ * byte 2 | z pressure 0-7 | -+ * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | -+ * byte 4 | x - pos 0-7 | -+ * byte 5 | y - pos 0-7 | -+ * -+ */ -+ - static void syn_translate_ps2_wmode_report (unsigned char *data, - report_type *report) - { - int i; -- static int finger_timer = 0; -- static int gesture_timer = 0; -+ static int finger_on_pad_timer = 0; -+ static int time_to_forget_tap = 0; - static int gesture_delay = 0; - static int stroke_x; - static int stroke_y; - static int drag_locked = 0; - -+ /* Check that it is an absolute packet */ - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -+ -+ unsigned int w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); -+ ((data[0] & 0x30) >> 2)); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); - report->right = check_bits (data[0], 0x02); -- report->x = (((data[1] & 0x0f) << 8) | -+ report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | -- data[4]); -- report->y = (((data[1] & 0xf0) << 4) | -+ ((data[4]))); -+ report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | -- data[5]); -+ ((data[5]))); - report->pressure = data[2]; - report->finger = (data[2] > finger_threshold); - - if (report->finger) { - -- if (finger_timer == 0) { /* finger down */ -+ if (finger_on_pad_timer == 0) { /* finger down for the first time */ - stroke_x = report->x; - stroke_y = report->y; - } - -- if (finger_timer < (tap_upper_limit * 80 / 1000)) finger_timer ++; /* don't want timer to overflow */ -- -- if (gesture_timer > 0) gesture_timer = 1; /* dragging or consecutive tap, gesture to end with finger up */ -+ /* don't want timer to overflow */ -+ if (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) -+ finger_on_pad_timer ++; -+ -+ /* dragging or consecutive tap, gesture to end with finger up -+ * forget fast that there was a tap if this is not a part of a tap.*/ -+ if (time_to_forget_tap > 0) -+ time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - -- /* tap determination */ -- if ((finger_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -- (finger_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ -+ /* tap determination: Was the finger long enough on the pad and not too -+ * long, while staying at the same place. -+ */ -+ if ((finger_on_pad_timer > (tap_lower_limit * 80 / 1000)) && /* minimum finger down time */ -+ (finger_on_pad_timer < (tap_upper_limit * 80 / 1000)) && /* maximum finger down time */ - (distance((double)(stroke_x - report->x), /* maximum range for finger to drift while down */ - (double)(stroke_y - report->y)) - < sqr((double)tap_range))) { - - /* not a consecutive tap? */ -- if (gesture_timer == 0) gesture_delay = 0; /* right -> don't delay gesture */ -+ if (time_to_forget_tap == 0) -+ gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_click_delay * 80 / 1000; /* delay gesture to create multiple click */ - } -@@ -1274,28 +1485,32 @@ - /* is drag locked */ - if (drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ -- gesture_timer = 0; -- } else gesture_timer = tap_interval * 80 / 1000; /* setup gesture time to count down */ -+ time_to_forget_tap = 0; -+ } else -+ time_to_forget_tap = tap_interval * 80 / 1000; /* setup gesture time to count down */ - -- } else { -+ } else { /* It was not a tap */ - -- /* a drag to lock? */ -- if (drag_lock && (gesture_timer > 0) && (finger_timer >= (tap_upper_limit * 80 / 1000))) -+ /* a drag to lock? If user did a tap and quickly hold the finger longer than a tap. -+ */ -+ if (drag_lock && (time_to_forget_tap > 0) && (finger_on_pad_timer >= (tap_upper_limit * 80 / 1000))) - drag_locked = 1; - -- if (gesture_timer > 0) gesture_timer --; -+ if (time_to_forget_tap > 0) time_to_forget_tap --; - if (gesture_delay > 0) gesture_delay --; - - } - -- finger_timer = 0; -+ finger_on_pad_timer = 0; - - } - -- report->gesture = ((gesture_timer > 0) && (gesture_delay == 0)) || drag_locked; -+ report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) || drag_locked; - report->left = (report->left || report->gesture); - -- } else { -+ } else { /* Packet is garbage or not?? The synaptics pad keeps sending data 1 -+ * sec after last touch, -+ */ - gpm_debug_log (LOG_NOTICE,"tossing PS/2 data: "); - for (i = 0; i < 6; i++) - gpm_debug_log (LOG_NOTICE,"%02X ", data [i]); -@@ -1343,8 +1558,11 @@ - { - report_type report; - -- if (use_wmode) syn_translate_ps2_wmode_report (data, &report); -- else syn_translate_ps2_report (data, &report); -+ if (use_wmode) -+ syn_translate_ps2_wmode_report (data, &report); -+ else -+ syn_translate_ps2_report (data, &report); -+ - syn_process_data (state, report); - } - -@@ -1394,7 +1612,8 @@ - syn_read_ps2_ident (fd, &ident); - syn_read_ps2_model_id (fd, &model); - syn_read_ps2_cap (fd, &cap); -- if (! (cap.cap_ext)) use_wmode = 0; /* wmode not support by the pad */ -+ if (! (cap.cap_ext)) -+ use_wmode = 0; /* wmode not support by the pad */ - syn_process_config (ident, model); - - /* select 6 byte packet, high packet rate, no-sleep */ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-diff-first.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-diff-first.gz deleted file mode 100644 index 2385f3bc..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/need_update/gpm-diff-first.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/nice_but_refused/compat.c b/software/gpm/browse_source/gpm-1.99.7/patches/done/nice_but_refused/compat.c deleted file mode 100644 index e2a85617..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/nice_but_refused/compat.c +++ /dev/null @@ -1,144 +0,0 @@ -#include -#include -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -# include -#else -# define minor(dev) (((unsigned int) (dev)) >> 8) -# define major(dev) ((dev) & 0xff) -#endif - -#ifdef HAVE_LINUX_MAJOR_H -# include -#else -# ifndef TTY_MAJOR -# define TTY_MAJOR 4 -# endif -# ifndef VCS_MAJOR -# define VCS_MAJOR 7 -# endif -#endif - -#include "gpmInt.h" - -/* - * Arghhh. check_devfs was soo brain dead. We just need to determine - * whether or not we are using devfs. In that case we should do the - * nice thing and return a boolean value. - * - * To do this we check if the /dev/.devfsd file exists. If it does, - * then we are most likely running devfs. We should write another - * function which returns the /dev/XXX portion of the appropriate - * devices. This is a start and a building block for such a function. - */ - -int using_devfs(void) -{ - struct stat devfs_node; - - return (stat("/dev/.devfsd", (&devfs_node)) - && S_ISCHR(devfs_node.st_mode)); -} - -#define LOOP_SET_SUCCESS_MAJOR(var,dev_major,stat) \ -do { \ - for(i=0; var##_name[i] != NULL; i++) \ - if (stat(var##_name[i], &buf) == 0 \ - && S_ISCHR(buf.st_mode) \ - && major(buf.st_rdev) == dev_major \ - && minor(buf.st_rdev) == 0) \ - \ - return var = var##_name[i]; \ -} while(0) - -/* We may not be able to open the silly thing!!! */ - -const char *get_virtualconsole0(void) -{ - static const char *const console_name[] = { - _PATH_TTY "0", - "/dev/tty0", - "/dev/vc/0", - NULL - }; - static const char *console = NULL; - struct stat buf; - int i; - - if(console) - return console; - - LOOP_SET_SUCCESS_MAJOR(console, TTY_MAJOR, lstat); - - /* - * If we failed as yet ... try again, this time with stat. Someone is bound - * to leave a symlink around for compatiblity. - */ - - LOOP_SET_SUCCESS_MAJOR(console, TTY_MAJOR, stat); - - oops("Unable to determine virtual console device"); -} - -const char *get_virtualconsole_base(void) -{ - static char *console_base = NULL; - - if(console_base == NULL) { - console_base = strdup(get_virtualconsole0()); - console_base[strlen(console_base) - 1] = '\0'; - } - - return console_base; -} - -const char *get_virtualscreen0(void) -{ - static const char *const screen_name[] = { - "/dev/vcs", - "/dev/vcs0", - "/dev/vcc/0", - NULL - }; - static const char *screen = NULL; - struct stat buf; - int i; - - if(screen) - return screen; - - LOOP_SET_SUCCESS_MAJOR(screen, VCS_MAJOR, lstat); - - /* - * try again ... maybe there are others ... at least we can assume some - * compatiblity from time to time... - */ - - LOOP_SET_SUCCESS_MAJOR(screen, VCS_MAJOR, stat); - - oops("Unable to determine virtual console screen device"); -} - -const char *get_virtualscreen_base(void) -{ - static char *screen_base = NULL; - - if(screen_base == NULL) { - screen_base = strdup(get_virtualscreen0()); - if(using_devfs() - || screen_base[strlen(screen_base) - 1] == '0') - screen_base[strlen(screen_base) - 1] = '\0'; - } - - return screen_base; -} - -/* Local Variables: */ - -/* tab-width:8 */ - -/* c-indent-level:4 */ - -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/nice_but_refused/compat.h b/software/gpm/browse_source/gpm-1.99.7/patches/done/nice_but_refused/compat.h deleted file mode 100644 index e9878f3d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/nice_but_refused/compat.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TTY_NAME_MAX 32 - -const char * get_virtualconsole0( void ); -const char * get_virtualconsole_base( void ); -const char * get_virtualscreen0( void ); -const char * get_virtualscreen_base( void ); diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/gpm-1.19.3-8owl.tar b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/gpm-1.19.3-8owl.tar deleted file mode 100644 index 4f7b671c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/gpm-1.19.3-8owl.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/gpm-1.19.3-8owl.tar.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/gpm-1.19.3-8owl.tar.gz deleted file mode 100644 index 33b82141..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/gpm-1.19.3-8owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect deleted file mode 100644 index 62d26da2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect +++ /dev/null @@ -1,213 +0,0 @@ -From - Fri Jul 27 00:24:34 2001 -Return-Path: -Delivered-To: nico@schottelius.org -Received: (qmail 18456 invoked by uid 0); 4 Jul 2001 10:24:59 -0000 -Received: from dns.pcsystems.de (HELO pcsystems.de) (217.89.38.234) - by dns.schottelius.org with SMTP; 4 Jul 2001 10:24:59 -0000 -Received: (qmail 23917 invoked by uid 577); 4 Jul 2001 10:18:19 -0000 -Delivered-To: nicos@pcsystems.de -Received: (qmail 23914 invoked by uid 0); 4 Jul 2001 10:18:18 -0000 -Received: from unknown (HELO morgana.systemy.it) (194.20.140.51) - by dns.pcsystems.de with SMTP; 4 Jul 2001 10:18:18 -0000 -Received: (from rubini@localhost) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) id MAA15398 - for nicos@pcsystems.de; Wed, 4 Jul 2001 12:21:26 +0200 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id TAA21587 - for ; Fri, 29 Jun 2001 19:29:57 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Jun 2001 19:29:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA13158 for ; Fri, 29 Jun 2001 18:28:04 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA15187 - for ; Fri, 29 Jun 2001 16:26:32 GMT -Received: from gateway.riverstone.com (unknown [206.31.85.126]) - by spock.linux.it (Postfix) with ESMTP id 7CA5E196B9 - for ; Fri, 29 Jun 2001 18:26:28 +0200 (CEST) -Received: from ozemail.com.au (IDENT:steveb@ganges.riverstone.com [192.168.1.2]) - by gateway.riverstone.com (8.9.3/8.8.7) with ESMTP id LAA28233 - for ; Fri, 29 Jun 2001 11:22:12 -0500 -Sender: rubini@gnu.systemy.it -Message-ID: <3B3CABF1.D82BC05D@ozemail.com.au> -Date: Fri, 29 Jun 2001 11:25:21 -0500 -From: Steve Bennett -X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.17-14smp i686) -X-Accept-Language: en -MIME-Version: 1.0 -To: rubini@linux.it -Subject: Patch for gpm -Content-Type: multipart/mixed; - boundary="------------335CB4A2F62766DD7699430A" -X-Mozilla-Status: 8001 -X-Mozilla-Status2: 00000000 -X-UIDL: 994242300.18459.suppe - -This is a multi-part message in MIME format. ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi, - -Are you the maintainer for gpm? -I have a patch which you may be interested in including in the next version. -I use a laptop which has a builtin touchpad which emulates a standard PS/2 -mouse, but when I'm not on the road, I use an Intellimouse PS/2 mouse. The -problem is that I have to reconfigure the mouse each time I switch. -With this patch, gpm mouse type "imps2" will auto-detect whether the type is -imps2 or ps2. - -The patch is against an older version (1.17.9), but I could update it to be -against the latest version if necessary. - -Cheers, -Steve - --- -Steve Bennett -Email: msteveb@ozemail.com.au -Web: http://members.ozemail.com.au/~msteveb/ - - - ---------------335CB4A2F62766DD7699430A -Content-Type: text/plain; charset=us-ascii; - name="gpm-imps2-detect.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline; - filename="gpm-imps2-detect.patch" - -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - ---------------335CB4A2F62766DD7699430A-- - - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.gz deleted file mode 100644 index 430f5890..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.patch deleted file mode 100644 index cc4a1eec..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff -u gpm-1.17.9/mice.c ---- gpm-1.17.9/mice.c.orig -+++ gpm-1.17.9/mice.c Mon Jun 25 13:17:49 2001 -@@ -57,6 +57,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1147,17 +1148,109 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 -+ -+/* -+ * Sends the SEND_ID command to the mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) - { -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(-1); -+ } -+ read(fd, &id, 1); -+ -+#ifdef DEBUG -+ fprintf(stderr, "Returning mouse id %d (ack=%d)\n", id, c); -+#endif -+ -+ return(id); -+} -+ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+#ifdef DEBUG -+ fprintf(stderr, "Wrote: %02X, Read: %02X\n", data[i], c); -+#endif -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Now try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Now read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id"); -+ return(NULL); -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup"); -+ return(NULL); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id == AUX_ID_PS2) { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); -+ } -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type"); -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.patch.gz deleted file mode 100644 index 65e3d007..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/imps2autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk deleted file mode 100644 index 7b876e0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk +++ /dev/null @@ -1,113 +0,0 @@ -diff -Naur gpm-1.19.6/doc/Makefile.in gpm-1.19.6-new/doc/Makefile.in ---- gpm-1.19.6/doc/Makefile.in Wed Oct 3 21:51:46 2001 -+++ gpm-1.19.6-new/doc/Makefile.in Thu Jan 3 23:49:03 2002 -@@ -71,7 +71,11 @@ - all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): doc.gpm manpager -- gawk -f ./manpager doc.gpm -+ awk -f ./manpager doc.gpm -+ for i in gpm-root.1 gpm-types.7 gpm.8 mev.1 mouse-test.1; do \ -+ expand $$i | sed s/^'[ ]*'//g > $$i.new; \ -+ mv $$i.new $$i; \ -+ done; - - # why gpmdoc.ps and gpm.ps - gpmdoc.ps: gpm.ps -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk-only-nonmakefile b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk-only-nonmakefile deleted file mode 100644 index 3269e88b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk-only-nonmakefile +++ /dev/null @@ -1,97 +0,0 @@ -diff -Naur gpm-1.19.6/doc/manpager gpm-1.19.6-new/doc/manpager ---- gpm-1.19.6/doc/manpager Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/manpager Thu Jan 3 23:37:35 2002 -@@ -1,6 +1,5 @@ --#! /usr/bin/gawk -f -- --# Warning: this uses gnu-awk features -+#! /usr/bin/awk -f -+# Copyright (c) 1998-2001 Alessandro Rubini - - BEGIN {IN=0} - -@@ -23,18 +22,32 @@ - - { gsub("^%M ?",""); } - --# itz Wed Sep 30 10:28:58 PDT 1998 -+# Use gensub for converting tags: itz Sep 30 1998 -+# -+# However, the gensub function is gawk-specific, and we want things -+# to work with original-awk too (for portability). -+# Therefore, use a normal gsub, even though it's a subobptimal solution -+# as it may step in extra braces. The good solution will be piping to sed, -+# or match, extract subesxpression, replace, reinsert -- bleah... -+# (ARub, Oct 10 2000) - /@b\{/ { -- $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); -+ gsub("@b\{","\\fB"); -+ gsub("\}","\\fP"); -+} -+ -+/@var\{/ { -+ #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); -+ gsub("@var\{","\\fB"); -+ gsub("\}","\\fP"); - } - - /@(samp|code|file)\{/ { -- $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); -+ gsub("@(samp|code|file)\{",""); -+ gsub("\}",""); - } - --/@var\{/ { -- $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); --} - - /@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -@@ -55,6 +68,7 @@ - } - - /^@table/ { TABLE=1; } -+/^@itemize/ { TABLE=1; next} - - /^@item/ { - gsub("^@item *",""); -@@ -63,6 +77,7 @@ - } - - /^@end table/ {TABLE=0} -+/^@end itemize/ {TABLE=0} - - # discard other texinfo commands - -@@ -78,9 +93,10 @@ - gsub("\\%","%"); - } - -+ - # remove leading blanks - --/^[ \t]/ {gsub("^[ \t]*","");} -+/^[ \t]/ {gsub("^[ \t]","");} - - # put a .LP at blank lines - -diff -Naur gpm-1.19.6/doc/mktxt gpm-1.19.6-new/doc/mktxt ---- gpm-1.19.6/doc/mktxt Sun Sep 23 20:00:03 2001 -+++ gpm-1.19.6-new/doc/mktxt Thu Jan 3 20:08:31 2002 -@@ -1,6 +1,6 @@ --#! /usr/bin/gawk -f -+#! /usr/bin/awk -f - --# Warning: this may use gnu-awk features -+# This shouldn't contain any gawk specific features anymore - - # Program to create ascii from info; - # Missing: table of contents -@@ -29,7 +29,7 @@ - NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - --/^* Menu:$/ { KEEP=0 } -+/^\*\ Menu:$/ { KEEP=0 } diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk-only-nonmakefile.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk-only-nonmakefile.gz deleted file mode 100644 index 9abeab45..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk-only-nonmakefile.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk.gz deleted file mode 100644 index ee7e2d56..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/patch-awk.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff deleted file mode 100644 index 507a892d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff +++ /dev/null @@ -1,88 +0,0 @@ -diff -ur gpm-1.19.3.orig/README gpm-1.19.3/README ---- gpm-1.19.3.orig/README Tue Jul 18 16:39:11 2000 -+++ gpm-1.19.3/README Sat Jan 6 10:31:18 2001 -@@ -159,9 +159,9 @@ - better "ldd /usr/sbin/gpm"). And the compiler messages, obviously. - - * When a program hangs or segfaults, please reinvoke the program under strace: -- strace -tf -o /tmp/trace.gpm gpm -t msc -+ strace -tf -o /var/run/trace.gpm gpm -t msc - ^^^^^^^^^^ put your true cmdline here. --Then send me /tmp/trace.gpm* (they may be one or two files, according -+Then send me /var/run/trace.gpm* (they may be one or two files, according - to the strace version), and a description of how you reproduce the problem. - - The last resort is a core dump, but I'll ask it personally if I have real -diff -ur gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Sat Jan 6 10:32:15 2001 -@@ -2012,7 +2012,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.3.orig/doc/gpm.info gpm-1.19.3/doc/gpm.info ---- gpm-1.19.3.orig/doc/gpm.info Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpm.info Sat Jan 6 10:32:22 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/doc/gpmdoc.ps gpm-1.19.3/doc/gpmdoc.ps ---- gpm-1.19.3.orig/doc/gpmdoc.ps Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.ps Sat Jan 6 10:32:32 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.3.orig/doc/gpmdoc.txt gpm-1.19.3/doc/gpmdoc.txt ---- gpm-1.19.3.orig/doc/gpmdoc.txt Tue Jul 18 17:21:19 2000 -+++ gpm-1.19.3/doc/gpmdoc.txt Sat Jan 6 10:32:41 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.3.orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.orig/gpn.c Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpn.c Sat Jan 6 10:30:20 2001 -@@ -223,13 +223,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ tmp_pidfile[0]; -+ strncat (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz deleted file mode 100644 index 828d063f..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-immunix-owl-tmp.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff deleted file mode 100644 index a59feee2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-owl-gpm-root.diff +++ /dev/null @@ -1,470 +0,0 @@ -diff -urN gpm-1.19.3.orig/Makefile.in gpm-1.19.3/Makefile.in ---- gpm-1.19.3.orig/Makefile.in Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/Makefile.in Tue Jun 26 02:33:16 2001 -@@ -50,7 +50,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o - -@@ -112,6 +112,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -diff -urN gpm-1.19.3.orig/closeall.c gpm-1.19.3/closeall.c ---- gpm-1.19.3.orig/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.3/closeall.c Tue Jun 26 02:33:16 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.3.orig/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.orig/doc/doc.gpm Tue Jul 18 16:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Tue Jun 26 03:57:17 2001 -@@ -133,7 +133,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1940,17 +1939,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1961,14 +1952,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2167,9 +2150,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2179,7 +2161,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.3.orig/gpm-root.c gpm-1.19.3/gpm-root.c ---- gpm-1.19.3.orig/gpm-root.c Wed Apr 19 09:53:38 2000 -+++ gpm-1.19.3/gpm-root.c Tue Jun 26 02:33:16 2001 -@@ -1,3 +1,4 @@ -+#error This should be re-generated from the .y file. - - /* A Bison parser, made from gpm-root.y - by GNU Bison version 1.25 -diff -urN gpm-1.19.3.orig/gpm-root.conf gpm-1.19.3/gpm-root.conf ---- gpm-1.19.3.orig/gpm-root.conf Tue Jan 18 00:21:00 2000 -+++ gpm-1.19.3/gpm-root.conf Tue Jun 26 02:36:27 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.3.orig/gpm-root.y gpm-1.19.3/gpm-root.y ---- gpm-1.19.3.orig/gpm-root.y Wed Apr 19 09:48:41 2000 -+++ gpm-1.19.3/gpm-root.y Tue Jun 26 06:47:19 2001 -@@ -64,6 +64,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +80,7 @@ - #include "wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +120,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +139,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +326,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +355,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +470,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +549,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +568,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +707,17 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f",self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,23 +733,19 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap",self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - -@@ -751,6 +766,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +848,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +874,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +948,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +996,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1231,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1314,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -diff -urN gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Tue Jan 18 00:34:00 2000 -+++ gpm-1.19.3/special.c Tue Jun 26 02:33:16 2001 -@@ -38,6 +38,8 @@ - - #include "gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -151,10 +153,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /* VT_ACTIVATE */ - #include /* K_SHIFT */ - #include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -623,11 +624,7 @@ - case 0: - /* child: exec getty */ - sprintf(name,"tty%i",vc); --#ifdef __alpha__ -- execl("/daemons/getty","getty","38400",name,(char *)NULL); --#else - execl("/sbin/mingetty","mingetty",name,(char *)NULL); --#endif __alpha__ - exit(1); /* shouldn't happen */ - - default: -@@ -1045,6 +1042,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1065,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1081,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz deleted file mode 100644 index 1c043983..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-gpm-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz deleted file mode 100644 index 92a2e028..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-install-no-root.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz deleted file mode 100644 index 2c35a6dd..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-no-ps.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff deleted file mode 100644 index 792ffb0e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpm.c.orig Tue Jul 18 16:06:06 2000 -+++ gpm-1.19.3/gpm.c Sat Jan 6 10:10:41 2001 -@@ -1012,8 +1012,9 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz deleted file mode 100644 index b4a269fa..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm-1.19.3-rh-owl-socket-mode.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.init b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.init deleted file mode 100644 index d8cf2a77..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.init +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: gpm.init,v 1.2 2002/05/28 19:13:55 nico Exp $ -# -# chkconfig: 2345 85 15 -# description: \ -# gpm provides mouse support to text-based Linux applications as \ -# well as console cut-and-paste operations using the mouse. -# -# processname: gpm -# pidfile: /var/run/gpm.pid -# config: /etc/sysconfig/mouse - -# source function library -. /etc/init.d/functions - -OWL_STARTUP_ENABLE=1 - -MOUSECFG=/etc/sysconfig/mouse - -case "$1" in -start) - if [ -f "$MOUSECFG" ]; then - . "$MOUSECFG" - else - MOUSETYPE="none" - fi - - if [ "$MOUSETYPE" = "none" ]; then - echo "Not starting gpm (no mouse is configured)" - exit 0 - fi - - if [ "$MOUSETYPE" = "Microsoft" ]; then - MOUSETYPE=ms - fi - - if [ -n "$MOUSETYPE" ]; then - GPM_ARG="-t $MOUSETYPE" - else - GPM_ARG="" - fi - - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - daemon --pidfile /var/run/gpm.pid --expect-user root \ - -- gpm "$GPM_ARG" - else - daemon gpm "$GPM_ARG" - fi - ;; -stop) - if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then - killproc --pidfile /var/run/gpm.pid --expect-user root gpm - else - killproc gpm - fi - ;; -restart|reload) - $0 stop - $0 start - ;; -status) - status --pidfile /var/run/gpm.pid --expect-user root gpm - ;; -*) - echo "Usage: gpm {start|stop|restart|status}" - exit 1 -esac - -exit $? diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.init.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.init.gz deleted file mode 100644 index 4a6ece26..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.init.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.spec b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.spec deleted file mode 100644 index 5c9f3698..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.spec +++ /dev/null @@ -1,180 +0,0 @@ -# $Id: gpm.spec,v 1.2 2002/05/28 19:13:55 nico Exp $ - -# this defines the library version that this package builds. -%define LIBVER 1.18.0 -%define BUILD_GPM_ROOT 'no' - -Summary: A mouse server for the Linux console. -Name: gpm -Version: 1.19.3 -Release: 8owl -License: GPL -Group: System Environment/Daemons -Source0: ftp://ftp.systemy.it/pub/develop/%{name}-%{version}.tar.gz -Source1: gpm.init -Patch0: gpm-1.19.3-rh-install-no-root.diff -Patch1: gpm-1.19.3-rh-no-ps.diff -Patch2: gpm-1.19.3-rh-doc.diff -Patch3: gpm-1.19.3-rh-owl-socket-mode.diff -Patch4: gpm-1.19.3-rh-gpm-root.diff -Patch5: gpm-1.19.3-owl-gpm-root.diff -Patch6: gpm-1.19.3-immunix-owl-tmp.diff -Patch7: gpm-1.19.3-owl-liblow.diff -Patch8: gpm-1.19.3-owl-warnings.diff -Prereq: /sbin/chkconfig /sbin/ldconfig /sbin/install-info /etc/rc.d/init.d -BuildRequires: bison -BuildRoot: /var/rpm-buildroot/%{name}-root - -%description -gpm provides mouse support to text-based Linux applications as well as -console cut-and-paste operations using the mouse. - -%package devel -Requires: %{name} = %{version}-%{release} -Summary: Libraries and header files for developing mouse driven programs. -Group: Development/Libraries - -%description devel -The gpm-devel package contains the libraries and header files needed -for the development of mouse driven programs for the console. - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%package root -Requires: %{name} = %{version}-%{release} -Summary: A mouse server add-on which draws pop-up menus on the console. -Group: System Environment/Daemons - -%description root -The gpm-root program allows pop-up menus to appear on a text console -at the click of a mouse button. -%endif - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -%build -autoconf -CFLAGS="-D_GNU_SOURCE $RPM_OPT_FLAGS" \ - lispdir=%{buildroot}%{_datadir}/emacs/site-lisp \ - %configure -rm gpm-root.c doc/*.[178] doc/gpm.info -make CFLAGS="" CPPFLAGS="" - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sysconfdir} - -PATH=/sbin:/usr/sbin:$PATH - -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp -%makeinstall lispdir=%{buildroot}%{_datadir}/emacs/site-lisp - -install -m 644 doc/gpm-root.1 %{buildroot}%{_mandir}/man1 -install -m 644 gpm-root.conf %{buildroot}%{_sysconfdir} -install -s -m 755 hltest %{buildroot}%{_bindir} -make t-mouse.el t-mouse.elc -cp t-mouse.el* %{buildroot}%{_datadir}/emacs/site-lisp - -pushd %{buildroot} -chmod +x .%{_libdir}/libgpm.so.%{LIBVER} -ln -sf libgpm.so.%{LIBVER} .%{_libdir}/libgpm.so -gzip -9nf .%{_infodir}/gpm.info* -popd - -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m 755 $RPM_SOURCE_DIR/gpm.init %{buildroot}%{_sysconfdir}/rc.d/init.d/gpm - -%clean -rm -rf %{buildroot} - -%pre -rm -f /var/run/gpm.restart -if [ $1 -ge 2 ]; then - /etc/rc.d/init.d/gpm status && touch /var/run/gpm.restart || : - /etc/rc.d/init.d/gpm stop || : -fi - -%post -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add gpm -fi -if [ -f /var/run/gpm.restart ]; then - /etc/rc.d/init.d/gpm start -fi -rm -f /var/run/gpm.restart -/sbin/ldconfig -/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir - -%preun -if [ $1 -eq 0 ]; then - /sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir - /etc/rc.d/init.d/gpm stop || : - /sbin/chkconfig --del gpm -fi - -%postun -/sbin/ldconfig - -%files -%defattr(-,root,root) -%{_bindir}/mev -%{_bindir}/hltest -/usr/sbin/gpm -%{_datadir}/emacs/site-lisp/t-mouse.el -%{_datadir}/emacs/site-lisp/t-mouse.elc -%{_infodir}/gpm.info* -%{_mandir}/man1/mev.1* -%{_mandir}/man8/gpm.8* -%{_libdir}/libgpm.so.%{LIBVER} -%config %{_sysconfdir}/rc.d/init.d/gpm - -%files devel -%defattr(-,root,root) -%{_includedir}/* -%{_libdir}/libgpm.a -%{_libdir}/libgpm.so - -%if "%{BUILD_GPM_ROOT}"=="'yes'" -%files root -%defattr(-,root,root) -%config %{_sysconfdir}/gpm-root.conf -%{_bindir}/gpm-root -%{_mandir}/man1/gpm-root.1* -%endif - -%changelog -* Wed Jun 27 2001 Solar Designer -- Disabled packaging gpm-root by default. - -* Tue Jun 26 2001 Solar Designer -- Moved gpm-root to a separate subpackage. -- Disabled support for ~/.gpm-root because of too many security issues -with this feature, updated the documentation accordingly. -- Fixed many gpm-root reliability bugs including the format string bug -reported by Colin Phipps to Debian (http://bugs.debian.org/102031) and -several other bugs which were about as bad. - -* Sun May 27 2001 Alexandr D. Kanevskiy -- hack to avoid double use of $RPM_OPT_FLAGS - -* Sat Jan 06 2001 Solar Designer -- Updated the patches for fail-closeness in many cases. -- Re-generate gpm-root.c at build time, to avoid maintaining two patches. -- /tmp fixes in the documentation (don't suggest bad practices). -- More startup script cleanups. -- Restart after package upgrades in an owl-startup compatible way. - -* Fri Jan 05 2001 Alexandr D. Kanevskiy -- import mktemp patch from Immunix, fix strncpy - -* Sun Dec 24 2000 Alexandr D. Kanevskiy -- import from RH diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.spec.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.spec.gz deleted file mode 100644 index f1e96cc4..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/old/securitypatch/gpm.spec.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/001_logging_000 b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/001_logging_000 deleted file mode 100644 index 28a9b28d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/001_logging_000 +++ /dev/null @@ -1,162 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/debuglog.c gpm-1.19.5/src/debuglog.c ---- gpm-1.19.5.orig/src/debuglog.c Sat Sep 15 16:55:06 2001 -+++ gpm-1.19.5/src/debuglog.c Thu Oct 4 23:31:24 2001 -@@ -43,6 +43,8 @@ - #include - #include "headers/wd.h" - -+extern int errno; -+ - #ifndef DEBUG - int - gpm_debug_level = LOG_NOTICE; -@@ -54,6 +56,9 @@ - int - gpm_log_daemon = 0; - -+int -+gpm_log = 1; -+ - void - gpm_debug_log(int level, char* fmt, ...) - { -@@ -62,10 +67,14 @@ - va_start(ap, fmt); - #ifdef HAVE_VSYSLOG - vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); --#else -- vfprintf(stderr, fmt, ap); -- fputs("\n", stderr); -+ if (gpm_log) { -+ vsyslog(level | (gpm_log_daemon ? LOG_DAEMON : LOG_USER), fmt, ap); -+ } else - #endif -+ { -+ vfprintf(stderr, fmt, ap); -+ fputs("\n", stderr); -+ } - va_end(ap); - } /*if*/ - } -@@ -85,13 +94,17 @@ - - va_start(ap, s); - #if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) -- pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -- syslog(pri, "oops() invoked from %s(%i)",f, n); -- vsyslog(pri, buf, ap); -+ if (gpm_log) { -+ pri = LOG_ERR | (gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ syslog(pri, "oops() invoked from %s(%i)",f, n); -+ vsyslog(pri, buf, ap); -+ } else - #endif /* always print to stderr as well */ -- fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -- vfprintf(stderr, s, ap); -- fprintf(stderr,": %s\n", strerror(errno)); -+ { -+ fprintf(stderr,"gpm: oops() invoked from %s(%i)\n",f, n); -+ vfprintf(stderr, s, ap); -+ fprintf(stderr,": %s\n", strerror(errno)); -+ } - - va_end(ap); - } /*if*/ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:31:29 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:31:24 2001 -@@ -364,6 +364,7 @@ - return data; - } - gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ gpm_debug_log(LOG_DEBUG,"Data %02x",data[0]); - return NULL; - } - -@@ -393,6 +394,7 @@ - if ((data[1]&(m_type->proto)[2]) != (m_type->proto)[3]) - { - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); -+ gpm_debug_log(LOG_DEBUG,"Bad %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); - return NULL; - } - gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Sat Sep 15 16:52:24 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:31:24 2001 -@@ -178,6 +178,7 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -+ " -e output messages to stderr instead of syslog\n" - " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -309,6 +310,8 @@ - /* itz Wed Jul 1 18:37:59 PDT 1998 */ - /* run as a daemon unless told otherwise */ - gpm_log_daemon = 1; -+ /* Run with logging to syslog unless told otherwise */ -+ gpm_log = 1; - - while ((opt = getopt(argc, argv, options)) != -1) - { -@@ -366,12 +369,14 @@ - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -+ case 'e': gpm_log=0; break; - default: - exit(usage("commandline")); - } - } - -- openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); -+ if (gpm_log) -+ openlog(prgname, LOG_PID, gpm_log_daemon ? LOG_DAEMON : LOG_USER); - check_kill(); - - loadlut(opt_lut); -@@ -444,14 +449,12 @@ - - /* report should be here and nothing else! */ - --#if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -- if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } --#else -- fclose(stderr); --#endif -+ if (gpm_log) { -+ fclose(stderr); -+ } else if (!freopen("/dev/console", "w", stderr)) { -+ // currently current console -+ oops("freopen(stderr) failed"); -+ } - - if (setsid()<0) oops("setsid()"); - if (chdir("/")<0) oops("/"); -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/wd.h gpm-1.19.5/src/headers/wd.h ---- gpm-1.19.5.orig/src/headers/wd.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/wd.h Thu Oct 4 23:31:24 2001 -@@ -41,6 +41,9 @@ - extern int - gpm_log_daemon; - -+extern int -+gpm_log; -+ - extern void - gpm_debug_log(int level, char* fmt, ...); - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/001_logging_000.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/001_logging_000.gz deleted file mode 100644 index 184a45f8..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/001_logging_000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-devfs.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-devfs.patch deleted file mode 100644 index a947e8b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-devfs.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- gpm-1.19.3/gpn.c.devfs Sun Jan 28 12:16:19 2001 -+++ gpm-1.19.3/gpn.c Sun Jan 28 12:17:07 2001 -@@ -440,9 +440,8 @@ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -- { -- oops("freopen(stderr) failed"); -- } -+ if(!freopen("/dev/tty", "w", stderr)) /* Try harder */ -+ fclose(stderr); /* Yuck, this is bad, but not really a reason to abort */ - #else - fclose(stderr); - #endif diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-devfs.patch.gz deleted file mode 100644 index d42945ed..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-noworldwrite.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-noworldwrite.patch deleted file mode 100644 index 283b0f0c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-noworldwrite.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- gpm-1.19.3/gpn.c.old Mon Feb 5 07:10:04 2001 -+++ gpm-1.19.3/gpn.c Mon Feb 5 07:52:32 2001 -@@ -223,11 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ char *tmp_pidfile; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ umask(022); /* make sure file will not be world-writable */ -+ -+ tmp_pidfile=(char *)malloc(strlen(GPM_NODE_DIR) + strlen("/gpmXXXXXX") +1); -+ strcpy(tmp_pidfile, GPM_NODE_DIR); -+ strcat(tmp_pidfile, "/gpmXXXXXX"); -+ if (!mkstemp(tmp_pidfile)) { -+ oops("mkstemp()"); - } /*if*/ - if ((fp = fopen(tmp_pidfile,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); -@@ -248,6 +253,7 @@ - if (fp) { - int old_pid = -1; - fscanf(fp, "%d", &old_pid); -+ unlink(tmp_pidfile); - gpm_oops(__FILE__,__LINE__,"gpm already running as pid %d", old_pid); - } else { - oops(GPM_NODE_PID); diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz deleted file mode 100644 index d9462559..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-noworldwrite.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-root.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-root.patch deleted file mode 100644 index 6d17bb3b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-root.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.3/Makefile.in 2000/07/22 06:50:28 1.1 -+++ gpm-1.19.3/Makefile.in 2000/07/22 06:50:45 -@@ -142,7 +142,7 @@ - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -- $(INSTALL_PROGRAM) -o root -m 755 disable-paste $(bindir)/disable-paste -+ $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-root.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-root.patch.gz deleted file mode 100644 index 695679c1..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-1.19.3-root.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-nops.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-nops.patch deleted file mode 100644 index ca7e87c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-nops.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.0/doc/Makefile.in.nops Thu Jan 20 22:52:46 2000 -+++ gpm-1.19.0/doc/Makefile.in Sun Mar 19 00:37:35 2000 -@@ -93,7 +93,7 @@ - - # Main portion - --all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) -+all: $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES) - - $(MANPAGES): $(srcdir)/doc.gpm $(srcdir)/manpager - cd $(srcdir) && gawk -f ./manpager doc.gpm diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-nops.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-nops.patch.gz deleted file mode 100644 index 7379748b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/refused/gpm-nops.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/000_misc-000 b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/000_misc-000 deleted file mode 100644 index 985d1cf0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/000_misc-000 +++ /dev/null @@ -1,63 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Tue Sep 18 10:17:23 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:30:06 2001 -@@ -315,11 +315,12 @@ - goto scan; - - /* if not managed, use default mask */ -- if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) -+ if (!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if (res) - return res; - else - goto scan; -+ } - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -@@ -777,7 +778,7 @@ - #if !defined(__GLIBC__) - int len; - #else /* __GLIBC__ */ -- size_t len; -+ socklen_t len; - #endif /* __GLIBC__ */ - struct sockaddr_un addr; /* reuse this each time */ - struct stat statbuf; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmCfg.h gpm-1.19.5/src/headers/gpmCfg.h ---- gpm-1.19.5.orig/src/headers/gpmCfg.h Tue Sep 18 17:57:16 2001 -+++ gpm-1.19.5/src/headers/gpmCfg.h Thu Oct 4 23:30:06 2001 -@@ -53,7 +53,7 @@ - #define DEF_ACCEL 2 - #define DEF_SCALE 10 - #define DEF_TIME 250 /* time interval (ms) for multiple clicks */ --#define DEF_CLUSTER 10 /* maximum number of clustered events */ -+#define DEF_CLUSTER 0 /* maximum number of clustered events */ - #define DEF_THREE 0 /* have three buttons? */ - #define DEF_KERNEL 0 /* no kernel module, by default */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Sat Sep 15 16:53:38 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:30:06 2001 -@@ -284,7 +284,7 @@ - /* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; --char summaid=-1; -+signed short summaid=-1; - static int M_summa(Gpm_Event *state, unsigned char *data) - { - int x, y; -@@ -475,10 +475,11 @@ - - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; -- else if (tap_active) -+ else if (tap_active) { - if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; -+ } - - /* Some PS/2 mice send reports with negative bit set in data[0] - * and zero for movement. I think this is a bug in the mouse, but diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/000_misc-000.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/000_misc-000.gz deleted file mode 100644 index 44840158..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/000_misc-000.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/INDEX b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/INDEX deleted file mode 100644 index 9e3c04fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/INDEX +++ /dev/null @@ -1,6 +0,0 @@ - * devfs-1: solved myself another way - * gpm.screen.diff: there is another patch in unified format - * mktemp_secure_problem: applied - * OPEN_MAX: solved with "include " - * imps-autodetect.patch: applied - * gpm-newmouse.patch: applied diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/INDEX.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/INDEX.gz deleted file mode 100644 index c0bb8a3c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/INDEX.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs-1 b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs-1 deleted file mode 100644 index 7103fd00..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs-1 +++ /dev/null @@ -1,47 +0,0 @@ -From - Thu Jun 7 00:06:04 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA24549 - for ; Wed, 9 May 2001 15:40:20 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 09 May 2001 15:40:20 MEST -Received: from mir.prosa.it ([217.57.75.5]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id PAA27471 for ; Wed, 9 May 2001 15:39:30 +0200 -Received: by mir.prosa.it (Postfix) - id C694511F; Wed, 9 May 2001 15:39:28 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from fox.tamu.edu (unix.tamu.edu [128.194.103.25]) - by mir.prosa.it (Postfix) with ESMTP id 93AB11A - for ; Wed, 9 May 2001 15:39:27 +0200 (CEST) -Received: from localhost (ers7067@localhost) - by fox.tamu.edu (8.9.3/8.9.3) with SMTP id IAA01257 - for ; Wed, 9 May 2001 08:39:26 -0500 (CDT) -Date: Wed, 9 May 2001 08:39:26 -0500 (CDT) -From: Eric Schendel -To: rubini@prosa.it -Subject: GPM patch for devfs -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: d09ac3c5d4e5825e1ee94b1606b7c5c7 -Status: RO - -Opps, the patch didnt go through as an attachment so I am just going to -include it in the email. - -Eric - ---------------------------------------------- - ---- gpm-1.19.3/liblow.c Tue Jul 18 07:06:06 2000 -+++ gpm-1.19.3f1/liblow.c Tue May 8 18:58:43 2001 -@@ -235,7 +235,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/vc/",8) && strncmp(tty,"/dev/tty",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs-1.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs-1.gz deleted file mode 100644 index c8236c93..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs-1.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.patch deleted file mode 100644 index ae41c038..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.patch +++ /dev/null @@ -1,126 +0,0 @@ -From gpm-request@prosa.it Thu Apr 27 12:07:30 2000 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA19031 - for ; Thu, 27 Apr 2000 12:07:29 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 27 Apr 2000 12:07:29 MEST -Received: from giga.prosa.it (root@[213.255.48.147]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA03517 for ; Mon, 24 Apr 2000 13:30:37 +0200 -Received: (from lists@localhost) - by giga.prosa.it (8.9.3/8.9.3/Debian/GNU) id NAA16706; - Mon, 24 Apr 2000 13:30:35 +0200 -Resent-Date: Mon, 24 Apr 2000 13:30:35 +0200 -X-Authentication-Warning: giga.prosa.it: lists set sender to gpm-request@lists.prosa.it using -f -From: "Adam J. Richter" -Date: Mon, 24 Apr 2000 03:43:11 -0700 -Message-Id: <200004241043.DAA28678@adam.yggdrasil.com> -To: gpm@prosa.it -Subject: Patch adding devfs support to gpm-1.19.2 -Resent-Message-ID: -Resent-From: gpm@prosa.it -Reply-To: gpm@prosa.it -X-Mailing-List: archive/latest/717 -X-Loop: gpm@lists.prosa.it -Precedence: bulk -Resent-Sender: gpm-request@prosa.it -X-UIDL: a6c102abee205325fb8ebf43077d9567 -Status: RO - - - The following patch fixes gpm-1.19.2 to allow use of -the virtual console names built into devfs (at least for -linux-2.3.99pre5.5). Although it is possible to add the -old names (or some other names) to a devfs-based system, these -names will always be present on all devfs-based systems, eliminating -another potential incompatability. If you apply this patch, gpm -should still work on all of the systems that it worked on before, -although I have not tested it on a non-devfs system. I hope you -will apply this patch or some variant of it for the next release. - -Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 -adam@yggdrasil.com \ / San Jose, California 95129-1034 -+1 408 261-6630 | g g d r a s i l United States of America -fax +1 408 261-6631 "Free Software For The Rest Of Us." - - -diff -u -r gpm-1.19.2/gpm-root.c gpm/gpm-root.c ---- gpm-1.19.2/gpm-root.c Tue Apr 18 22:53:38 2000 -+++ gpm/gpm-root.c Mon Apr 24 03:35:00 2000 -@@ -1868,6 +1868,10 @@ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_RDONLY); -+ } -+ if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ -@@ -1888,6 +1892,10 @@ - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); -+ if (dumpfd < 0) { -+ sprintf(dumpname,"/dev/vcc/a%i",vc); -+ dumpfd=open(dumpname,O_WRONLY); -+ } - if (dumpfd<0) { - gpm_debug_log(LOG_ERR,"%s: %s", dumpname, strerror(errno)); - return; -@@ -2090,9 +2098,11 @@ - exit(1); - } - -- if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) -+ if (stat("/dev/vcs0",&sbuf)<0 -+ && stat("/dev/vcs",&sbuf)<0 -+ && stat("/dev/vcc/0",&sbuf)<0) - { -- fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); -+ fprintf(stderr,"%s: /dev/vcc/0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); -diff -u -r gpm-1.19.2/hltest.c gpm/hltest.c ---- gpm-1.19.2/hltest.c Mon Jan 17 13:34:00 2000 -+++ gpm/hltest.c Mon Apr 24 03:35:32 2000 -@@ -456,7 +456,11 @@ - /* open your dump/restore buffers */ - - sprintf(devname,"/dev/vcsa%i",vc); -- if ((dev_vcs=open(devname,O_RDWR))<0) -+ if ((dev_vcs=open(devname,O_RDWR))<0) { -+ sprintf(devname,"/dev/vcc/a%i",vc); -+ dev_vcs=open(devname,O_RDWR); -+ } -+ if (dev_vcs<0) - { perror(devname); exit(1); } - - if (Gpm_Open(&conn,0)==-1) -diff -u -r gpm-1.19.2/liblow.c gpm/liblow.c ---- gpm-1.19.2/liblow.c Thu Jan 27 14:09:00 2000 -+++ gpm/liblow.c Mon Apr 24 03:05:21 2000 -@@ -226,6 +226,8 @@ - { /* forced vc number */ - conn->vc=flag; - sprintf(tty,"/dev/tty%i",flag); -+ if (access(tty, F_OK) < 0) -+ sprintf(tty,"/dev/vc/%i",flag); - } - else if (flag==0) /* use your current vc */ - { -@@ -235,7 +237,8 @@ - if (!t && isatty(2)) t = ttyname(2); /* stderr */ - if (!t) goto err; - strcpy(tty,t); -- if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ if ((strncmp(tty,"/dev/tty",8) && strncmp(tty, "/dev/vc/",8)) -+ || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - --- -Bored? echo unsubscribe | mail gpm-request@lists.prosa.it - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.patch.gz deleted file mode 100644 index d43729e3..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.readme b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.readme deleted file mode 100644 index 54c6436f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.readme +++ /dev/null @@ -1,4 +0,0 @@ -In my opinion this is an "obviously good" patch. -The only reason why it isn't applied is because I no longer maintain gpm. -I hope the new maintainer (if any) will apply it. Thanks Adam. -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.readme.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.readme.gz deleted file mode 100644 index 4e99ec75..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/devfs.readme.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch deleted file mode 100644 index 913de308..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- gpm-1.19.2/gpm.c.secenhance Wed Jun 14 19:57:48 2000 -+++ gpm-1.19.2/gpm.c Wed Jun 14 19:58:31 2000 -@@ -1002,8 +1002,8 @@ - oops(ctladdr.sun_path); - maxfd=max(maxfd,ctlfd); - --/* is this a bug in the new kernels? */ -- chmod(GPM_NODE_CTL,0777); -+/* only allow the console user to access. */ -+ chmod(GPM_NODE_CTL,0700); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz deleted file mode 100644 index 5db39a05..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.1-secenhance.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.2-limits.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.2-limits.patch deleted file mode 100644 index 8df5abec..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.2-limits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gpm-1.19.2/special.c.openmax Mon Jan 17 16:34:00 2000 -+++ gpm-1.19.2/special.c Fri Jun 30 10:49:40 2000 -@@ -154,7 +154,7 @@ - open("/dev/null",O_RDONLY); /* stdin */ - open("/dev/tty0",O_WRONLY); /* stdout */ - dup(1); /* stderr */ -- for (i=3;i /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -1620,21 +1621,112 @@ - return type; - } - --/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, -- struct Gpm_Type *type, int argc, char **argv) --{ -- static unsigned char s1[] = { 243, 200, 243, 100, 243, 80, }; -- static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+#define AUX_SEND_ID 0xF2 -+#define AUX_ID_ERROR -1 -+#define AUX_ID_PS2 0 -+#define AUX_ID_IMPS2 3 - -- if (check_no_argv(argc, argv)) return NULL; -+/* -+ * Sends the SEND_ID command to the ps2-type mouse. -+ * Return one of AUX_ID_... -+ */ -+static int read_mouse_id(int fd) -+ { -+ unsigned char c = AUX_SEND_ID; -+ unsigned char id; -+ -+ write(fd, &c, 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ return(AUX_ID_ERROR); -+ } -+ read(fd, &id, 1); - -- write (fd, s1, sizeof (s1)); -- usleep (30000); -- write (fd, s2, sizeof (s2)); -+ return(id); -+} -+ -+/** -+ * Writes the given data to the ps2-type mouse. -+ * Checks for an ACK from each byte. -+ * -+ * Returns 0 if OK, or >0 if 1 or more errors occurred. -+ */ -+static int write_to_mouse(int fd, unsigned char *data, size_t len) -+{ -+ int i; -+ int error = 0; -+ for (i = 0; i < len; i++) { -+ unsigned char c; -+ write(fd, &data[i], 1); -+ read(fd, &c, 1); -+ if (c != AUX_ACK) { -+ error++; -+ } -+ } -+ -+ /* flush any left-over input */ - usleep (30000); - tcflush (fd, TCIFLUSH); -- return type; -+ return(error); -+} -+ -+ -+/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -+/* Autodetect: Steve Bennett */ -+static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int i; -+ int id; -+ static unsigned char basic_init[] = { AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100 }; -+ static unsigned char imps2_init[] = { AUX_SET_SAMPLE, 200, AUX_SET_SAMPLE, 100, AUX_SET_SAMPLE, 80, }; -+ static unsigned char ps2_init[] = { AUX_SET_SCALE11, AUX_ENABLE_DEV, AUX_SET_SAMPLE, 100, AUX_SET_RES, 3, }; -+ -+ /* Do a basic init in case the mouse is confused */ -+ write_to_mouse(fd, basic_init, sizeof (basic_init)); -+ -+ /* Now try again and make sure we have a PS/2 mouse */ -+ if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -+ return(NULL); -+ } -+ -+ /* Try to switch to 3 button mode */ -+ if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ if (id == AUX_ID_ERROR) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -+ id = AUX_ID_PS2; -+ } -+ -+ /* And do the real initialisation */ -+ if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ } -+ -+ if (id == AUX_ID_IMPS2) { -+ /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -+ -+ return type; -+ } -+ if (id != AUX_ID_PS2) { -+ gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -+ } -+ else { -+ gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ } -+ for (type=mice; type->fun; type++) { -+ if (strcmp(type->name, "ps2") == 0) { -+ return(type); -+ } -+ } -+ /* ps2 was not found!!! */ -+ return(NULL); - } - - static Gpm_Type *I_twid(int fd, unsigned short flags, -@@ -1991,7 +2083,7 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -+ {"imps2", "Microsoft Intellimouse (ps2) - autodetect 2/3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -diff -u gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm.orig -+++ gpm-1.19.3/doc/doc.gpm Fri Jul 27 12:49:08 2001 -@@ -720,7 +720,8 @@ - ones. The wheel is currently unused. - - @item imps2 -- ``IntelliMouse'' on the ps/2 port. -+ ``IntelliMouse'' on the ps/2 port. This type can also be used for -+ a generic 2-button ps/2 mouse too, since it will auto-detect the type. - - @item netmouse - Decodes the ``Genius NetMouse'' type of devices. diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz deleted file mode 100644 index dc858367..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.3-imps-autodetect.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz deleted file mode 100644 index 7bc6bcab..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-1owl.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-patches.tar b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-patches.tar deleted file mode 100644 index dae32b7d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-patches.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz deleted file mode 100644 index 590f0588..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-1.19.6-patches.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-checkdevfsbug.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-checkdevfsbug.patch deleted file mode 100644 index 00c5ba69..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-checkdevfsbug.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- gpm-1.19.4.orig/liblow.c Sun May 27 22:53:22 2001 -+++ gpm-1.19.4/liblow.c Sun Sep 9 19:49:12 2001 -@@ -183,6 +183,31 @@ - } - #endif /* SIGTSTP */ - -+/* -+ * check for devfs -+ */ -+ -+static int check_devfs( void ) -+{ -+ -+ int fd, retval = GPM_IS_NOTHING; -+ struct stat buf; -+ -+ /* first try the devfs device, because in the next time this will be -+ * the preferred one. If that fails, take the old console */ -+ -+ /* Check for open new console */ -+ if ((fd=stat(GPM_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_DEVFS; -+ -+ /* Failed, try OLD console */ -+ else if((fd=stat(GPM_NO_DEVFS_CONSOLE, &buf)) == 0) -+ retval = GPM_IS_NOT_DEVFS; -+ -+ return retval; -+ -+} -+ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -@@ -196,6 +221,7 @@ - - - /* check whether there is a devfs */ -+ devfs_id = check_devfs(); - switch(devfs_id) - { - -@@ -203,8 +229,7 @@ - break; - case GPM_IS_NOT_DEVFS: consolename = GPM_NO_DEVFS_CONSOLE; vcname = GPM_NO_DEVFS_VC; - break; -- case GPM_IS_NOTHING: oops("No console to open"); -- break; -+ case GPM_IS_NOTHING: return -1; - - } - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz deleted file mode 100644 index 802bd0b6..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-checkdevfsbug.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-evdev.tar b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-evdev.tar deleted file mode 100644 index 7d99564b..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-evdev.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-evdev.tar.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-evdev.tar.gz deleted file mode 100644 index c74e403a..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-evdev.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-newmouse.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-newmouse.patch deleted file mode 100644 index ee9ea4c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-newmouse.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- gpm-1.19.3/mice.c.orig Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Sun Dec 3 01:49:35 2000 -@@ -1637,6 +1637,23 @@ - return type; - } - -+/* -+ * This works with Dexxa Optical Mouse, but because in X same initstring -+ * is named ExplorerPS/2 so I named it in the same way. -+ */ -+static Gpm_Type *I_exps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ write (fd, s1, sizeof (s1)); -+ usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -1993,6 +2010,9 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -+ "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-newmouse.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-newmouse.patch.gz deleted file mode 100644 index 7750104c..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm-newmouse.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm.screen.diff b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm.screen.diff deleted file mode 100644 index 0a347817..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm.screen.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff -rcw gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c -*** gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 ---- gpm-1.19.3/liblow.c Thu Nov 30 21:18:14 2000 -*************** -*** 77,83 **** - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! int gpm_consolefd=-1; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) ---- 77,84 ---- - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - -! enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -! int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -*************** -*** 114,120 **** - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { ---- 115,128 ---- - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -! if (GPM_FD_SCREEN == gpm_consolefd) { -! /* TODO: */ -! win.ws_col = 80; -! win.ws_row = 25; -! } else if (gpm_consolefd <= 0) -! /* safety check */ -! return; -! else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -*************** -*** 177,183 **** - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[32]; - char *term; - int i; - struct sockaddr_un addr; ---- 185,191 ---- - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -! char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -*************** -*** 236,248 **** - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) - goto err; - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd==-1) - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); ---- 244,283 ---- - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -! if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -*************** -*** 254,259 **** ---- 289,295 ---- - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -*************** -*** 395,401 **** - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd=-1; - return 0; - } - ---- 431,437 ---- - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -! gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -rcw gpm-1.19.3.orig/special.c gpm-1.19.3/special.c -*** gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 ---- gpm-1.19.3/special.c Thu Nov 30 19:09:42 2000 -*************** -*** 26,31 **** ---- 26,32 ---- - - /* This file is compiled conditionally, see the Makefile */ - -+ #include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm.screen.diff.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm.screen.diff.gz deleted file mode 100644 index ba266333..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/gpm.screen.diff.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/microtouch-usb.tar b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/microtouch-usb.tar deleted file mode 100644 index 0916c4b0..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/microtouch-usb.tar and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/microtouch-usb.tar.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/microtouch-usb.tar.gz deleted file mode 100644 index 94ff6bd5..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/microtouch-usb.tar.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem deleted file mode 100644 index 26b584a2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem +++ /dev/null @@ -1,77 +0,0 @@ -From - Wed Jun 6 23:55:45 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id UAA13333 - for ; Fri, 29 Dec 2000 20:30:50 +0100 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 29 Dec 2000 20:30:50 MET -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA14746 for ; Fri, 29 Dec 2000 19:33:08 +0100 -Received: from spock.linux.it (spock.linux.it [151.99.137.27]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id SAA15401 - for ; Fri, 29 Dec 2000 18:32:47 GMT -Received: from blue.int.wirex.com (unknown [216.161.55.93]) - by spock.linux.it (Postfix) with ESMTP id 10E3A197B9 - for ; Fri, 29 Dec 2000 19:32:45 +0100 (CET) -Received: (from greg@localhost) - by blue.int.wirex.com (8.9.3/8.9.3) id KAA30085; - Fri, 29 Dec 2000 10:33:32 -0800 -Date: Fri, 29 Dec 2000 10:33:32 -0800 -From: Greg KH -To: rubini@linux.it -Cc: vendor-sec@lst.de, security@wirex.com -Subject: temp file creation problem in gpm -Message-ID: <20001229103332.G29373@wirex.com> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -User-Agent: Mutt/1.2.5i -X-Operating-System: Linux 2.2.18-immunix (i686) -X-UIDL: 9c0bd8fe74181b95b30143ce1c2ddd42 -Status: RO - -Hi, - -In building Immunix Linux 7.0, we ran across the following problem in -gpm 1.19.3. I realize that gpm is unmaintained at this time, but we -figured that you might want to add this patch to your patches section on -the gpm ftp site. - -In the file gpn.c, the function check_uniqueness creates a temp file in -an insecure way. The following patch, by Steve Beattie - should fix this problem. - -thanks, - -greg k-h - - -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { - - --- -greg@(kroah|wirex).com -http://immunix.org/~greg - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.gz deleted file mode 100644 index 5b9dc84d..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.patch b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.patch deleted file mode 100644 index 46f2f0d0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur gpm-1.19.3-orig/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3-orig/gpn.c Tue Jul 18 05:06:06 2000 -+++ gpm-1.19.3/gpn.c Fri Dec 15 13:58:37 2000 -@@ -223,13 +223,16 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile [] = GPM_NODE_DIR "gpmXXXXXX"; -+ static char tmp_pidfile [64]; -+ int fd; - FILE* fp = 0; - -- if (!mktemp(tmp_pidfile + strlen(GPM_NODE_DIR))) { -- oops("mktemp()"); -+ strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ -+ if ((fd = mkstemp(tmp_pidfile)) == -1) { -+ oops("mkstemp()"); - } /*if*/ -- if ((fp = fopen(tmp_pidfile,"w")) != NULL) { -+ if ((fp = fdopen(fd,"w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.patch.gz b/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.patch.gz deleted file mode 100644 index 1ed7dbec..00000000 Binary files a/software/gpm/browse_source/gpm-1.99.7/patches/done/unknown_stat/mktemp_secure_problem.patch.gz and /dev/null differ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/MS3-PATCH-ANDREW b/software/gpm/browse_source/gpm-1.99.7/patches/todo/MS3-PATCH-ANDREW deleted file mode 100644 index 4d0f0541..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/MS3-PATCH-ANDREW +++ /dev/null @@ -1,88 +0,0 @@ -On Wed, Feb 20, 2002 at 12:13:36AM +0100, Nico Schottelius wrote: -> Just send the patch to me. I don't mind where it comes from, -> I mind if it works or not. - -Ok, this patch (against 1.20.0-gamma) is based on the Debian patch. -It adds an ms3 repeater (supporting the wheel), and also fixes the -ms3 driver to support the wheel. A couple issues: - -- The Debian patch adds wdx and wdy to Gpm_Event, to support (in - principle) arbitrary wheel deltas. 1.20.0-gamma supports wheels - with the GPM_B_UP and GPM_B_DOWN button bits, so I just threw away - everything except one bit of wdy. I don't think this is a big - deal in practice (at least, not for me). - - Code from Debian patch, in case you're interested: - - switch (data[3] & 0x0f) { - case 0x0e: state->wdx = +1; break; - case 0x02: state->wdx = -1; break; - case 0x0f: state->wdy = +1; break; - case 0x01: state->wdy = -1; break; - } - -- The M_ms3 change is untested, but I'm pretty sure it's right. I - may be able to test it later. - -Regarding my questions in my first mail, Blaise mailed me privately -saying that he uses the imps2 repeater with X, and has experienced -no problems. I'm not exactly sure why, so I tend to think the ms3 -repeater should be preferred for the reason I described (again, -unless I misunderstand something). - -Andrew - ---- mice.c.orig Tue Feb 19 22:02:23 2002 -+++ mice.c Wed Feb 20 00:15:39 2002 -@@ -369,14 +369,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2065,7 +2090,7 @@ Gpm_Type mice[]={ - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/MS3-PATCH-ANDREW-rediffed b/software/gpm/browse_source/gpm-1.99.7/patches/todo/MS3-PATCH-ANDREW-rediffed deleted file mode 100644 index 35a7a08d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/MS3-PATCH-ANDREW-rediffed +++ /dev/null @@ -1,69 +0,0 @@ -> you can try the beta version right now. it's available at ftp.schottelius.org - -Makefile.include has this funny line: - - MAKEINFO = no --no-split - -Here is a rediffed version of my patch (had a trivial conflict in -the mouse list). - -Other that that, it seems to run fine at least for a few minutes. -:-) - -Andrew - ---- mice.c.orig Wed Feb 20 08:10:13 2002 -+++ mice.c Wed Feb 20 10:10:03 2002 -@@ -415,14 +415,39 @@ static int M_ms3(Gpm_Event *state, unsi - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ int dx, dy; -+ -+ buf[0] |= 0x40; -+ -+ if (state->buttons & GPM_B_LEFT) buf[0] |= 0x20; -+ if (state->buttons & GPM_B_MIDDLE) buf[3] |= 0x10; -+ if (state->buttons & GPM_B_RIGHT) buf[0] |= 0x10; -+ if (state->buttons & GPM_B_UP) buf[3] |= 0x0f; -+ if (state->buttons & GPM_B_DOWN) buf[3] |= 0x01; -+ -+ dx = limit_delta(state->dx, -128, 127); -+ buf[1] = dx & ~0xC0; -+ buf[0] |= (dx & 0xC0) >> 6; -+ -+ dy = limit_delta(state->dy, -128, 127); -+ buf[2] = dy & ~0xC0; -+ buf[0] |= (dy & 0xC0) >> 4; -+ -+ return write(fd,buf,4); -+} -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -2127,7 +2152,7 @@ Gpm_Type mice[]={ - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/README b/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/README deleted file mode 100644 index 5387d26a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/README +++ /dev/null @@ -1,7 +0,0 @@ -Show clock when cursor moved to upper right corner. Originally by Marco d'Itri -. Random fixes and rediff for latest gpm version by Petr Baudis -. - -clockfix.diff is original clock.diff + some fixes -clockfix2.diff applieas on the top of it and fixes some of the fixes ;) -clock.diff is merge of these two diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clock.diff b/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clock.diff deleted file mode 100644 index 37015ffc..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clock.diff +++ /dev/null @@ -1,172 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clock/src/gpm.c ---- gpm-1.19.6/src/gpm.c Mon Oct 1 22:02:25 2001 -+++ gpm-1.19.6+clock/src/gpm.c Mon Oct 29 13:00:33 2001 -@@ -31,6 +31,7 @@ - #include /* O_RDONLY */ - #include /* wait() */ - #include /* mkdir() */ -+#include /* time() */ - #include /* timeval */ - #include /* socket() */ - #include /* socket() */ -@@ -82,6 +83,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_clock = 0; - Gpm_Type *repeated_type=0; - - /* devfs */ -@@ -93,6 +95,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+static int clock_printed = -1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -240,6 +243,52 @@ - close(fd); - } - -+#define CLOCK_FMT "%02d:%02d" -+#define CLOCK_LEN 5 -+#define POSITION (4 + 2 * (0 * 80 + (maxx - CLOCK_LEN - 1))) -+ -+static void display_clock(int restore) -+{ -+ int fd; -+ static char save[CLOCK_LEN * 2]; -+ -+ if ((fd = open("/dev/vcc/a", O_RDWR)) < 1) { -+ if (errno != ENOENT) -+ oops("open(\"/dev/vcc/a\")"); -+ if ((fd = open("/dev/vcsa", O_RDWR)) < 1) -+ oops("open(\"/dev/vcsa\")"); -+ } -+ if (restore == 2) { /* restore the old characters */ -+ lseek(fd, POSITION, 0); -+ write(fd, &save, sizeof(save)); -+ } else { /* print the clock */ -+ char buf[CLOCK_LEN * 2], buf0[CLOCK_LEN]; -+ time_t t; -+ struct tm *tm; -+ int i, j; -+ -+ if (restore == 0) { /* save the old characters for later */ -+ lseek(fd, POSITION, 0); -+ read(fd, &save, sizeof(save)); -+ } -+ t = time(NULL); -+ tm = localtime(&t); -+ sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -+ i = j = 0; -+ while (i <= sizeof(buf0)) { /* add the color attribute */ -+ buf[j++] = buf0[i++]; -+ buf[j++] = '\032'; /* green on blue */ -+ } -+ lseek(fd, POSITION, 0); -+ write(fd, &buf, sizeof(buf)); -+ } -+ close(fd); -+} -+ -+#undef POSITION -+#undef CLOCK_FMT -+#undef CLOCK_LEN -+ - /*-------------------------------------------------------------------*/ - static inline int do_selection(Gpm_Event *event) /* returns 0, always */ - { -@@ -252,6 +301,16 @@ - case GPM_MOVE: - if (x2<1) x2++; else if (x2>maxx) x2--; - if (y2<1) y2++; else if (y2>maxy) y2--; -+ if (opt_clock && x2 == maxx && y2 == 1 && (clock_printed < 0 || clock_printed == event->vc)) { -+ selection_copy(x2,y2,x2,y2,3); /* move pointer before saving content -+ of the screen, so we don't get -+ pollution after clock hiding */ -+ display_clock(clock_printed); /* print the clock */ -+ clock_printed = event->vc; -+ } else if (clock_printed == event->vc) { -+ display_clock(2); /* restore the screen */ -+ clock_printed = -1; -+ } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ - return 0; - -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6+clock/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 21:00:03 2001 -+++ gpm-1.19.6+clock/src/gpn.c Mon Oct 29 12:34:42 2001 -@@ -155,6 +155,7 @@ - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " -c enable clock printing\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -@@ -290,7 +291,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:cd:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -321,6 +322,7 @@ - break; - case 'b': opt_baud = atoi(optarg); break; - case 'B': opt_sequence = optarg; break; -+ case 'c': opt_clock = 1; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -diff -ru gpm-1.19.6/src/headers/gpmInt.h gpm-1.19.6+clock/src/headers/gpmInt.h ---- gpm-1.19.6/src/headers/gpmInt.h Thu Sep 27 14:52:30 2001 -+++ gpm-1.19.6+clock/src/headers/gpmInt.h Mon Oct 29 12:34:42 2001 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_clock; - extern int fifofd; - extern char *consolename; - -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clockfix2.diff b/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clockfix2.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clockfix2.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clockfix3.diff b/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clockfix3.diff deleted file mode 100644 index 3f16252d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/clockpatch/clockfix3.diff +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru gpm-1.19.6/src/gpm.c gpm-1.19.6+clockfix/src/gpm.c ---- gpm-1.19.6/src/gpm.c Tue Oct 30 13:06:40 2001 -+++ gpm-1.19.6+clockfix/src/gpm.c Tue Oct 30 13:03:46 2001 -@@ -258,7 +258,7 @@ - if ((fd = open("/dev/vcsa", O_RDWR)) < 1) - oops("open(\"/dev/vcsa\")"); - } -- if (restore == 2) { /* restore the old characters */ -+ if (restore == -2) { /* restore the old characters */ - lseek(fd, POSITION, 0); - write(fd, &save, sizeof(save)); - } else { /* print the clock */ -@@ -267,10 +267,12 @@ - struct tm *tm; - int i, j; - -- if (restore == 0) { /* save the old characters for later */ -+ /* save the old characters for later */ -+ if (restore == -1) { - lseek(fd, POSITION, 0); - read(fd, &save, sizeof(save)); -- } -+ } -+ - t = time(NULL); - tm = localtime(&t); - sprintf(buf0, CLOCK_FMT, tm->tm_hour, tm->tm_min); -@@ -308,7 +310,7 @@ - display_clock(clock_printed); /* print the clock */ - clock_printed = event->vc; - } else if (clock_printed == event->vc) { -- display_clock(2); /* restore the screen */ -+ display_clock(-2); /* restore the screen */ - clock_printed = -1; - } - selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-1.19.3-kernel2.4.9.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-1.19.3-kernel2.4.9.patch deleted file mode 100644 index 9c2bb52f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-1.19.3-kernel2.4.9.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- gpm.c -+++ gpm.c -@@ -321,7 +321,7 @@ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ - /*-------------------------------------------------------------------*/ --static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) -+static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, int *restart) - { - static unsigned char data[32]; /* quite a big margin :) */ - char *edata=data+type->packetlen; -@@ -336,6 +336,22 @@ - return NULL; - } - -+ if (data[0] == 0xaa) { -+ j=read(fd,&(data[1]),2); -+ if ((j < 1) || (data[1] != 0x0)) { -+ if (m_type->getextra) { -+ data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; -+ gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); -+ return data; -+ } -+ gpm_debug_log(LOG_DEBUG,"Error in protocol"); -+ return NULL; -+ } -+ gpm_debug_log(LOG_DEBUG,"Mouse was replugged"); -+ *restart = 1; -+ return NULL; -+ } -+ - if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - -@@ -402,6 +418,7 @@ - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ int restart; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -@@ -432,9 +449,11 @@ - - do /* cluster loop */ - { -- if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) -+ restart = 0; -+ if ( ((data=getMouseData(fd,m_type,kd_mode,&restart))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -+ if (restart) return -1; - if (!i) return 0; - else break; - } -@@ -926,6 +945,40 @@ - unlink(GPM_NODE_CTL); - } - -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ -+ which_mouse=mouse_table+i; /* used to access options */ -+ -+ /* open the device with ndelay, to catch a locked device */ -+ if (opt_dev) -+ { -+ if (!strcmp(opt_dev,"-")) -+ *fd=0; -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ else /* use "/dev/mouse" */ -+ { -+ opt_dev = "/dev/mouse"; -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ { oops(opt_dev); } -+ } -+ /* and then reset the flag */ -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); -+ /* create argc and argv for this device */ -+ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -+ -+ /* init the device, and use the return value as new mouse type */ -+ if (m_type->init) -+ m_type=(m_type->init)(*fd, m_type->flags, m_type, -+ mouse_argc[i], mouse_argv[i]); -+ if (!m_type) -+ { oops("mouse initialization failed"); } -+ -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ - /*-------------------------------------------------------------------*/ - int main(int argc, char **argv) - { -@@ -951,38 +1004,7 @@ - - for (i=1; i <= 1+opt_double; i++) - { -- which_mouse=mouse_table+i; /* used to access options */ -- -- /* open the device with ndelay, to catch a locked device */ -- if (opt_dev) -- { -- if (!strcmp(opt_dev,"-")) -- fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- else /* use "/dev/mouse" */ -- { -- opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -- { oops(opt_dev); } -- } -- -- /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -- -- /* create argc and argv for this device */ -- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); -- -- /* init the device, and use the return value as new mouse type */ -- if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type, -- mouse_argc[i], mouse_argv[i]); -- if (!m_type) -- { oops("mouse initialization failed"); } -- -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /* FIXME: stderr must be closed at this point, as protocol init needs it */ -@@ -1114,11 +1136,13 @@ - - for (i=1; i <= 1+opt_double; i++) - { -+ int rc; - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) { - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1127,6 +1151,15 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ } -+ else -+ if (rc == -1) { -+ /* try to reinitialise the mouse */ -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } - } - } - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-evdev/README.evdev b/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-evdev/README.evdev deleted file mode 100644 index 058832b8..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-evdev/README.evdev +++ /dev/null @@ -1,64 +0,0 @@ - GPM SUPPORT FOR LINUX EVENT INTERFACE MICE - - Usage: - ------ -Simply run -$ gpm -t evdev -m /dev/input/event## -Just as it if were a serial or PS/2 mouse. The hard bit is working out -which event device your mouse is plugged into. The way I do this is to -run -$ xxd /dev/input/event## -For all the event devices (in numerical order), and see which one -produces output when I wave the mouse. - -Note that you may need to pass a `-r #' flag to gpm -- I find that it is -a tad too sensitive by default. - - FAQ: - ---- -Actually, these aren't FAQs at all since this is the first time I have -shown the world this code... - -1: I get no output from any of the /dev/input/event## devices, what's -wrong? - -Execute the following commands as root: -$ modprobe input -$ modprobe hid -$ modprobe evdev -These will load the driver if it is available. If it isn't (i.e. if -either of these commands fail), you'll need a newer kernel or a backport -- I would advise getting a newer kernel. It may also be worth checking -if you are also sufferring from the problem solved in Question 2... - -2: The mouse moves randomly all over the place, or does nothing at all, -yet I get output from /dev/input/event##, what's with that? - -There are two possibilities here - you may have other event devices such -as USB joysticks or keyboards attached, and the device node you're -looking at is one of them, or the major and minor numbers of your device -nodes are incorrect. It is worth noting that, as shipped, SuSE Linux -7.1 has the wrong minor numbers on it's event nodes. - -If you suffer from the first problem, just try the other event devices -until you find the mouse. If you suffer from the second problem execute -the following commands as root in a bourne-compatible shell e.g. bash: -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -3: I don't have a /dev/input directory, or the directory is empty. - -If you use devfs, then (as root): -$ modprobe evdev -should fix it. - -Otherwise, you can run the following commands as root: -$ mkdir -p /dev/input -$ cd /dev/input -$ umask 22 -$ rm event* -$ for i in `seq 0 63`;do mknod event${i} c 13 `echo ${i} 64 + p|dc`;done - -(c) 2001 Philip Willoughby diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-evdev/gpm-evdev-patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-evdev/gpm-evdev-patch deleted file mode 100644 index c4e1af02..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-evdev/gpm-evdev-patch +++ /dev/null @@ -1,98 +0,0 @@ -diff -ur ../gpm-1.18.1/configure.in ./configure.in ---- ../gpm-1.18.1/configure.in Fri Nov 12 13:27:37 1999 -+++ ./configure.in Tue Mar 27 22:11:46 2001 -@@ -49,7 +49,7 @@ - lispdir='${datadir}/emacs/site-lisp' - fi - --AC_CHECK_HEADERS(syslog.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) -+AC_CHECK_HEADERS(syslog.h linux/joystick.h linux/input.h ncurses.h ncurses/curses.h curses.h) - - AC_ARG_WITH(curses, - [ --without-curses disable curses support even if curses found]) -diff -ur ../gpm-1.18.1/mice.c ./mice.c ---- ../gpm-1.18.1/mice.c Fri Nov 12 13:27:37 1999 -+++ ./mice.c Tue Mar 27 22:11:23 2001 -@@ -60,6 +60,9 @@ - #include - #endif - -+#ifdef HAVE_LINUX_INPUT_H -+#include -+#endif /* HAVE_LINUX_INPUT_H */ - - #include "gpmInt.h" - #include "twiddler.h" -@@ -948,6 +951,42 @@ - return 0; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static int -+M_evdev (Gpm_Event * state, unsigned char *data) -+{ -+ struct input_event thisevent; -+ (void) memcpy (&thisevent, data, sizeof (struct input_event)); -+ if (thisevent.type == EV_REL) -+ { -+ if (thisevent.code == REL_X) -+ state->dx = (signed char) thisevent.value; -+ else if (thisevent.code == REL_Y) -+ state->dy = (signed char) thisevent.value; -+ } -+ else if (thisevent.type == EV_KEY) -+ { -+ if (thisevent.code == BTN_LEFT) -+ { -+ state->buttons ^= GPM_B_LEFT; -+ } -+ else if (thisevent.code == BTN_MIDDLE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ else if (thisevent.code == BTN_RIGHT) -+ { -+ state->buttons ^= GPM_B_RIGHT; -+ } -+ else if (thisevent.code == BTN_SIDE) -+ { -+ state->buttons ^= GPM_B_MIDDLE; -+ } -+ } -+ return 0; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1406,6 +1445,14 @@ - return type; - } - -+#ifdef HAVE_LINUX_INPUT_H -+static Gpm_Type * -+I_evdev (int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ return type; -+} -+#endif /* HAVE_LINUX_INPUT_H */ -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -1532,6 +1579,14 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+#ifdef HAVE_LINUX_INPUT_H -+ {"evdev", "Linux Event Device", -+ "", M_evdev, I_evdev, STD_FLG, -+ {0x00, 0x00, 0x00, 0x00} -+ , 16, 16, 0, 0, NULL} -+ , -+#endif /* HAVE_LINUX_INPUT_H */ - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-patch-psaux-reconnect b/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-patch-psaux-reconnect deleted file mode 100644 index 77a897a1..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-patch-psaux-reconnect +++ /dev/null @@ -1,324 +0,0 @@ -begin 664 gpm-psaux-reconnect.bz2 -M0EIH.3%!629366GG?R``,\-_D'XZML\]W7U9O>[O1OGMSA]:&\SZ.]]U`HUM@-/COGC>[.]6M7ON -M/7O'/INW'MVU?@[V -MD]:ZHJ[-4%SZN=%S+?=W:R5[#D5T">>>=Y]/@&=>>WV;VHV^NY/KK[N'-.I7 -M;FQ+T[O<.ZUN0Y/?=U:;-JH+VUV;[%O=NM6PTMQH'I&0S34Q`] -M0#U```````)-)(DGJ:8F*GA1^J:?JGC5-&@#33-0T``!ZC0````B2($:"$\4 -M&I3]HD_0)DJ?FJC_4Q/2D_4;%1^J>U3]()Z0_5--`T&@(DB""8FFI@5/R3,A -M3--4_TE/U,F93R%,FTT93TR0&@-,AH8O:;D6F!(I&+&'C!LD!IM$4(0AY98I -MC*D0[Z89)58&HRDPEDF3(66;3)MHUDV&D8F5"L1@T)2TPK@W)D8A9;*1A9DI -M`PB1D&#`+P?,EG[,KN3]#3D8MQS8T#!C^%\&'O>JDI0$UDAH#;@RY!X6$@,U -M-680`T!@9%EB18"#+,A@3$#48S"8!@&I0L#*%(D9,0:+$TLH&BCY["\=Q`DF -MPO[`P(O'>\?$<<'U1V"?M>^\X, -M9_+VK/#M^CQT.+N^)_QY/>Y9.S//M;EN6V[7HSAQOU-HVB(LM]OLW*/H-5UC -MT-UGU)EC.U>EQKO>M'ZF2_`S&"?2SF8VVL\<]PS+Q938,TH#ZB>?70_Z,G1% -MHADP+,)D -MRYY9)DS#*[9Z'?[7VQ_G_E_O2Q*M$ES'G=?*^P*[_\>3Q>ODT%NC3_?^+Q+8 -ML'(+E96*#PA'`MX27PY*%&$+VKB=Z@L26K)D--V -MFOZV.T?"QQ#-A+M.H['1LW;0]S`Q;O/-Q<`,E,6F0YMG-S&D-SL> -MYNX.;#<%#IA^YN!0X.3G82-.YVM[1C@4]CP$N)Z78[['@'4;""& -M\U4M(TS,"%#`PAF>H.HY)EEDY:.G!6&V,%-CXN*/\NRG]^Y\;R/*P+!&-@Z+ -M6TM%+&E=\,#O[^Y=\%^:9@E*)2D[47Z^&[M<%JL4=A')!1%IJU^,=X'"<*[3 -M![@LWLRP6,MYJJAARM<_P7Y9Y@D96A?JF$)AD,AB)#`7-?ZZ/Y^G5*:5%8># -MY_/]9JMILOAB?J3CW6L$Y>FZ+>"=XCN"X&\8&RGS`RTBC8&HI*=[J9B6GV'?W^C9SZ\6VA-YJWQ -ML:[5VG-OVR[VC.88\F6W^FZ/6.^-6"R$1$?3#:#!>Z.:5Z&MC -MO=$]@.4I]>>V-L.%=9^'HQ?6L9I:ZPK2DGCNG0B5O^W(GB.9?"7'Z.'#JPT) -MIQ#[T%"E02"@)#H16$&1)(3\!@515!V!91LK[P'J3#6R&^R=$YF29L^UBT.# -M\%=3D\$@<=^H&KCRZ3^/:V+3KA6'%M<7:K86!R#:/#)[SH#R#&.9[YT+51C\;Q&3\K39R:_[-L$A>0^&>#X/>G[?S*JIJ_O7LC+B7J(O3=33N_M:WC-] -MC6;[[;0HSBE*R],4''!2)%LF$.Y:"XXKQS.V333F@:K%\NWSTH)3O9@T#ISS -M$LV?L^SB)FAF\4#%+AY7[QA\#QF?I=H^QZ0UBA)UN_JK$LZBP6#2=5DL,JD/ -M>LV(P^/Z9#)C!C&)&`Z9XWQ>&)*,K:.8L'+MA("(=[S2P.1*@7A -M2I%2V!4I^P>C\M!@50Q'L:YBWL[LZ@Z"8T&R,[L#,3PSUH.(S8PQ726AD41\ -M%Z\M8_BKHP"U^7X8WQ-`=EO*_$]`=UV$=,I(Q([0MD5OXEB_FP6PP/-;WL#I -MQQ-@$>*^,GKR;P]^`T8(@C&)A(T2(*(K")%/N.F\X9AWOS-42)"-,8O0-1ZW -MNY.3;HJ!_A:W7/)J4&T"BAZ!\0-OH\W=155TZ'GO5J]I+\/(J>]-P[^34\-J -M*,#L+'8''3"Y4KG*$Y[F0:$X0,V.H\&+B/\VA@Z1#I?7D`8DEWO!XZ[Q<`4; -M+?OZO7YNQY#L9W08XART2R&XN`D2(CD;=4**,T'>+ZQ>'=PW!LZY.S[K[@<&0>2A-XM9&&@:KY.U#388.2<1`P[2IY4,(2#($DCO*$ -MZ$-5VT)"0"19`DN]AM.W8.BXY00VVW\\SQU%$NND0H1-5M-RDQ+S%7CQQS0P2>8P&W"495)+]^%Q__8\T!,KH/=I -MBY$^70BZ9P.8S+::V7=Z-#W\;Z7(J`[<>%B1[?\?"<<.4W$ -M27$5UQ&"04P7)T'Q8="?M1XX5"LM'DFMDRB\'/52@_:^.V^F'20K!D'*(B8( -MCTYZ+11J"B6D5!&Q,<,F/*48[F,$TX8U*GE/,(RI:A@\3KW[&SB%5NB8X05%E.3I"D#$S@YAV)/7=,(YWK-&J&[A%XMU7)O1/EDX-[%?D -M2TT--3!N9NFBC6FG7W27)<$[\%,=C)^F#^]`I^0]$::PNE(/D.\=]6<(O -M$V_`O`6"[QXKQ>%$G6&T2(I(;&E2:^M>O\.H-6_6+Y6W;$[RV%Q"7?=';YZ<^@B'06> -MF=IJQ?'">"Q4L7*U"XI$21P$P;ZG@L%U<,),EW![SK!@B@HL(B`*`L@BG'AX -MY)N=O//%@'K5^/%01&'U$U"[I7Y\E1]C.2R]FJOR%TQZKN.JZW$CZ%11[`'' -M<$`#L7`ED:[CU\V;`]B[+HF'?.9F3OI(:$T%<3+;#@_=R39Y#B/'J<5V#]E\ -M*O0T.Y]_!):C>]]/U\#L+5>IL1KJ=LE(@614+UI(0=4Y_@G-_<%L#SS;`VYN -MN_6&YOE[B<2&4=7@]VVQI+)=NPA?ETJ882=)E[R-;@V>4[-AQ-Y"U5=OF2(! -MA7U`94%"TW0>G.ZQ?@XBAHZ2M[Y)S`XL-`FHVE;_)UAII+K`C"&K@)J+P:5U -ML3481CQ:)GF)P\\)#WN0X<-JKG68(J'HI4Y/3C5BY"R=!.JM@);#502(IP]83I0>.?MP>Y1*;N -M.91SN.IBZ&P6*:L>(>H",H$]2"#@T#`+(*/PC,DR8X+N)P#%_2@UH;;%EO!> -MY/RR]K="1I(%H&AH/5TR@IC39@7\N"%M0,.?F4J_-*XR'(6.=XXMB/DXVTAB;38=I?()"H5=ZGH;F -MQ$];N>1W<=Q1/7O!\8*/J$%B*6JJ<.F)`Y#KB^;*]!4X1)4Y$%YCUFT\"1". -M#VE--(4TT%'GTE^`/`'6^#CTF[F\P.FIM7?3Y#84%S][X^!<\[@:,;UPPC#" -MKQ,;5E-:;45='!);$U0B.V3ABE8/:>[.7T.CZ+FK/W==;E-$>Y9PZMU,75.+1<:L];N)3=DC<<&YU$X(8@XG,9B!4I[,11@D,, -M>DY$"?4,G+HX(+O`R15MW04`P,/#G[E86G24X+MZ9+P5^9,CNL&5Z0@:LJ,L -M>T4B'K3;#(Y.\O!2RD"!]SQF+!SY;.K.Y::V-AIP#0=Q@;DJ/+G<;2Z6,)?' -M[L\`[%$SL/63YQ176P\[-9/KW!V)`$WERG.!PX'%9U"^`[+'V#0A9!@Z1@*>M@B6/ -M>0K;#_Q@F<`"ZP_(-J%'6Q$@0/TK00&,1\\D(P6@^4W^B1^H\`XLXY1P^;EW -M%QL.@:.#'ZFT_>,$-G,>=#[%Y6(D@'=%H:C3&J`D` -M*4/&U,D1WV'"PT,`3,.%I11-.R213E`JD4H"`;FU(8J"W:#QA\1X)_(/.&`I -M[/ZD`=`0(^Q=5.Y,?@P1I7&Z_)V'?=BT%K6+9N3#%_L>YT?E=7\T.IXNC8># -MU#K,*,(%K=LM?J3;?0^Q^#O/$AI(8)#7/.'@'QH6WJ&`4O`F*+F[V[F'6=?` -M^TL.9B]8VY^7*BL/83OG079.!F6XAB'93M'&-BX\Y@*DNMO\V"B:K;-EHG-O -M/_5?2Y.HGR4]^'44A@FV2,$U>#169W#8#:]6ED6K)5+]1M5Q0=I_,P48.]53 -M]5?R'L_+0?[-5&@<1R'$'^T&M,P(69!N+ -MM&^.%>$;2"5P; -M_E9U75\7EIROA\8S/RF5.4W+D&@=)G$N\8O?51%HIX-*=\Y&I=7MF6R(V=-W -M!W1/2SQ`>`#R`Z@T/H3I8"P2X-5`>]'Z!L#;`O0PH"R?30A>>H#-!,#6!.0) -MH(R/(=D.1441%!@RJ`Q$B*0(!B`4.8-N]-$`S#`@X@YA`L1:BIG*`4BD"P05 -M#GS9I-*(/EQ2#?2W%'JEJ$"P4VZ0HO>A=#G(\@'E!,HC00(!`(A<[5BA!@DB -MO9Y;Z[<0-B.3Z`F>4!BD!H!0E)!"4)8"QA:BBB(-M:EM*M++:(\L` -M\,)["0]`0.CTR'*"'<4`H40I$"E"R2T658+$?7GH'6NC!`'7.K6'14.*)V`E@!M`?P$`\R>I@QB!^>$6FE:2! -M'ZT;`](\XX[@;/@`=R:&``Z1@&X#[!YOL_DH!]1_EZGF(6B^=ZSU?L95BS5: -MCZ:;D(3T@&`E80N@R!TAWX;08Z*!W5L(V_![4>9"(]014^`& -M@-+%$D(6.3813FD[V1MY7I8P5%H(1J:C*`W!?.`LL'Y$N#B#?`+#BAOR`55A$_H\4,#\86F>55H])+`W6F+17`\`R" -M@6V->;=&!=4"PX=MJ$H^C7P7OQMV2S83_>4E\L`.2FN#"#[?O"A0FVF\L/K; -M\5T=X]M#RL-,$Z*UQPWN7`&!D8#B0C,KF`QR.%4.2;X!F$53> -M#[=%9CO':8K,B@3)^@-^EMO&%#LM13D`_C?>4N79U`,%N3T>+)7)LR;*.+[# -M01UD`L&<9/5<%I5%D#('N4:3Q,FPPI#(9@M"B#JYH%!D*:AO_9/MZ7PEX_!^ -MI[N,!M4BS*)PW5I?SC-?E^3R].@,75:Y'884^,0H]FH#CZ.V!5.X<='2.B6Y;8 -M6I2*UR:">@GMO?JQV!>,2GR?#Q;\M_FO#:Q<`-^6"1$_%\MXQB/XA!Y%EJH/ -M9F9FFT(<;\!)=XO#";'D,J0#T/2(/%G/H'H26>HCUC]@:^T7BBNUH\VXU*>% -M)N&=*TMF)X1K?Z8HWE)(:U<,.)!9AW!HF\"@JN69.Y6O50'2YDT;0B&$9_)O -M8NSQQ4N@<7<]3*9Y?#7U(20;Z?=\W>L?'YP^I$OLOL<%MPLBR6+R]QN1%+=` -M/"ICX1PD+*N`-NG5K1Z>+"H8PNF*`J.&NC#X#M -M(EG7-^IDDV%,,AHVDT@Q0ISY)I-,F&\YE#DV'SB+WA -M`67BB+THN7\Y:?J^;?Y$6*OEN_&O2H#UWSUW*K(LMBJ5*KG.6[00,QN-0PR. -M!9*G,E66T!1Y$G=7G:#0G)2'C]:K:1P!]7H<]3:CT4;8TTH#"J5`U%>*&8I5 -M[Y-)$G`KLBN>AV--IE,\'3F8D1.(LY)#9VX'W9)K"+F,$]W%^7J[MVL9,=1- -M=M9F^.49RZ72G%'*Q"&*RR)KTNJXC$]8X#`*(,'WIY\89[+5S](+R^5U9ZY0 -M?.Z:?-2OH&W'#'=)$1@(GZA,3_&Y\S2,7:3Q;I:!TOW5\^7Z:E>3TVN/5[_I -MQP.F[AR^%Z;\<)Y;1A5+UE3#HE&F9"Q=,`;@YE[7@4J?'JV+-%TI#6OFNG+H -M+ZCB/-L2YPH:2'CIC_04)H">A."*34T469XW^K;D-F[PY#= -MC8GVPT7KV4.8)]%[!<6A[]=@JAW(206HB,`. -MQO_8>1>>`E[A3SL1(@LZ*K)Z%ATZ=,4_IDB+R3)IRUZ_>]#,,>T`>.)E6SM% -M1HFQF5D\;>B<5NU28RBA+0$]/EX/#]X7^8+-.S.'%7WNF/-T?XR)1^5;:I^& -M(.53]SV`:#3]$>_#3\955:TM)8HM[95W?S\A^AE@N!SE7)\.%:%1XM17@7+, -M)A78X\^H8NU\J+NU-&ZT*N;/:RI"MGHG6I-/1UP;U%J*)> -MKJM;U#*)-R'(/,)A8YJIIR7N5+@WJC2>B8DC8%J)(E1M`KK91)ALWM%V:V42 -M2WO.;-CUO4:W@9!N]\(-RXE&G;>B+>SL+&K*[0O3UMJ,MVSQQPK"#R?4V?,Q -MLG/RM@=;DC07?8UX@^@P6R84R/)]+2:W)V%;#_>AGA/$TX-BLL':^UO=,(`[ -M'%J,36[)X\5N#W(2J'J@$AH?$DQ@'*PW5555Y/G@Q/:YPF\/#L3)/C:7[K(B -M?Q`/]0?Q"($0H5VL;SHX'[C#_\]GUS?1ZC)XWI"^Q]`PI@K)`]`P[;[7R -M'[^U#%"![XF/IZ'_-ON&7(AIWI0V&QIPQ$?41"$8C%4^U[QSRL_Q?0Y#&/Z/ -MX.B!F'KA]@T#SGM9\?*;ITKE"I,K8MR]-%$<\(!DM -M/;V$$$&Z`3,`SA4,0U>8$P`<#\OH_@EP&O2VH'^C@<*R2]D%TQ.RJ:O -MHX?3X??RJO/\1N?4`Q/-=2E9E,0,.<)OQ`@1R/PTIC8LCZ`Y//?U6#:QU`0D -M?;8C][<;;"H:@9#.5@R/%6HO/]QP`\RFO>TD^X@?K]@[5(&2L -M@20TAPM-Y+PY!U`O32G.^IC&,`8P<;@^CQ?,&L'0\'`]F3EGD]ZL&"OC!YA/ -M.#[U'VV[\RI[ZZ>_]BFFD"L#4.X#XSFZJG\K&O&\,%3XFT-+"9RTBQ1Z9>0> -M@T93!^'M#:*^G5`.UWNJH&(!O!R;J+\^2%:#Q`C2$0C_I+'Z8M8'#] -M=[Z6.1H\'ZU<6B3.>F<:T\UGXAV!K")JCK?M^`6!<(P!O>"4!(A?MU -M2H>`($\03SLL?:W,7GP"/4"^4%T"D3:H60+1%*`!\)*GV;DE+@7/\:'R>[UA -MU)/]O;O:%I$D4D3M@413YQ_=[OZ?;@=RQ)WAW` -M80YFP#C`"_6[-7H-)#8>(:VF)P`$0\O:'&[GPY(2H!@-JA") -MI1&E$S;O7M@)B=]6MF#O_8*VV%(W;Y`:/+.AE;[2M#$(AF8TW%8AK#Z@^'I5 -MS?JF?,/>/?RSCZ`SC2@539VI('6],PZ@AHS`S6!YXB?R)P/G`^69W9U=-Y;" -M55O=/,7V0>`>6Z$1!#DA0_I)O?V#1\$S!>#:/MQ:F9QN?\-]]W`8=)6&2D`Z -MPW'PG=BK[FR!2$&,.P$BH'T:'\V8\%3)V0A0D']!*0&IP(7VP.IQSLX]1\:W -M5.X.@.X"#O!I#RHOK<0`S$:`/$KDG6+XGO)(2LLYJ@P(,S27:C`E%@#\?P"( -M=F/I'CG&D&T=HD`>+!QI,4&UZI -M\(^D,@>.J8S0=PS=(5-H(`RM+I12.[;!H%7;<+;`(%;`.N/F9WD?1]YNH!CN -M)8$SJ(Q%Y9.=AI"&=`XP -M&'48$+XS@Z`_$LJF0M*@4>^0.>`"R#KNNYGYZAH7WXG!(>V]!*E/>%('I!]5 -MQL#^BAXQ^5#YP8IT=JP]8W3JB$C9?=L*!W>^GT.H_;M4K9'FAID#0\AWJ@=' -MY$.+![-!^?4)S$D^MH[F3F/(E(ROUS""J+(L%6/^H('M^/,/&N2P8F"M`_#- -MM!($(2*J`JR*H*H9"3KZ2`D]C\&9YPV"9V=7O#.`8$Y*X/X6CH0,S"C:'IY0 -MG5"7V=>?)G"!U]YV%(T>WP7CX>JQL6`!OA6U`*!V`N9P#W_Q/.YN<5&6`#PIZ#,N>?O"EG+_CQ3J!K/3&<-3\*R'.#T].(;>&,?SFSVN>D -M*^I0?7C_\HM(+9CC&$?E-)2Y%E#;0E3K_IOD/[O!,3%=B=AUVAS=/;%F2=:& -M'&IW?"@B"<&0%HV0HA._[K&U_3>3Q@YW>MH>]_G]',[Q_L>\*`\#@!_0B8.` -MF#BX--P8YO6_%]3HZ9*Z`W8.;]C9N[G^(TQ`B&JF+`8Y"M,AG0[17LL@%UV' -MS`0/]L8F%#?\)\79V@/:TO(O_W*#,P#92L%+99P0KB'VN@??[1"RYCH#F+`L -M@22(QH:6R*60W#LVRPKF,<7[\Q#`;L8TP:42FA//[>0#]2&@P&@V:/<8B3SW -M(`W;#\7N@8@#J#1E!KX^'DX\P_&UX99HKEMJ`??ZPM8@D&Y-EF#SV3W[`$YL -M>)K0UN&@>=Y0Y`?CDOWB7#FQ,#L$QI9#G#:GU:&PCQ?P-3RAMAX!0S4-BS"BK.KB!H$W@A@"N(YQ=\(P.=B6FZ,-*CK'6&26+,#0,X60&/0 -MP$\"I -MV#U$381;^C[@X"%LV`;,0ROCK!/,%T[(.80Y;D]J6UPT3`9PXJDD'SXZ#<$P -M&DAQ>IT!QJC0@^O"FOSS@ETV1XRP/Z<`:.PN@CRL]5@;@IX(C(B68-B`350, -MD,5\[%3`,0R;.]@/J@_^V"6B3V4\R'HD%(L1@0B,`8Q7FC:RR+*)`0H3-3F9 -MY+]O#1AT?X\`#3YX\48$!\Z'GI)`+!(02S5`Q(V@%# -M`=%S7D(%T"REW:%DL(E15[(!W5_5@.D!@$<3'<)#?$4Z@A&+&5&1%9L<$\[S -M%MR/AKH"D!%16HF*./^O`0]C<:7$I1 -MI>(A0>IM]0-M'1:.$2MVERZ7+K@4H9:B6?Z,0P@P3V>NMO[.R%`M((8 -MQ=1Q--ZU%Q."0QKS6<8"OQ`0)ABDU,+MG1(%B2F4TWZQD>'H+ABH#LW,"14H -MZOC,ZGK?4:^FJD[JD<+JI#=*AK%Q=,I*6#98,8U45A/;RM3VPMBWTE00;XCA -M1J\!:OE-07=$FYF$ -MHTD/9`TF^1E@:F"0.`@@/F+BBJ6W"Y)#=`R#<>!U+X.DK#J.ZE.PXRFUX&JS -M5C:@43`R8P0(T-;E8E!27VJ.B""B:::1N/%,7U;@[K%F:!MTX4]6RYZ%&#A& -M82KO`%*8YF5-@K%W6`IEL7`%Z8#(*HH`M5*+:7;E!S[3W)X1=2>)(ZCNLJ%P -M`F=QAY89L>_*Q1IZ=S=X.7MQ)?,D@?()(%P!<#)GSI,(UYQ]OY>;B](0T(9& -MN-P2PSC`H=[ -M`"JKA84#=96K+1+=,+D.W89B=D>(\!,1Z6&9RYBAUP&P]*>_95V']6%NF(V5 -MSV"8P+&T.:`.AV'64#"*GVPL@1`_OXAW)U:"=1HZ4N&/ZO6Q#@_O=AV=7"Q! -MT3DT/D.9;$;NAO&@%&P2R;-VV1UQ-[NH=3=@;VV3,$TS%*DOU8%P-*BEH&:A84QY:V&KR$4Y1A8F -M`V!RU$LMNL07T(:A=`.*H;2@U$BD39\6+:R.]\, -MVX(XI(8`_$B)?=AZ8[AY` -MNX(H(8#UD-;(-`Q*2-@#@N0P`ZV#200"D:*,*PYG%0NJT4T1.`/NN#8J(?$# -M(`P&*D!D$P(FK!.:!9[4BD&"!((F%WU$":[NOVPS=!AOA%C%`"`2#""MF*41 -M&R,8)!>]^<;(G+ZDUQ1_F'!SY8)PN(D#W+4,7`7O%+*4@&^A*NDJ#`/,@5IP -MNG/<)UD']T:28!LWJ\B@;F`+98\!V;$/``^"M8IS8G>&FNI>(=0)B'8AI[0\ -M$GN_+)V20#U@;`1!*!2C-%L0&$4]O]MK27Y_>-K-G\?U]E6=@XO6:*13:##F -MCH-8=.$@4F'I8>[$/CS$I4(I`5$-`>.*3V\`)LBBR*(P)%!$4D&X?D#M&H,2 -M,/9TWFH;7,,1@TP3O#`6H(3`\H,*&E8;F]W)L4.S9<"[@T,N&('AN'-NCJ@GY3W#UCK;*H1M@ZHX2OII!<[) -M@,0"W!V3NB0<%A4'0._X`G6H<(MH'+;<880TC.TJ$(H>L8^F6!U(W^)##(P- -M&2&?G=_Q0`D%(05D"F)$*@F[W=7LZS(AFS;.74;D+NXH!EMJ#F[D@_O8,:6, -M$H^-"70_>EP:_6R(6LCMV[3L>AR;'$%S>(/QS5X^"@9O1!U`6C`OJ.M>#U.+ -MB;`]6:?.,`ZP@/(<>]@DBYP&$YH-+N0@-.I,<7D_6)_.8\/Y+R%-%8P2/+T) -M8*,4,>[UAV;R//JKMU?EJWDXDJ)U1.6"21`D(D!6(P6*#UC/*02Z*^O4'*7[CR'7&)1XCOUF@XI@'A0!L@[T#9^!D -M%L@V#(UV&2$D)>SU9N[[_GUXD=D\46MH.O>,B.Z0R(0YQ?)Y(G=6CI#Q7>7P -ML:/U0#-!B.8>U@ELYP0F!/]Z?^MZIH3X_,)\?Q"S3A$S/$"$/*^7.F(0@,8P -MA#AE^^W1;';$#VH$*0,ADI4(0M2AJ/O!F\0T(2-32*]_;G$*($\NPR;49#L` -M

WPA^O`!'6^Q`\(<48">WG-\#6 -M-+L((<83%%V*:"*>V#@,8V#$\],NA5#2%,7\H,!+//K+.N..:>%NY.T+YU82 -MS5S@[FOE]:)I;&T>/6D439&Q@#J0+8G?#;$(*1CNVL0E,>A,+A0,!+Y"Y@/*^3C[0%,!Q3P48HY@7)J&B -MGL;1L"6''>B=S9#3S;GO2[ZTX&@>?%PB2$951# -M@X(60=R;YV0KJ(7D4AA5*9)2F!M00HLD)HI:W)I!T#@78.4<")9&RB^\&XW+#$@&<+2H&!&B`V(7+'JL7$NN!1% -MH$,&Z`:E&!9P84F"(81C$)(1#E\PH')@!8-1\&=#B/QRI+F\!?'9K)AP-!TJ:Q:0UT84NQ6-QLV4#1HZB@FH6* -M01D4`34L+-@LA0(E!`:4P*"ZA0(%D;7@TJQ(V24D#:_C'%N[!P`!,;@=$+34 -M>D3^!W'(L^R(]I%NP7N8%;1P/<6N&/CH,OO&"6]X,&)C'L0CAFE"\1(<'=UE -M+JF?>YA:M!:&.3KUAW`.P9D>A0()U1\01'SH):BN,$)L7<]HA\81",8JDC!C -M&*R,@,@ABNCX.$0V`=T1\:$VBD21"`$&+G+*S]2#7NL.(;MR\,@KKM&,H3&/ -MR#L<5+Q(PB`,BL(K$D#Z^Y5+@A=/D!+&(F(7X+[QN- -M01@J73DO*$4+]O7BBW+B)\/B#M"6V'YA;O":0%IQJ96/R"1$\L9.7Q$*#[@L\WY4 -M7Q:K[`C`,K84?-,TUI#WC@E`>,?:/UCO!I4/@&X[S)'.U!B#>XP(P-B,>A@; -MR"0+D%YHF*BTGX@0D-F`()W5=(3H/WQAA0[?.UU,0VD\H,*!<*P=F8&V0@?` -M0T3K(`&1=E+(]0_G*M>$8$L6(VHM899S#U.@M`\@CY6<'U--08Q444@R'=W6 -M"YW6;&1B6SB%N%&':F#O/8:AV9NMCH:8;X-Q[=-;7>X:X.A8P1(QF[?I(?C. -M(,*YRELQLXI0_@^,`IP5G$FI&#!0/4,0:^E'!ZM0PDD8H8&1M#BQ$2'SJ$'% -M!Q$P`4VFG]UTQ0"RJT88FR&PV`!9ZXG3!FX(D@D6`@2*Q7=EUG8ABCH^`Q2E -M]CJY\?.)86) -M!D2PY.@.P-F!2*M.[H@8--`<">&Y2E2Z$#..,5P(LAC,!A>!>"*>+0.%M(T0 -M)90UA]!8W3L"0D@I6.I9[*6B1=4B#P!VJ.C -MD0C$A$.8J;S64R$Y=&!@1*S0AEJ9L01EDJREDB],I"K40V%"6%8;V#7[8!/6 -MQI(U"B#<#D*KDKH##(T^O,VX4)Q!5#LAP^&B0^<5(GTP#/#(;W;Q>=8`=%(P -MHZ0&#I6'N8K!@E65H>`23BJQB(BHJT":"<>7S/+.J"'1>853U4752H#5P:`9 -M%-KBXAD&*S&T+*Y,"@OS5,"BC&X.:@4DIGKR4T4H!C@I=_`H'.Q6;^I"I&RX -MT8MK.+.#"&H3:-#+$9"]@M*MJL.4U:XP<0,9@P;`V.EDN0JY,B]1D*"N3?DV -MV'I`PA-/ZI(M@V73@"B"II1H?![M#\@+GC<"$%3W`[,R,%A(S0& -M&VU%$:6Q3*)!2(L"0@H7>V75#9U&8D,*=U#',RCF.PUH!7DN0($86P^BLC%" -MQ>X4,6[NP'/);C''(ZG"<=`X9`Z@$-A%874\T1^2`#(+44!D4/+`:W8>",1= -M0H>G;%,@]VQ6,`.KB!8))SP$9@+(R@^\DC4U3+5>Q<[#!Q._H-!6=A:Z1VL, -M(FUBA=1D;,:N1Q,,Q*Z8JY"J$8&G%D8<(H]D5)$9!L#V+0Z/'@6#*+]4?J6" -M>CK`Q1T:5#,,#PJ=XB,40LYQVFV`))DKAIT^^>!.@G6+@I1\J.;JJ&QT -M3'\I,*H -M-(.N8ZZPG6VP*PN9'FC/2BMFPIJJ$#<)]8Z9!]-Q$Q?BC?N1?3%$92902$#6 -M'0=&6E#2=@!0)"#Z1OUQ'.LA(,S61^XPE]*2VZ[)&B,=J*^@0I8P],#*)9]3 -M3ZG("N(.RB#"'N&'+@,V!D`77E&\0_AXST#9`/V5D_$J>Y4-5H)#JI_6#F#= -M';`"/12)1%W"I`4M80HW@\,$U?"HDP[2+"!XPJB1E`44$$[(V(OA^'2ZP^P< -MS>"<\T3!ZT&"P`8A$1A"$$/U"2`/MS+;16%PCW[,Q]Q"$YD1>U"2:?+4;X%/ -MC:*0!S&BZ\+)HPPC&\(V2I!#Z=!AD8AZD"KK=&BO2UA!_;BF`IW*4*4!04A0 -M7@EA-_Z=!F$C([^Y&.:=.;MUP\X>0*PA<-R''ED,^P$D&X$%V1;(84+-HOM@ -MKV0:@]X"Q<38;4+("81._`75L/Y84!6C0^X2#_'(>:/J1MP1+AV%(D8,!^QH -M1'40(07\(%_W)08,(`SX4H'LSRF#1S?/XQCP9P2E0*P3I,\D:DU-B?%]0V"S -M=GU1,4@9F)CVRZ0_/X[X]X6%LB%U(0'-:NCJCS`W$/: -MB\QF&>J#%0Q6D(@`5D,@%; Fri, 3 Aug 2001 10:16:54 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:16:54 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA12404 for ; Thu, 2 Aug 2001 13:57:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA15417 - for ; Thu, 2 Aug 2001 11:57:40 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 5CD8A197F0 - for ; Thu, 2 Aug 2001 13:57:35 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id MAA29536 - for ; Thu, 2 Aug 2001 12:21:26 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id NAA22247 for ; Thu, 2 Aug 2001 13:55:51 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA89271; - Thu, 2 Aug 2001 11:55:51 GMT -Date: Thu, 2 Aug 2001 11:55:51 GMT -Message-Id: <200108021155.LAA89271@vlet.cwi.nl> -To: alan@lxorguk.ukuu.org.uk, garloff@suse.de, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: brent@linux1.org, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -X-UIDL: mH&!!69L!!)/N!!9H%!! -Status: RO - - From: Kurt Garloff - - working on notebooks I got used to the touchpads. - Now, a lot of notebooks have a Synaptics touchpad. - It offers a few additional features, such as tossing or the third mouse - button (by a short click in the corner) ... - - Unfortunately, the synps2 generates nonstandard codes when in - extended mode, amongst which the reconnect (170) token. - The kernel (since 2.2.15) does interpret it as such and empties the queue. - - This seems to appropriate for a real plug event. For a synps2, it's not, - but makes your mouse dead for a second. Instead the data should just - be passed to userspace (gpm). - - So I made the behaviour switchable via a sysctl.=20 - -Hmm. I don't think there exists a "reconnect token" AA. -At power up or after a reset (FF) the mouse sends AA -(self test passed) followed by 00 (the ID: I am a PS/2 mouse). -During operation the value AA is entirely legal and has no special -significance. - -Moreover, it seems that the specs say that the host should not react -to the AA but wait for the 00. The expected protocol at power up is: -Mouse: AA 00. Host: F4 (enable). Mouse: FA (ack). -Afterwards the host will send F3 to set the sample rate -(or to initialize a wheelmouse). - -A quote [1]: -"At power-on, the PS/2 device performs a self-test and calibration, -then transmits the completion code $AA and ID code $00. If the -device fails its self-test, it transmits error code $FC and ID code $00. -This processing also occurs when a software Reset ($FF) command is received. -The host should not attempt to send commands to the device until -the calibration/self-test is complete. -Power-on self-test and calibration takes 300­1000ms." - -The reaction to FF (reset) from the host is an immediate FA (ack) -followed half a second later by AA 00. - -Therefore, I think the kernel mouse handling was broken when this -strange AUX_RECONNECT stuff was introduced. It caused a tiny trickle -of complaints. -Bug 1: AA is not necessarily anything special -Bug 2: the sequence AA 00 from the mouse should not be interrupted - -I don't think that it is a good idea to start building infrastructure -around it. By default this AUX_RECONNECT should be disabled, since -it is just plain wrong. Then the Synaptics touchpad will work. -In other words, no sysctl but #if 0 ... #endif. - -For people who unplug and replug their PS/2 mouse with running -machine, or who use a KVM switch (I think it was only Brent Verner -who asked for this code): if what I say is correct you should -always see 00 following the AA. So, there may exist a more cautious -patch that will bite fewer people and does not react to AA but to -the sequence AA 00. - -Andries - -[1] See http://www.synaptics.com/decaf/utilities/tp-intf2-4.PDF - -From garloff@garloff.de Fri Aug 3 10:17:11 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03455 - for ; Fri, 3 Aug 2001 10:17:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id SAA25088 for ; Thu, 2 Aug 2001 18:20:32 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id QAA18370 - for ; Thu, 2 Aug 2001 16:20:29 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 526AF197FD - for ; Thu, 2 Aug 2001 18:20:28 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id QAA31115 - for ; Thu, 2 Aug 2001 16:44:17 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id SAA28559; - Thu, 2 Aug 2001 18:20:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id SAA15174; - Thu, 2 Aug 2001 18:18:34 +0200 -Date: Thu, 2 Aug 2001 18:18:34 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, brent@linux1.org, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802181834.B14708@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, brent@linux1.org, - linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021602.QAA113498@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" -Content-Disposition: inline -In-Reply-To: <200108021602.QAA113498@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: D\h"!`_h!!Sci!!p3S"! -Status: RO - - ---8GpibOaaTibBMecb -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Thu, Aug 02, 2001 at 04:02:38PM +0000, Andries Brouwer wrote: -> From: Alan Cox : ->=20 -> > 2.2 has had the sysctl for ages, and it defaults to off - -I would definitely not object to defaulting to off. - -> Not precisely - it is a boot parameter "psaux-reconnect". -> That is better than a sysctl. - -Why should that be better than a sysctl? Boot parameters are ugly. You=20 -need to reboot in order to change them ... - -Your other mail implies that we can fix the problem without manual -intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 -consider that the best solution.=20 -Otherwise, I'd like my patch to be applied maybe with a changed default. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---8GpibOaaTibBMecb -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aX1ZxmLh6hyYd04RApT9AKDHFa2hTt8CIkrzSQ2hLGjNUBBsugCgpXHZ -6yFa+mIM8HhuiH2NRCRhd04= -=5vOe ------END PGP SIGNATURE----- - ---8GpibOaaTibBMecb-- - -From aeb@cwi.nl Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03487 - for ; Fri, 3 Aug 2001 10:17:12 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:12 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA26954 for ; Thu, 2 Aug 2001 19:27:15 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18729 - for ; Thu, 2 Aug 2001 17:27:12 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 18E5119805 - for ; Thu, 2 Aug 2001 19:27:11 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31523 - for ; Thu, 2 Aug 2001 17:51:00 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.67]) by hera.cwi.nl with ESMTP - id TAA28832 for ; Thu, 2 Aug 2001 19:27:08 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id RAA113816; - Thu, 2 Aug 2001 17:27:07 GMT -Date: Thu, 2 Aug 2001 17:27:07 GMT -Message-Id: <200108021727.RAA113816@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 8El!!!\_!![&!#!ZU<"! -Status: RO - - From: Kurt Garloff - - > Not precisely - it is a boot parameter "psaux-reconnect". - > That is better than a sysctl. - - Why should that be better than a sysctl? Boot parameters are ugly. You - need to reboot in order to change them ... - -Of course I hope that we'll handle this correctly at some point, -without any options or parameters. In my eyes a sysctl is heavier -infrastructure than a boot parameter, so I prefer the latter -when a temporary fix is needed. - - Your other mail implies that we can fix the problem without manual - intervention by parsing AA 00 instead of just AA. If it's true, I'd=20 - consider that the best solution.=20 - -Maybe precisely one person reported this, and his address -now bounces. If there exist people who need this "psaux-reconnect" -they can report on the codes they see. Note that just like AA is -a perfectly normal code, also the sequence AA 00 is perfectly -normal. Testing for that only diminishes the probability of -getting it by accident. - -Instead of adding boot parameters or sysctls or heuristics, -probably we should just transfer the codes seen to user space, -e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -and decide whether that is something special. - -Andries - - -From alan@lxorguk.ukuu.org.uk Fri Aug 3 10:17:13 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA03497 - for ; Fri, 3 Aug 2001 10:17:13 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 03 Aug 2001 10:17:13 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA27204 for ; Thu, 2 Aug 2001 19:34:02 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA18757 - for ; Thu, 2 Aug 2001 17:33:59 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 7E3B219805 - for ; Thu, 2 Aug 2001 19:33:59 +0200 (CEST) -Received: from the-village.bc.nu (router-100M.swansea.linux.org.uk [194.168.151.17]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA31555 - for ; Thu, 2 Aug 2001 17:57:46 +0200 -Received: from alan by the-village.bc.nu with local (Exim 3.22 #1) - id 15SMN6-00015y-00; Thu, 02 Aug 2001 18:34:56 +0100 -Subject: Re: [PATCH] make psaux reconnect adjustable -To: Andries.Brouwer@cwi.nl -Date: Thu, 2 Aug 2001 18:34:56 +0100 (BST) -Cc: garloff@suse.de, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -In-Reply-To: from "Andries.Brouwer@cwi.nl" at Aug 02, 2001 05:27:07 PM -X-Mailer: ELM [version 2.5 PL5] -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit -Message-Id: -From: Alan Cox -X-UIDL: ,k9!!~k2!!E1k!!Ybi"! -Status: RO - -> Of course I hope that we'll handle this correctly at some point, -> without any options or parameters. In my eyes a sysctl is heavier -> infrastructure than a boot parameter, so I prefer the latter -> when a temporary fix is needed. - -The input device infrastructure pending for 2.5 already handles all of -these issues - -From garloff@garloff.de Thu Aug 2 10:27:44 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id KAA28565 - for ; Thu, 2 Aug 2001 10:27:43 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Thu, 02 Aug 2001 10:27:43 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id EAA25642 for ; Thu, 2 Aug 2001 04:23:33 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105] (may be forged)) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id CAA11977 - for ; Thu, 2 Aug 2001 02:23:32 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 09411197E8 - for ; Thu, 2 Aug 2001 04:23:29 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id CAA25998 - for ; Thu, 2 Aug 2001 02:47:24 +0200 -Received: from pckurt.casa-etp.nl (root@pckurt.casa-etp.nl [192.168.157.2]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id EAA18388; - Thu, 2 Aug 2001 04:23:24 +0200 -Received: (from garloff@localhost) - by pckurt.casa-etp.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id EAA15231; - Thu, 2 Aug 2001 04:21:00 +0200 -Date: Thu, 2 Aug 2001 04:21:00 +0200 -From: Kurt Garloff -To: Linus Torvalds , - Alan Cox -Cc: Alessandro Rubini , Hubert Mantel , - Linux kernel list -Subject: [PATCH] make psaux reconnect adjustable -Message-ID: <20010802042100.B14010@pckurt.casa-etp.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , - Alan Cox , - Alessandro Rubini , - Hubert Mantel , - Linux kernel list -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" -Content-Disposition: inline -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7-SMP i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 8JL"!c8N!!e'[!!jN;"! -Status: RO - - ---69pVuxX8awAiJ7fD -Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" -Content-Disposition: inline - - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus Alan, - -working on notebooks I got used to the touchpads. -Now, a lot of notebooks have a Synaptics touchpad. -It offers a few additional features, such as tossing or the third mouse -button (by a short click in the corner) ... - -gpm -t synps2 does support those additional features and via the -R epeater -mode you also get it under X11. - -Unfortunately, the synps2 generates nonstandard codes when in extended mode, -amongst which the reconnect (170) token. -The kernel (since 2.2.15) does interpret it as such and empties the queue. - -This seems to appropriate for a real plug event. For a synps2, it's not, but -makes your mouse dead for a second. Instead the data should just be passed -to userspace (gpm). - -So I made the behaviour switchable via a sysctl.=20 -/proc/sys/dev/ps2/psmouse_reconnect (defaults to 1 =3D the interpret behavi= -our) -Being at it, I also made the kbd error and unknown scancode reporting -switchable. (It used to be ifdefs.) - -Please apply attached patch (against 2.4.7). - -Allesandro, should I submit a patch for gpm to automatically handle this for -synps2 in case the kernel patch gets accepted? - -Regards, ---=20 -Kurt Garloff [Eindhoven, NL] -Physics: Plasma simulations [TU Eindhoven, NL] -Linux: SCSI, Security [SuSE Nuernberg, DE] - (See mail header or public key servers for PGP2 and GPG public keys.) - ---i9LlY+UWpKt15+FH -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl.diff" -Content-Transfer-Encoding: quoted-printable - ---- linux/include/linux/sysctl.h.orig Tue Jul 31 23:49:42 2001 -+++ linux/include/linux/sysctl.h Thu Aug 2 03:41:34 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ ---- linux/drivers/char/pc_keyb.c.orig Fri Apr 6 19:42:55 2001 -+++ linux/drivers/char/pc_keyb.c Thu Aug 2 04:01:15 2001 -@@ -92,8 +92,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp) -+ *valp =3D 1; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +198,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -320,10 +394,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -348,11 +420,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -370,11 +440,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -404,12 +472,15 @@ - mouse_reply_expected =3D 0; - } - else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; -+ if (sysctl_psmouse_reconnect) { -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } - } -+ else -+ add_mouse_randomness(scancode); -=20 -- add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -=20 -@@ -511,17 +582,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -751,6 +819,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE - ---i9LlY+UWpKt15+FH-- - ---69pVuxX8awAiJ7fD -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7aLkLxmLh6hyYd04RAtTfAJ0Y5pDpKz/cMablMNOe7Et6KOIYXQCg0hQ2 -VP6sTljkegsAQX4fy5vGwzI= -=8pPh ------END PGP SIGNATURE----- - ---69pVuxX8awAiJ7fD-- - -From garloff@garloff.de Wed Aug 15 15:40:12 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12797 - for ; Wed, 15 Aug 2001 15:40:11 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:11 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id LAA04351 for ; Tue, 14 Aug 2001 11:57:18 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id JAA25466 - for ; Tue, 14 Aug 2001 09:57:18 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 84F3C197E6 - for ; Tue, 14 Aug 2001 11:08:53 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id KAA29979 - for ; Tue, 14 Aug 2001 10:18:46 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id LAA30279; - Tue, 14 Aug 2001 11:57:05 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7E9v1S02420; - Tue, 14 Aug 2001 11:57:01 +0200 -Date: Tue, 14 Aug 2001 11:57:01 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" -Content-Disposition: inline -In-Reply-To: <200108021727.RAA113816@vlet.cwi.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 481f3d3391eba7ce48596873968fe7df -Status: RO - - ---jho1yZJdad60DJr+ -Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" -Content-Disposition: inline - - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Andries, - -On Thu, Aug 02, 2001 at 05:27:07PM +0000, Andries Brouwer wrote: -> Your other mail implies that we can fix the problem without manual -> intervention by parsing AA 00 instead of just AA. If it's true, I'd= -=3D20 -> consider that the best solution.=3D20 ->=20 -> Maybe precisely one person reported this, and his address -> now bounces. If there exist people who need this "psaux-reconnect" -> they can report on the codes they see. Note that just like AA is -> a perfectly normal code, also the sequence AA 00 is perfectly -> normal. Testing for that only diminishes the probability of -> getting it by accident. - -I can confirm what you suggest: My mouse (Logitech wheel USB/PS2) sends -indeed AA 00.=20 -So, I extended my patch (which you will dislike even more, I know, as you're -against sysctls unlike me): -psmouse_reconnect =3D 0: Do nothing (just pass all to userspace) -psmouse_reconnect =3D 1: Flush Q & ping mouse on AA 00 (default) -psmouse_reconnect =3D 2: Flush Q & ping mouse on AA (old behaviour) - -> Instead of adding boot parameters or sysctls or heuristics, -> probably we should just transfer the codes seen to user space, -> e.g. to gpm. Then it is up to gpm to recognize an AA 00 sequence -> and decide whether that is something special. - -With reconnect 1 or 2: After reconnecting, mouse behaves strange (jumping - around the screen) -With reconnect 0: Mouse is dead - -In both cases restarting gpm gets the mouse back to work again. -It seems the imps2 driver does some initialization to the mouse. - -If I use the plain ps2 driver, then finally, I see the benefit of the -reconnect code in the kernel: -With reconnect =3D 1 or 2: It works after replugging -With reconnect =3D 0: Mouse is dead after replugging - -In the latter case restarting gpm helps. - -Patch is attached. -It adds the sysctls as the last patch did, but now the psmouse_reconnect has -3 possible values. Also, I added a printk, so the kernel logs detected mouse -reconnect events. - -Linus, Alan, I'd like to have your input: - -Do you like the patch as is? Should I remove the sysctls and just look for -AA 00 (as Andries may prefer)? Shouldn't the AA 00 be passed to userspace -as well in any case (to allow e.g. the imps2 driver to do reinitialization)? - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---OgqxwSJOaUobr8KG -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl2.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 10:44:50 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 0; -+int sysctl_kbd_report_to =3D 0; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 0 -+#define sysctl_kbd_report_to 0 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -515,17 +596,14 @@ - if (resend) - break; - mdelay(1); -- if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -+ if (!--timeout && sysctl_kbd_report_to) { - printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +833,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---OgqxwSJOaUobr8KG-- - ---jho1yZJdad60DJr+ -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7ePXtxmLh6hyYd04RAtjyAJ9yB7UclerJDTGLJ7/fRRuKKpt3UQCgv8lZ -DkKvb6jTel1rBPPB1U3zEwI= -=nhjD ------END PGP SIGNATURE----- - ---jho1yZJdad60DJr+-- - -From aeb@cwi.nl Wed Aug 15 15:40:17 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12838 - for ; Wed, 15 Aug 2001 15:40:16 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:16 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id NAA06534 for ; Tue, 14 Aug 2001 13:12:41 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id LAA26110 - for ; Tue, 14 Aug 2001 11:12:39 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1CDEC197B0 - for ; Tue, 14 Aug 2001 12:24:16 +0200 (CEST) -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id LAA30422 - for ; Tue, 14 Aug 2001 11:34:09 +0200 -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id NAA25182 for ; Tue, 14 Aug 2001 13:12:30 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id LAA99888; - Tue, 14 Aug 2001 11:12:29 GMT -Date: Tue, 14 Aug 2001 11:12:29 GMT -Message-Id: <200108141112.LAA99888@vlet.cwi.nl> -To: Andries.Brouwer@cwi.nl, garloff@suse.de -Subject: Re: [PATCH] make psaux reconnect adjustable -Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it, torvalds@transmeta.com -X-UIDL: 01036beb2df8ccc4bba2d0dc24296831 -Status: RO - - From garloff@garloff.de Tue Aug 14 11:57:23 2001 - - I can confirm what you suggest: - My mouse (Logitech wheel USB/PS2) sends indeed AA 00. - So, I extended my patch: - psmouse_reconnect = 0: Do nothing (just pass all to userspace) - psmouse_reconnect = 1: Flush Q & ping mouse on AA 00 (default) - psmouse_reconnect = 2: Flush Q & ping mouse on AA (old behaviour) - - With reconnect 1 or 2: After reconnecting, mouse behaves strange - (jumping around the screen) - With reconnect 0: Mouse is dead - - In both cases restarting gpm gets the mouse back to work again. - It seems the imps2 driver does some initialization to the mouse. - - If I use the plain ps2 driver, then finally, I see the benefit of the - reconnect code in the kernel: - With reconnect = 1 or 2: It works after replugging - With reconnect = 0: Mouse is dead after replugging - - In the latter case restarting gpm helps. - -Before having an opinion about what would be appropriate, -let me make sure that I understand the facts that you report. - -You talk about reconnect, but what is your definition of reconnect? -Is it that the mouse sends AA or AA 00, or is it that you unplug -and replug the mouse? - -Andries - -From garloff@garloff.de Wed Aug 15 15:40:27 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA12966 - for ; Wed, 15 Aug 2001 15:40:27 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:27 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id RAA11366 for ; Tue, 14 Aug 2001 17:06:23 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id PAA27516 - for ; Tue, 14 Aug 2001 15:06:22 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 3A388197B0 - for ; Tue, 14 Aug 2001 16:16:44 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id PAA31732 - for ; Tue, 14 Aug 2001 15:26:35 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA01811; - Tue, 14 Aug 2001 17:03:47 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EF36O05943; - Tue, 14 Aug 2001 17:03:06 +0200 -Date: Tue, 14 Aug 2001 17:03:06 +0200 -From: Kurt Garloff -To: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it, - torvalds@transmeta.com -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it, torvalds@transmeta.com -References: <200108021727.RAA113816@vlet.cwi.nl> <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GFHULmA0mO3kKGOo" -Content-Disposition: inline -In-Reply-To: <20010814115701.A1952@gum01m.etpnet.phys.tue.nl> -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 2657c8b50ec315e0f9505a3199547b77 -Status: RO - - ---GFHULmA0mO3kKGOo -Content-Type: multipart/mixed; boundary="+S4DbcR7QPeSsP0V" -Content-Disposition: inline - - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 11:57:01AM +0200, Kurt Garloff wrote: -> Linus, Alan, I'd like to have your input: ->=20 -> Do you like the patch as is?=20 - -Well, probably not, as it contains a typo which lets machines without kbd -hang. Fixed version attached. Sorry! - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---+S4DbcR7QPeSsP0V -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-psaux-reconnect-sysctl3.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-psau= -x/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-psaux/drivers/char/pc_keyb.c Tue Aug 14 16:56:58 2001 -@@ -81,8 +81,9 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 -+#define AUX_RECONNECT1 170 /* scancode when ps2 device is plugged (back) i= -n */ -+#define AUX_RECONNECT2 0 /* scancode when ps2 device is plugged (back) i= -n */ -+ - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -92,8 +93,83 @@ - #define AUX_INTS_ON (KBD_MODE_KCC | KBD_MODE_SYS | KBD_MODE_MOUSE_INT | K= -BD_MODE_KBD_INT) -=20 - #define MAX_RETRIES 60 /* some aux operations take long time*/ -+ - #endif /* CONFIG_PSMOUSE */ -=20 -+/* We want to be able to handle the psmouse reconnect token; unfortunately= - the -+ * Synaptics touchpads (and probably others too) use it for their extented -+ * functionality and produce them in extended mode (as set by gpm -t synps= -2). -+ * So we make this adjustable via a sysctl. garloff@suse.de, 2001-08-01 */ -+ -+#ifdef CONFIG_SYSCTL -+#include -+#ifdef CONFIG_PSMOUSE -+int sysctl_psmouse_reconnect =3D 1; -+#endif -+int sysctl_kbd_report_unkn =3D 1; -+int sysctl_kbd_report_to =3D 1; -+ -+static int psaux_sysctl_handler (ctl_table *ctl, int write, struct file *f= -ilp, -+ void *buffer, size_t *lenp) -+{ -+ int *valp =3D ctl->data; -+ int ret =3D proc_dointvec(ctl, write, filp, buffer, lenp);=20 -+ if (write) { -+ if (*valp > 2) -+ *valp =3D 2; -+ } -+ return ret; -+} -+ =09 -+ -+ctl_table psaux_table[] =3D { -+#ifdef CONFIG_PSMOUSE =20 -+ {DEV_PSMOUSE_RECONNECT, "psmouse_reconnect", &sysctl_psmouse_recon= -nect, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+#endif =20 -+ {DEV_KBD_REPORT_UNKN, "kbd_report_unknown", &sysctl_kbd_report_unkn, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {DEV_KBD_REPORT_TO, "kbd_report_timeout", &sysctl_kbd_report_to, -+ sizeof(int), 0644, NULL, &psaux_sysctl_handler}, -+ {0} -+}; -+ -+ctl_table psaux_psaux_table[] =3D { -+ {DEV_CDROM, "ps2", NULL, 0, 0555, psaux_table}, -+ {0} -+ }; -+ -+ctl_table psaux_root_table[] =3D { -+#ifdef CONFIG_PROC_FS -+ {CTL_DEV, "dev", NULL, 0, 0555, psaux_psaux_table}, -+#endif /* CONFIG_PROC_FS */ -+ {0} -+ }; -+static struct ctl_table_header *psaux_sysctl_header; -+ -+static void psaux_sysctl_register (void) -+{ -+ static int initialized; -+ if (initialized) return; -+=09 -+ psaux_sysctl_header =3D register_sysctl_table (psaux_root_table, 1); -+ /*psaux_root_table->child->de->owner =3D THIS_MODULE;*/ -+ initialized++; -+} -+ -+/* -+static void psaux_sysctl_unregister (void) -+{ -+ if (psaux_sysctl_header) -+ unregister_sysctl_table (psaux_sysctl_header); -+} -+ */ -+#else /* CONFIG_SYSCTL */ -+#define sysctl_psmouse_reconnect 1 -+#define sysctl_kbd_report_unkn 1 -+#define sysctl_kbd_report_to 1 -+#endif /* CONFIG_SYSCTL */ -+ - /* - * Wait for keyboard controller input buffer to drain. - * -@@ -123,9 +199,8 @@ - mdelay(1); - timeout--; - } while (timeout); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "Keyboard timed out[1]\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "Keyboard timed out[1]\n"); - } -=20 - /* -@@ -324,10 +399,8 @@ - *keycode =3D E1_PAUSE; - prev_scancode =3D 0; - } else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); --#endif - prev_scancode =3D 0; - return 0; - } -@@ -352,11 +425,9 @@ - if (e0_keys[scancode]) - *keycode =3D e0_keys[scancode]; - else { --#ifdef KBD_REPORT_UNKN -- if (!raw_mode) -+ if (!raw_mode && sysctl_kbd_report_unkn) - printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", - scancode); --#endif - return 0; - } - } -@@ -374,11 +445,9 @@ - *keycode =3D high_keys[scancode - SC_LIM]; -=20 - if (!*keycode) { -- if (!raw_mode) { --#ifdef KBD_REPORT_UNKN -+ if (!raw_mode && sysctl_kbd_report_unkn) { - printk(KERN_INFO "keyboard: unrecognized scancode (%02x)" - " - ignored\n", scancode); --#endif - } - return 0; - } -@@ -397,6 +466,7 @@ - return 0200; - } -=20 -+static unsigned char psaux_prev; - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -@@ -407,13 +477,24 @@ - } - mouse_reply_expected =3D 0; - } -- else if(scancode =3D=3D AUX_RECONNECT){ -+ else if(scancode =3D=3D AUX_RECONNECT1=20 -+ && sysctl_psmouse_reconnect =3D=3D 2) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -+ else if (scancode =3D=3D AUX_RECONNECT2 && psaux_prev =3D=3D AUX_RECONNEC= -T1 -+ && sysctl_psmouse_reconnect =3D=3D 1 ) { -+ printk (KERN_DEBUG "PS2 mouse reconnect detected.\n"); - queue->head =3D queue->tail =3D 0; /* Flush input queue */ - __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } -=20 - add_mouse_randomness(scancode); -+ psaux_prev =3D scancode; -+ - if (aux_count) { - int head =3D queue->head; -=20 -@@ -516,16 +597,14 @@ - break; - mdelay(1); - if (!--timeout) { --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n"); - return 0; - } - } - } while (retries-- > 0); --#ifdef KBD_REPORT_TIMEOUTS -- printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); --#endif -+ if (sysctl_kbd_report_to) -+ printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd cable?\n"); - return 0; - } -=20 -@@ -755,6 +834,7 @@ -=20 - /* Ok, finally allocate the IRQ, and off we go.. */ - kbd_request_irq(keyboard_interrupt); -+ psaux_sysctl_register (); - } -=20 - #if defined CONFIG_PSMOUSE -diff -uNr linux-2.4.7.kurt-1/include/linux/sysctl.h linux-2.4.7.kurt-1-psau= -x/include/linux/sysctl.h ---- linux-2.4.7.kurt-1/include/linux/sysctl.h Tue Jul 24 18:48:05 2001 -+++ linux-2.4.7.kurt-1-psaux/include/linux/sysctl.h Tue Aug 14 10:37:54 2001 -@@ -594,7 +594,8 @@ - DEV_HWMON=3D2, - DEV_PARPORT=3D3, - DEV_RAID=3D4, -- DEV_MAC_HID=3D5 -+ DEV_MAC_HID=3D5, -+ DEV_PSAUX=3D6, - }; -=20 - /* /proc/sys/dev/cdrom */ -@@ -653,6 +654,13 @@ - DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=3D4, - DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=3D5, - DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=3D6 -+}; -+ -+/* /proc/sys/dev/psaux */ -+enum { -+ DEV_PSMOUSE_RECONNECT=3D1, -+ DEV_KBD_REPORT_UNKN=3D2, -+ DEV_KBD_REPORT_TO=3D3, - }; -=20 - #ifdef __KERNEL__ - ---+S4DbcR7QPeSsP0V-- - ---GFHULmA0mO3kKGOo -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eT2qxmLh6hyYd04RAkdVAKDWsk64qjIijqnd7OhfUabDk93DuwCeNs8v -2N8GBj91DmP0Sxgh6OamUaw= -=F2r7 ------END PGP SIGNATURE----- - ---GFHULmA0mO3kKGOo-- - -From torvalds@transmeta.com Wed Aug 15 15:40:51 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13043 - for ; Wed, 15 Aug 2001 15:40:51 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:40:51 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA12956 for ; Tue, 14 Aug 2001 19:01:01 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA27985 - for ; Tue, 14 Aug 2001 17:00:58 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 1C28219853 - for ; Tue, 14 Aug 2001 18:11:20 +0200 (CEST) -Received: from neon-gw.transmeta.com (neon-gw-l3.transmeta.com [63.209.4.196]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32362 - for ; Tue, 14 Aug 2001 17:21:08 +0200 -Received: (from root@localhost) - by neon-gw.transmeta.com (8.9.3/8.9.3) id JAA00580; - Tue, 14 Aug 2001 09:59:33 -0700 -Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) - id xma000571; Tue, 14 Aug 01 09:59:28 -0700 -Received: from penguin.transmeta.com (penguin.transmeta.com [10.10.27.78]) - by deepthought.transmeta.com (8.9.3/8.9.3) with ESMTP id JAA13406; - Tue, 14 Aug 2001 09:59:30 -0700 (PDT) -Received: from localhost (torvalds@localhost) by penguin.transmeta.com (8.11.2/8.7.3) with ESMTP id f7EGwtS01753; Tue, 14 Aug 2001 09:58:55 -0700 -X-Authentication-Warning: penguin.transmeta.com: torvalds owned process doing -bs -Date: Tue, 14 Aug 2001 09:58:55 -0700 (PDT) -From: Linus Torvalds -To: Kurt Garloff -Cc: , , - , , - -Subject: Re: [PATCH] make psaux reconnect adjustable -In-Reply-To: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Message-ID: -MIME-Version: 1.0 -Content-Type: TEXT/PLAIN; charset=US-ASCII -X-UIDL: ca99923198dca96e1919c7a0ca08e81b -Status: RO - - -> Well, probably not, as it contains a typo which lets machines without kbd -> hang. Fixed version attached. Sorry! - -Hmm.. - -I really have two comments, but I haven't followed the whole discussion, -so feel free to just say that it's been hashed out already: - - - sysconf entries are suspicious for stuff like this. If some code really - requires this to work correctly, that's exactly the kind of code that - would run automatically at bootup. A sysconf doesn't really help people - in that case - we'd be much better off with just a bootup switch. - - - do we actually need the config switch AT ALL, whether at bootup or not? - What exactly breaks if we just always pass the AA 00 values through? - Apparently nothing ever breaks, which makes me suspect that people are - just being unnecessarily defensive. - -In short, I'd prefer a patch that just unconditionally removes the code, -unless somebody KNOWS that it could break something. That failing, a -simple kernel command line option sounds better than more files in /proc. - -Remember: the biggest mistake to do is to overdesign. The road to hell is -paved with good intentions. - - Linus - -From garloff@garloff.de Wed Aug 15 15:41:03 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13073 - for ; Wed, 15 Aug 2001 15:41:03 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:03 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id TAA13510 for ; Tue, 14 Aug 2001 19:38:57 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id RAA28130 - for ; Tue, 14 Aug 2001 17:38:55 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 4A6C719873 - for ; Tue, 14 Aug 2001 18:49:18 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id RAA32525 - for ; Tue, 14 Aug 2001 17:57:53 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA03978; - Tue, 14 Aug 2001 19:36:23 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7EHZhq10174; - Tue, 14 Aug 2001 19:35:43 +0200 -Date: Tue, 14 Aug 2001 19:35:43 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Kurt Garloff , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, mantel@suse.de, - rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814193543.V1085@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="GOaLjq+VdFesH+wR" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 0b1ef96a0d05d0b79e99084d0eba334c -Status: RO - - ---GOaLjq+VdFesH+wR -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -Hi Linus, - -thanks for your comments. - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> I really have two comments, but I haven't followed the whole discussion, -> so feel free to just say that it's been hashed out already: ->=20 -> - sysconf entries are suspicious for stuff like this. If some code really -> requires this to work correctly, that's exactly the kind of code that -> would run automatically at bootup. A sysconf doesn't really help people -> in that case - we'd be much better off with just a bootup switch. - -Maybe that's the difference of whether you define the kernel behaviour by -deciding what goes in and the one that tries to avoid a breakage without -changing the default behaviour ... -Of course the sysctl is less intrusive (from a user's point of view). - -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. - -PS2 mouses need this ping thing to be operational after being plugged. -But, there's no reason it needs to be done in the kernel. -* It works for plain PS2 only (not: imps2, synps2, ...) -* The userspace driver (gpm, X11) can do it as well, AFAICS - -I guess the thing has been introduced because it was more convenient than -fixing userspace. -Maybe the kernel does it a bit more efficient by throwing away the queue ... - -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -I'd be happy with removing it. -Patch will follow! - -> Remember: the biggest mistake to do is to overdesign. The road to hell is -> paved with good intentions. - -A few sysctls don't qualify as overdesign yet, I hope. - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---GOaLjq+VdFesH+wR -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eWFvxmLh6hyYd04RAid0AJkBRbQAelKjAXzaA8rRQifEPscH2ACfUUsp -BqZqeLRrmag8Bsup3yELdnY= -=dhec ------END PGP SIGNATURE----- - ---GOaLjq+VdFesH+wR-- - -From garloff@garloff.de Wed Aug 15 15:41:42 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13231 - for ; Wed, 15 Aug 2001 15:41:41 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:41 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id XAA17995 for ; Tue, 14 Aug 2001 23:29:52 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id VAA28856 - for ; Tue, 14 Aug 2001 21:29:50 GMT -Received: from vision.unipv.it (vision.unipv.it [193.204.34.82]) - by spock.linux.it (Postfix) with ESMTP id 6CDD9197B0 - for ; Tue, 14 Aug 2001 22:41:27 +0200 (CEST) -Received: from etpmod.phys.tue.nl (etpmod.phys.tue.nl [131.155.111.35]) - by vision.unipv.it (8.9.3/8.9.3) with ESMTP id VAA01350 - for ; Tue, 14 Aug 2001 21:51:15 +0200 -Received: from garloff.etpnet.phys.tue.nl (gum01m.etpnet.phys.tue.nl [192.168.84.65]) - by etpmod.phys.tue.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id XAA07270; - Tue, 14 Aug 2001 23:29:48 +0200 -Received: (from garloff@localhost) - by garloff.etpnet.phys.tue.nl (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id f7ELTlV16541; - Tue, 14 Aug 2001 23:29:47 +0200 -Date: Tue, 14 Aug 2001 23:29:47 +0200 -From: Kurt Garloff -To: Linus Torvalds -Cc: Andries.Brouwer@cwi.nl, alan@lxorguk.ukuu.org.uk, - linux-kernel@vger.kernel.org, mantel@suse.de, rubini@vision.unipv.it -Subject: Re: [PATCH] make psaux reconnect adjustable -Message-ID: <20010814232947.A16332@gum01m.etpnet.phys.tue.nl> -Mail-Followup-To: Kurt Garloff , - Linus Torvalds , Andries.Brouwer@cwi.nl, - alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, - mantel@suse.de, rubini@vision.unipv.it -References: <20010814170306.Q1085@gum01m.etpnet.phys.tue.nl> -Mime-Version: 1.0 -Content-Type: multipart/signed; micalg=pgp-sha1; - protocol="application/pgp-signature"; boundary="pAwQNkOnpTn9IO2O" -Content-Disposition: inline -In-Reply-To: -User-Agent: Mutt/1.3.20i -X-Operating-System: Linux 2.4.7 i686 -X-PGP-Info: on http://www.garloff.de/kurt/mykeys.pgp -X-PGP-Key: 1024D/1C98774E, 1024R/CEFC9215 -Organization: TU/e(NL), SuSE(DE) -X-UIDL: 186d845e4a17613c167f0da418f5f7f5 -Status: RO - - ---pAwQNkOnpTn9IO2O -Content-Type: multipart/mixed; boundary="RASg3xLB4tUQ4RcS" -Content-Disposition: inline - - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -On Tue, Aug 14, 2001 at 09:58:55AM -0700, Linus Torvalds wrote: -> - do we actually need the config switch AT ALL, whether at bootup or not? -> What exactly breaks if we just always pass the AA 00 values through? -> Apparently nothing ever breaks, which makes me suspect that people are -> just being unnecessarily defensive. ->=20 -> In short, I'd prefer a patch that just unconditionally removes the code, -> unless somebody KNOWS that it could break something. That failing, a -> simple kernel command line option sounds better than more files in /proc. - -OK, here come two patches. The first one removes the special PSAUX reconnect -handling completely. So userspace should handle it. (Which is possible; just -not implemented in gpm/X11 at this time AFAIK.) - -Second patch reintroduces the special handling again, but does -* react on AA 00 instead of just AA, thus much less likely breaking other - drivers (such as synps2). All PS/2 mouses I could access (about 5 - different models) produced AA 00, so this seems OK. -* is disabled by default, and needs to be enabled by the psaux-reconnect - boot parameter, like in 2.2.19. - -Second patch depends on first. Please apply just the first or both. - -(Current failure of gpm/X11 would make me choose for both, but then I'm=20 - more the one thinking of customers of a distro than the one trying to keep - the kernel clean. On the long term, I'd drop the second in any case.) - -Regards, ---=20 -Kurt Garloff Eindhoven, NL -GPG key: See mail header, key servers Linux kernel development -SuSE GmbH, Nuernberg, DE SCSI, Security - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-noreconnect.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1/drivers/char/pc_keyb.c linux-2.4.7.kurt-1-nore= -connect/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1/drivers/char/pc_keyb.c Tue Jul 24 18:42:36 2001 -+++ linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -@@ -81,8 +81,6 @@ -=20 - static int __init psaux_init(void); -=20 --#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in= - */ --=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -406,11 +404,6 @@ - return; - } - mouse_reply_expected =3D 0; -- } -- else if(scancode =3D=3D AUX_RECONNECT){ -- queue->head =3D queue->tail =3D 0; /* Flush input queue */ -- __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -- return; - } -=20 - add_mouse_randomness(scancode); - ---RASg3xLB4tUQ4RcS -Content-Type: text/plain; charset=us-ascii -Content-Disposition: attachment; filename="247-reconnect_bootpar.diff" -Content-Transfer-Encoding: quoted-printable - -diff -uNr linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c linux-2.4.7= -.kurt-1-recon_bootpar/drivers/char/pc_keyb.c ---- linux-2.4.7.kurt-1-noreconnect/drivers/char/pc_keyb.c Tue Aug 14 22:47:= -38 2001 -+++ linux-2.4.7.kurt-1-recon_bootpar/drivers/char/pc_keyb.c Tue Aug 14 23:1= -3:49 2001 -@@ -63,6 +63,7 @@ - #ifdef CONFIG_PSMOUSE - static void aux_write_ack(int val); - static void __aux_write_ack(int val); -+static int aux_reconnect =3D 0; - #endif -=20 - static spinlock_t kbd_controller_lock =3D SPIN_LOCK_UNLOCKED; -@@ -81,6 +82,9 @@ -=20 - static int __init psaux_init(void); -=20 -+#define AUX_RECONNECT1 0xaa /* scancode1 when ps2 device is plugged (back)= - in */ -+#define AUX_RECONNECT2 0x00 /* scancode2 when ps2 device is plugged (back)= - in */ -+=20 - static struct aux_queue *queue; /* Mouse data buffer. */ - static int aux_count; - /* used when we send commands to the mouse that expect an ACK. */ -@@ -398,6 +402,7 @@ - static inline void handle_mouse_event(unsigned char scancode) - { - #ifdef CONFIG_PSMOUSE -+ static unsigned char prev_code; - if (mouse_reply_expected) { - if (scancode =3D=3D AUX_ACK) { - mouse_reply_expected--; -@@ -405,7 +410,15 @@ - } - mouse_reply_expected =3D 0; - } -+ else if(scancode =3D=3D AUX_RECONNECT2 && prev_code =3D=3D AUX_RECONNECT1 -+ && aux_reconnect) { -+ printk (KERN_INFO "PS/2 mouse reconnect detected\n"); -+ queue->head =3D queue->tail =3D 0; /* Flush input queue */ -+ __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ -+ return; -+ } -=20 -+ prev_code =3D scancode; - add_mouse_randomness(scancode); - if (aux_count) { - int head =3D queue->head; -@@ -751,6 +764,14 @@ - } -=20 - #if defined CONFIG_PSMOUSE -+ -+static int __init aux_reconnect_setup (char *str) -+{ -+ aux_reconnect =3D 1; -+ return 1; -+} -+ -+__setup("psaux-reconnect", aux_reconnect_setup); -=20 - /* - * Check if this is a dual port controller. - ---RASg3xLB4tUQ4RcS-- - ---pAwQNkOnpTn9IO2O -Content-Type: application/pgp-signature -Content-Disposition: inline - ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.0.6 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -iD8DBQE7eZhLxmLh6hyYd04RAnJTAJ9CyWixEyMZ8qkmapcBwl/73IM7DwCfRR5s -TJ1yuGaW+r28gNeBOI1sVP8= -=HZo+ ------END PGP SIGNATURE----- - ---pAwQNkOnpTn9IO2O-- - -From aeb@cwi.nl Wed Aug 15 15:41:58 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id PAA13289 - for ; Wed, 15 Aug 2001 15:41:58 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Wed, 15 Aug 2001 15:41:58 MEST -Received: from systemy.systemy.it (systemy.systemy.it [194.20.140.20]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id CAA20482 for ; Wed, 15 Aug 2001 02:21:05 +0200 -Received: from spock.linux.it (spock.linux.it [62.177.1.105]) - by systemy.systemy.it (8.8.8/8.8.8) with ESMTP id AAA29238 - for ; Wed, 15 Aug 2001 00:21:05 GMT -Received: from hera.cwi.nl (hera.cwi.nl [192.16.191.8]) - by spock.linux.it (Postfix) with ESMTP id 6A5D6197B0 - for ; Wed, 15 Aug 2001 01:32:41 +0200 (CEST) -Received: from vlet.cwi.nl (vlet.cwi.nl [192.16.191.54]) by hera.cwi.nl with ESMTP - id CAA29683 for ; Wed, 15 Aug 2001 02:21:01 +0200 (MEST) -From: Andries.Brouwer@cwi.nl -Received: (from aeb@localhost) - by vlet.cwi.nl (8.8.6/8.9.3) id AAA100247 - for rubini@linux.it; Wed, 15 Aug 2001 00:21:01 GMT -Date: Wed, 15 Aug 2001 00:21:01 GMT -Message-Id: <200108150021.AAA100247@vlet.cwi.nl> -To: rubini@linux.it -Subject: gpm -X-UIDL: 9ee7c4ae6dd7eb661b4e97eedfbe1025 -Status: RO - -Dear Alessandro, - -[Long ago!] -There was some discussion on linux-kernel about the right way -to handle mouse disconnect and reconnect events. -A PS/2 mouse, and also the imps2 mouse, will send AA 00 after -reconnection (that is, at mouse power-on time). -At this moment the imps2 mouse needs an initialization sequence, -otherwise it reverts to being an ordinary ps2. - -So, the right setup probably is to let gpm recognize this AA 00. -If it recognizes this, perhaps the fd should be closed and reopened, -somewhat like happens now in wait_text(). - -Any idea on how you would like this added to gpm.c / mice.c ? -It will be a bit messy in all cases, I am afraid. - -Andries - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-root.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-root.patch deleted file mode 100644 index 9f88d7db..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm-root.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- gpm-1.19.2/gpm-root.y.root Wed Apr 19 01:48:41 2000 -+++ gpm-1.19.2/gpm-root.y Mon Jun 12 23:24:14 2000 -@@ -49,7 +49,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -447,9 +448,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1045,6 +1047,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1062,9 +1070,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1078,7 +1086,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - ---- gpm-1.19.2/gpm-root.c.root Wed Apr 19 01:53:38 2000 -+++ gpm-1.19.2/gpm-root.c Mon Jun 12 23:25:05 2000 -@@ -43,7 +43,8 @@ - #include /* OPEN_MAX */ - #include /* VT_ACTIVATE */ - #include /* K_SHIFT */ --#include -+#include -+#include - - #ifdef HAVE_SYS_SYSMACROS_H - #include -@@ -1305,9 +1306,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -1903,6 +1905,12 @@ - static int postcount; - static Posted *activemenu; - -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define bigendian 1 -+#else -+#define bigendian 0 -+#endif -+ - Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) - { - Posted *new; -@@ -1920,9 +1928,9 @@ - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; -- new->colorcell=dump[4+i]; -+ new->colorcell=dump[4+i-bigendian]; - gpm_debug_log(LOG_DEBUG,"Colorcell=%02x (at %i,%i = %i)", -- new->colorcell,dump[2],dump[3],i); -+ new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; -@@ -1936,7 +1944,11 @@ - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -+#if __BYTE_ORDER == __BIG_ENDIAN -+#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -+#else - #define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -+#endif - #define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) - #define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm.patch-rich-felker b/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm.patch-rich-felker deleted file mode 100644 index 28b0ad2f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/gpm.patch-rich-felker +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru gpm-1.19.6/src/gpn.c gpm-1.19.6-patched/src/gpn.c ---- gpm-1.19.6/src/gpn.c Sun Sep 23 15:00:03 2001 -+++ gpm-1.19.6-patched/src/gpn.c Mon Jan 21 23:07:52 2002 -@@ -445,7 +445,10 @@ - /* report should be here and nothing else! */ - - #if 1 /* was: "if (!defined(HAVE_SYSLOG) || !defined(HAVE_VSYSLOG))" */ -+#if 0 - if (!freopen("/dev/console","w",stderr)) /* the currently current console */ -+#endif -+ if (!freopen("/dev/null","w",stderr)) /* the currently current console */ - { - oops("freopen(stderr) failed"); - } -diff -ru gpm-1.19.6/src/mice.c gpm-1.19.6-patched/src/mice.c ---- gpm-1.19.6/src/mice.c Thu Sep 27 08:50:29 2001 -+++ gpm-1.19.6-patched/src/mice.c Mon Jan 21 22:50:26 2002 -@@ -1409,13 +1409,14 @@ - - /* Non mman: change from any available speed to the chosen one */ - for (i=9600; i>=1200; i/=2) -- setspeed(fd, i, opt_baud, (type->fun != M_mman) /* write */, flags); -+ setspeed(fd, i, opt_baud, 1 /* (type->fun != M_mman) */ /* write */, flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ -+#if 0 - if (type->fun==M_mman) - { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ -@@ -1423,6 +1424,7 @@ - setspeed(fd, 1200, opt_baud, 0, flags); /* no write */ - return type; - } -+#endif - - if(type->fun==M_geni) - { diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel.patch deleted file mode 100644 index 9176ddea..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel.patch +++ /dev/null @@ -1,1224 +0,0 @@ -diff -ru --exclude=Makefile ./ChangeLog ../imwheel/gpm-imwheel/ChangeLog ---- ./ChangeLog Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/ChangeLog Sun Feb 27 16:30:46 2000 -@@ -346,6 +346,8 @@ - for braindead chords in t-mouse with 2 button - mice. - -+CHANGED 12/16/98 by Jonathan Atkins. updated for imwheel. -+ - Tue Nov 17 23:10:04 1998 Ian T Zimmerman - - * configure.in (release): Step to 1.16.0 -@@ -806,6 +808,8 @@ - Sat Jul 25 21:08:46 1998 Edmund Grimley Evans (edmund@vocalis.com) - - * mice.c: added M_ms_plus and M_ms_plus_lr -+ -+CHANGED 9/8/98 for imwheel by Jonathan Atkins. Diff in imwheel contains changes - - Mon Jul 6 13:00:23 1998 Robin Houston (robin.houston@guardian.co.uk) - -Only in ../imwheel/gpm-imwheel: ChangeLog.orig -diff -ru --exclude=Makefile ./debuglog.c ../imwheel/gpm-imwheel/debuglog.c ---- ./debuglog.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/debuglog.c Sun Feb 27 16:30:46 2000 -@@ -58,6 +58,8 @@ - void - gpm_debug_log(int level, char* fmt, ...) - { -+ //printf("level=%d\n",level); -+ //printf("gpm_debug_level=%d\n",gpm_debug_level); - if (level <= gpm_debug_level) { - va_list ap; - va_start(ap, fmt); -Only in ../imwheel/gpm-imwheel: debuglog.c.orig -diff -ru --exclude=Makefile ./gpm.c ../imwheel/gpm-imwheel/gpm.c ---- ./gpm.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpm.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994-1997 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -61,6 +64,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }, - }; -@@ -74,6 +78,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_wheel_repeater=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -86,6 +91,7 @@ - struct winsize win; - int maxx, maxy; - int fifofd=-1; -+int wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -@@ -349,7 +355,7 @@ - gpm_debug_log(LOG_NOTICE,"Skipping a data packet (?)"); - return NULL; - } -- gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x)",data[0],data[1],data[2],data[3]); -+ gpm_debug_log(LOG_DEBUG,"Data %02x %02x %02x (%02x %02x %02x %02x %02x %02x)",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7],data[8]); - return data; - } - -@@ -368,28 +374,52 @@ - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; -+ int stick; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; -+ static unsigned char buttons; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - -+ gpm_debug_log(LOG_DEBUG,"processMouse(%d,%p,%p,%d)",fd,event,type,kd_mode); - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { - eventFlag=0; - -+ gpm_debug_log(LOG_DEBUG,"nEvent.dx=%d nEvent.dy=%d",nEvent.dx,nEvent.dy); - if (m_type->absolute) /* a pen or other absolute device */ - { -+ gpm_debug_log(LOG_DEBUG,"absolute coords."); - event->x=nEvent.x; - event->y=nEvent.y; - } -+ else -+ gpm_debug_log(LOG_DEBUG,"not absolute coords."); - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } -+ if(opt_wheel && nEvent.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_RIGHT|GPM_W_LEFT)) -+ { -+ gpm_debug_log(LOG_DEBUG,"Doing wheel button fakeup."); -+ event->buttons=nEvent.buttons&7; -+ oldB=newB; newB=event->buttons; -+ event->type=GPM_UP; -+ wheel_fakeup=1; -+ } -+ else - event->buttons=nEvent.buttons; - } - else -@@ -411,9 +441,21 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -+ stick=nEvent.buttons&GPM_STICK; -+ nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -+ (opt_wheel?((nEvent.buttons&GPM_W_UP)|(nEvent.buttons&GPM_W_DOWN)| -+ (nEvent.buttons&GPM_W_RIGHT)|(nEvent.buttons&GPM_W_LEFT)) -+ :0); - oldB=newB; newB=nEvent.buttons; -+ gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d", nEvent.buttons); - if (!i) event->buttons=nEvent.buttons; -+ if(opt_wheel) -+ { -+ gpm_debug_log(LOG_DEBUG,"nEvent.stick_x=%d nEvent.stick_y=%d",nEvent.stick_x,nEvent.stick_y); -+ event->stick_x=nEvent.stick_x; -+ event->stick_y=nEvent.stick_y; -+ } - - if (oldB!=newB) - { -@@ -425,7 +467,12 @@ - if (!(m_type->absolute)) /* mouse */ - { - if (abs(nEvent.dx)+abs(nEvent.dy) > opt_delta) -+ { -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - nEvent.dx*=opt_accel, nEvent.dy*=opt_accel; -+ } -+ else -+ gpm_debug_log(LOG_DEBUG,"opt_delta met."); - - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; -@@ -444,9 +491,72 @@ - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_W_UP || event->buttons&GPM_W_DOWN || -+ event->buttons&GPM_W_LEFT || event->buttons&GPM_W_RIGHT) -+ && !opt_wheel) -+ opt_wheel++; -+ if(opt_wheel && event->buttons&(GPM_W_UP|GPM_W_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s",(event->buttons&GPM_W_UP?"Up ":""), -+ (event->buttons&GPM_W_DOWN?"Down":"")); -+ if(opt_wheel && (event->stick_x || event->stick_y)) -+ gpm_debug_log(LOG_DEBUG,"Stick - %d,%d",event->stick_x,event->stick_y); -+ -+/* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd) -+ { -+ char buffer; -+ -+ if((event->buttons&(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT)) -+ && event->buttons>0)/* button down, not up! (not the wheel motion) */ -+ { -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_W_UP) -+ { -+ buffer=4; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_DOWN) -+ { -+ buffer=5; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_LEFT) -+ { -+ buffer=6; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ if(event->buttons&GPM_W_RIGHT) -+ { -+ buffer=7; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ } -+ } -+ else if (stick) -+ { -+ buffer=8; /* stick x & y delta values follow */ -+ gpm_debug_log(LOG_DEBUG,"repeat stick: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_x; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ buffer=event->stick_y; -+ gpm_debug_log(LOG_DEBUG,"repeat wheel: %d",buffer); -+ write(wheel_fifofd,&buffer,1); -+ event->buttons^=GPM_STICK; -+ } -+ } -+ buttons=event->buttons; -+ event->buttons=event->buttons&7; - - /*....................................... we're a repeater, aren't we? */ - -@@ -470,6 +580,7 @@ - } - return 0; /* no events nor information for clients */ - } -+ event->buttons=buttons; - - /*....................................... no, we arent a repeater, go on */ - -@@ -515,11 +626,12 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ } - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -- if (tv1.tv_sec && (DIF_TIME(tv1,tv2)buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -- return 1; -+ return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -@@ -706,6 +818,7 @@ - event.vc = stat.v_active; - event.x=statusX; event.y=statusY; - event.dx=maxx; event.dy=maxy; -+ gpm_debug_log(LOG_DEBUG,"statusB=%d", statusB); - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -875,6 +988,8 @@ - int maxfd=-1; - int pending; - Gpm_Event event; -+ int wheel_done; -+ Gpm_Event eventbuf; - - prgname=argv[0]; - setuid(0); /* just in case... */ -@@ -1035,7 +1150,7 @@ - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -@@ -1056,15 +1171,38 @@ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ wheel_done=0; -+ do -+ { -+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons); -+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ { -+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); - /* - * pass it to the client, if any - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ || do_selection(&event)); -+ memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -+ } -+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons); -+ if(!wheel_done && opt_wheel && -+ (event.type&(GPM_DOWN|GPM_DRAG)) && -+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) && -+ event.buttons<=GPM_W_RIGHT) -+ { -+ gpm_debug_log(LOG_DEBUG,"Button Up!"); -+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons); -+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s", -+ (event.type&GPM_DRAG?"GPM_DRAG ":""), -+ (event.type&GPM_DOWN?"GPM_DOWN":"")); -+ wheel_done=1; -+ eventFlag=1; -+ } -+ } while(eventFlag); - } - } - -@@ -1148,3 +1286,5 @@ - - - -+/* vim:sw=2:ts=8 -+"*/ -Only in ../imwheel/gpm-imwheel: gpm.c.orig -diff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h ---- ./gpm.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -69,12 +72,18 @@ - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+#define GPM_W_UP 8 -+#define GPM_W_DOWN 16 -+#define GPM_W_RIGHT 32 -+#define GPM_W_LEFT 64 -+#define GPM_STICK 128 - - /*....................................... The event types */ - -@@ -115,6 +124,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short stick_x, stick_y; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -Only in ../imwheel/gpm-imwheel: gpm.h.orig -diff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h ---- ./gpmCfg.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -@@ -24,7 +27,7 @@ - - /* $Id: imwheel.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - --#define GPM_NAME "gpm-Linux" -+#define GPM_NAME "gpm-Linux (imwheel)" - #define GPM_DATE "$Date: 2002/05/28 19:13:56 $" - - /* timeout for the select() syscall */ -@@ -63,5 +66,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_WHEEL 0 /* wheel events active? */ -+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ - - #endif /* _GPMCFG_INCLUDED */ -Only in ../imwheel/gpm-imwheel: gpmCfg.h.orig -diff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h ---- ./gpmInt.h Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -67,6 +70,8 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ -+ int wheel; /* flag for wheel mice */ - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -@@ -88,6 +93,8 @@ - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; - Gpm_Type *m_type; -+/* not always initialized */ -+ int opt_wheel,opt_nomiddle; - int fd; - }; - -@@ -107,6 +114,8 @@ - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+#define opt_wheel (which_mouse->opt_wheel) -+#define opt_nomiddle (which_mouse->opt_nomiddle) - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -@@ -121,6 +130,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_wheel_repeater; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; -@@ -128,6 +138,7 @@ - extern char *opt_special; - extern int opt_rawrep; - extern int fifofd; -+extern int wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -Only in ../imwheel/gpm-imwheel: gpmInt.h.orig -diff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c ---- ./gpn.c Fri Nov 12 08:27:36 1999 -+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000 -@@ -8,6 +8,9 @@ - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -183,6 +186,8 @@ - - printf("Usage: %s [options]\n",prgname); - printf(" Valid options are (not all of them are implemented)\n" -+ " -2 force two button mouse\n" -+ " -3 force three button mouse\n" - " -a accel sets the acceleration (default %d)\n" - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" -@@ -197,6 +202,7 @@ - " -m mouse-device sets mouse device\n" - " -M enable multiple mouse. Following options refer to\n" - " the second device. Forces \"-R\"\n" -+ " -n disable middle button events (on most mice)\n" - " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" -@@ -210,7 +216,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w force activate wheel\n" -+ " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -294,7 +302,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -342,6 +350,7 @@ - if (0 == opt_repeater_type) - opt_repeater_type = "msc"; - which_mouse=mouse_table+2; break; -+ case 'n': opt_nomiddle=!opt_nomiddle; break; - case 'o': - if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; - else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS; -@@ -375,6 +384,8 @@ - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -@@ -397,6 +408,13 @@ - { oops(GPM_NODE_FIFO); } - } - -+ if (opt_wheel_repeater) -+ { -+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -+ oops(GPM_WHEEL_FIFO); -+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -+ oops(GPM_WHEEL_FIFO); -+ } - - /* duplicate initialization */ - -@@ -498,6 +516,8 @@ - } - - -+/* vim:ts=8:sw=2 -+"*/ - - /* Local Variables: */ - /* c-indent-level: 2 */ -Only in ../imwheel/gpm-imwheel: gpn.c.orig -diff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c ---- ./liblow.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000 -@@ -5,6 +5,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -@@ -618,7 +621,11 @@ - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -- default: /* Nothing */ break; -+ case 3: ePtr->buttons=GPM_W_UP; break; -+ case 4: ePtr->buttons=GPM_W_DOWN; break; -+ case 5: ePtr->buttons=GPM_W_LEFT; break; -+ case 6: ePtr->buttons=GPM_W_RIGHT; break; -+ default: /* Nothing */ break; - } - } - /* Coordinates are 33-based */ -Only in ../imwheel/gpm-imwheel: liblow.c.orig -diff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c ---- ./mev.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000 -@@ -4,6 +4,9 @@ - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -93,11 +96,12 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), (stick %2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, - event->dx, event->dy, -+ event->stick_x, event->stick_y, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -Only in ../imwheel/gpm-imwheel: mev.c.orig -diff -ru --exclude=Makefile ./mice.c ../imwheel/gpm-imwheel/mice.c ---- ./mice.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mice.c Sun Feb 27 16:43:42 2000 -@@ -6,6 +6,9 @@ - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -83,7 +86,9 @@ - static unsigned char prev=0; - - if (data[0] == 0x40 && !(prev|data[1]|data[2])) -- state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ -+ { /* third button on MS compatible mouse */ -+ state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ } - else - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; -@@ -103,11 +108,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - prev=state->buttons; - -@@ -127,11 +135,14 @@ - - /* Allow motion *and* button change (Michael Plass) */ - -- if ((state->dx==0) && (state->dy==0) -- && (state->buttons == (prev&~GPM_B_MIDDLE))) -- state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -- else -- state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ if(!opt_nomiddle) -+ { -+ if ((state->dx==0) && (state->dy==0) -+ && (state->buttons == (prev&~GPM_B_MIDDLE))) -+ state->buttons = prev^GPM_B_MIDDLE; /* no move or change: toggle middle */ -+ else -+ state->buttons |= prev&GPM_B_MIDDLE; /* change: preserve middle */ -+ } - - /* Allow the user to reset state of middle button by pressing - the other two buttons at once (Edmund GRIMLEY EVANS) */ -@@ -227,7 +238,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - /* wheel (dz??) is (data[3] & 0x0f) */ -@@ -240,7 +255,11 @@ - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -- | ((data[0] & 0x10) >> 4); /* right */ -+ | ((data[0] & 0x10) >> 4) /* right */ -+ | (((data[3] & 0x0f) == 0x0f)?GPM_W_UP:0) /* wheel up */ -+ | (((data[3] & 0x0f) == 0x01)?GPM_W_DOWN:0) /* wheel down */ -+ | (((data[3] & 0x0f) == 0x0e)?GPM_W_LEFT:0) /* wheel left */ -+ | (((data[3] & 0x0f) == 0x02)?GPM_W_RIGHT:0); /* wheel right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if (((data[0]&0xC0) != 0x40)|| -@@ -334,15 +353,39 @@ - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -+ state->stick_x=state->stick_y=0; - state->buttons= -- !!(data[0]&1) * GPM_B_LEFT + -- !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[0]&4) * GPM_B_MIDDLE; -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ (opt_nomiddle?0:!!(data[0]&4) * GPM_B_MIDDLE); - -+ if(data[0]&0xc0) -+ { -+ state->buttons|=GPM_STICK; -+ state->stick_x=(data[2]&0x0F)<<28>>28; -+ state->stick_y=(data[2]>>4)<<28>>28; -+ gpm_debug_log(LOG_DEBUG,"Stick: %d %d\n",state->stick_x,state->stick_y); -+ } -+ else -+ state->buttons|=((data[3]==0xff) ? GPM_W_UP : 0) | /* wheel up */ -+ ((data[3]==0x01) ? GPM_W_DOWN : 0) | /* wheel down */ -+ ((data[3]==0x0e) ? GPM_W_LEFT : 0) | /* wheel left */ -+ ((data[3]==0xfe) ? GPM_W_LEFT : 0) | /* wheel left:a4tech*/ -+ ((data[3]==0x02) ? GPM_W_RIGHT : 0); /* wheel right */ -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d %d %d) (%d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT), -+ (state->buttons&GPM_STICK)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -- if (data[0]==8) -+ if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -@@ -353,11 +396,11 @@ - * rate is set to a reasonable value; the default of 100 Hz is plenty. - * (Stephen Tell) - */ -- if(data[1] != 0) -+ if(data[1] != 0 && !(data[0]&0xc0)) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; - else - state->dx = 0; -- if(data[2] != 0) -+ if(data[2] != 0 && !(data[0]&0xc0)) - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -@@ -389,7 +432,7 @@ - state->buttons= - !!(data[0]&1) * GPM_B_LEFT + - !!(data[0]&2) * GPM_B_RIGHT + -- !!(data[3]) * GPM_B_MIDDLE; -+ (opt_nomiddle?0:!!(data[3]) * GPM_B_MIDDLE); - - if(data[1] != 0) - state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -@@ -513,7 +556,7 @@ - ((data[0] & 32)? ((z) ? GPM_B_LEFT :0) /* graphire stylus */ - : ((data[3] & 8)? GPM_B_LEFT :0)) /* graphire mouse */ - + ((data[3] & 16)? GPM_B_RIGHT :0) -- + ((data[3] & 32)? GPM_B_MIDDLE :0); -+ + ((data[3] & 32) && !opt_nomiddle? GPM_B_MIDDLE :0); - - state->dx = (x-ox); - state->dy = (y-oy); /* divide by 5, 'cause it's too much sensitive */ -@@ -666,12 +709,13 @@ - switch (message & TW_ANY1) - { - case TW_L1: state->buttons = GPM_B_RIGHT; break; -- case TW_M1: state->buttons = GPM_B_MIDDLE; break; -- case TW_R1: state->buttons = GPM_B_LEFT; break; -- case 0: state->buttons = 0; break; -+ case TW_M1: state->buttons = (opt_nomiddle?0:GPM_B_MIDDLE); -+ break; -+ case TW_R1: state->buttons = GPM_B_LEFT; break; -+ case 0: state->buttons = 0; break; - } - /* also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons */ -- if (message & TW_ANY2) -+ if ((message & TW_ANY2) && !opt_nomiddle) - state->buttons |= GPM_B_MIDDLE; - if (message & TW_L3) - state->buttons |= GPM_B_LEFT; -@@ -1011,11 +1055,12 @@ - static Gpm_Type* - I_serial(int fd, unsigned short flags, struct Gpm_Type *type) - { -- int i; unsigned char c; -+ int i; -+#ifndef DEBUG -+ unsigned char c; - fd_set set; struct timeval timeout={0,0}; /* used when not debugging */ - - --#ifndef DEBUG - /* flush any pending input (thanks, Miguel) */ - FD_ZERO(&set); - for(i=0; /* always */ ; i++) -@@ -1186,6 +1231,7 @@ - * the vendor name: it is only propaganda, with no information. - */ - -+ opt_wheel=type->wheel; - return type; - } - -@@ -1199,9 +1245,221 @@ - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=1; -+ return type; -+} -+ -+/* MouseManPlus, ps2 version: Jon Atkins (XFree86 & hacking!) */ -+static Gpm_Type *I_mmplusps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ static unsigned char s1[] = { 0xe6,0xe8,0,0xe8,3,0xe8,2,0xe8,1,0xe6,0xe8,3,0xe8,1,0xe8,2,0xe8,3, }; -+ //static unsigned char s2[] = { 246, 230, 244, 243, 100, 232, 3, }; -+ write (fd, s1, sizeof (s1)); -+ sleep(1); -+ //usleep (30000); -+ //write (fd, s2, sizeof (s2)); -+ //usleep (30000); -+ tcflush (fd, TCIFLUSH); -+ opt_wheel=1; - return type; - } - -+/* Logitech Trackman Marblefx routine by Ric Klaren */ -+static int M_marblefx(Gpm_Event *state, unsigned char *data) -+{ -+ static unsigned int wheel = 0; /* for state machine */ -+ -+ state->buttons = !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* the red button pressed or depressed. -+ * the depress event is fired 3 times followed by a 8 0 0 packet -+ */ -+ if( (data[0] & 0xc0) && (data[1] == 0xD2) ) -+ { -+ if (( data[2] & 0x10 ) != 0) /* pressed? */ -+ wheel = 3; -+ else -+ wheel--; -+ -+ return -1; -+ } -+ -+ if( (wheel == 1) && data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ { -+ wheel--; -+ return -1; -+ } -+ -+ if( wheel == 3 ) /* wheel 'level' 3 is the real stuff.. else it i -+ s 'depressing' ;) */ -+ { -+ /* eat another dummy packet? */ -+ if( data[0] == 0x08 && data[1] == 0 && data[2] == 0 ) -+ return -1; -+ -+ /* or is it smarter to emulate a wheel? */ -+ state->buttons |= GPM_STICK; // pressed -+ -+ /* if red button is pressed take mouse movement as wheel */ -+ state->stick_x = (data[0] & 0x10) ? (data[1]-256) : data[1]; -+ state->stick_y = -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ -+ /* shut the rest of the mouse up.. */ -+ state->dy = state->dx = 0; -+ } -+ else /* it's normal movement */ -+ { -+ state->dx = (data[0] & 0x10) ? data[1]-256 : data[1]; -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ state->stick_x = state->stick_y = 0; -+ } -+ return 0; -+} -+ -+#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -+static int M_tmmfx(Gpm_Event *state, unsigned char *data) -+{ -+ -+ /* The Logitech TrackMan Marble FX, mostly cut-n-paste from M_mman */ -+ /* Tido Klaassen (tidklaas@hermes.fho-emden.de), 5.1.2000 */ -+ -+ static unsigned char buttons=0; -+ static Gpm_Type *mytype=0; -+ unsigned char extended; -+ signed char my_x, my_y; -+ -+ /* find mice-entry for toggeling between 3/4-byte-protocoll */ -+ if(mytype == 0){ -+ mytype=mice; -+ while(mytype->name && strcmp("tmmfx", mytype->name)){ -+ mytype++; -+ } -+ -+ /* this can't happen, unless someone deletes the entry... */ -+ if(!mytype->name){ -+ gpm_debug_log(LOG_NOTICE, "internal mice-table broken, exiting"); -+ exit(1); -+ } -+ } -+ -+ if (data[1]==GPM_EXTRA_MAGIC_1 && data[2]==GPM_EXTRA_MAGIC_2){ -+ /* got unexpected fourth byte */ -+ gpm_debug_log(LOG_NOTICE,"Extra byte = %02x",*data); -+ if ((extended=(data[0]>>4)) > 0x3){ -+ return -1; /* just a sanity check */ -+ } -+ my_x = my_y = 0; -+ -+ mytype->packetlen=4; -+ mytype->getextra=0; -+ } -+ else{ -+ /* got 3/4, as expected */ -+ -+ /* motion is independent of packetlen... */ -+ my_x = (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ my_y = (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ -+ buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); -+ if (mytype->packetlen==4){ -+ extended=data[3]>>4; -+ } -+ } -+ -+ if(mytype->packetlen==4){ -+ if(extended == 0){ -+ mytype->packetlen=3; -+ mytype->getextra=1; -+ } -+ else { -+ if (extended & 0x2){ -+ buttons |= GPM_B_MIDDLE; -+ } -+ -+ if (extended & 0x1){ -+ /* scroll-button pressed, report ball-movements as stick-data */ -+ -+ buttons |= GPM_STICK; -+ state->stick_x = (char) my_x; -+ state->stick_y = (char) -my_y; -+ my_x = 0; -+ my_y = 0; -+ } -+ } -+ } -+ state->buttons = buttons; -+ state->dx = my_x; -+ state->dy = my_y; -+ -+ return 0; -+} -+ -+/* The Primax Cyber-Navigator is basically a PS/2 mouse with a non-standard -+ wheel and three extra side buttons. We'll map the side buttons to the -+ extra bits in the patched gpm. */ -+static int M_pcnps2(Gpm_Event *state, unsigned char *data) -+{ -+ state->stick_x=state->stick_y=0; -+ state->dx=state->dy=0; -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT | -+ !!(data[0]&2) * GPM_B_RIGHT | -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ /* The Primax extensions use the 0x10 bit to flag extended -+ button/wheel reports. Bits 0, 1 and 2 echo the three standard buttons, -+ if chording. */ -+ -+ if(((data[0]&0x18)==0x18) && (data[1]==0) && ((data[2]&0x80))!=0){ -+ state->buttons&=~(GPM_W_DOWN|GPM_W_UP|GPM_W_LEFT|GPM_W_RIGHT|GPM_STICK); -+ state->buttons|= -+ ((data[2]&0xf)==0xf) * GPM_W_UP | -+ ((data[2]&0xf)==0x1) * GPM_W_DOWN | -+ (((data[2]&0x10)!=0) * GPM_W_LEFT) | -+ (((data[2]&0x20)!=0) * GPM_W_RIGHT); -+ -+ /* There's no room to handle the sixth button. We'll make it an -+ upwards stick movement. */ -+ -+#if 0 -+ state->buttons|=GPM_STICK; -+ state->stick_x=0; -+ state->stick_y=7*(!!data[2]&0x40); -+#endif -+ } else { -+ /* The Primax mice don't seem to send negative bits in data[0], but they do -+ * flag extended button events and wheel movement using bit 0x10. */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ } -+ gpm_debug_log(LOG_DEBUG,"Buttons: %d %d %d (%d %d) (%d %d)\n", -+ (state->buttons&GPM_B_LEFT), -+ (state->buttons&GPM_B_MIDDLE), -+ (state->buttons&GPM_B_RIGHT), -+ (state->buttons&GPM_W_UP), -+ (state->buttons&GPM_W_DOWN), -+ (state->buttons&GPM_W_LEFT), -+ (state->buttons&GPM_W_RIGHT)); -+ gpm_debug_log(LOG_DEBUG,"wheel? %d\n",opt_wheel); -+ -+ return 0; -+} -+ -+static Gpm_Type *I_pcnps2(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ opt_wheel=type->wheel; -+ return type; -+} -+ - static Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type) - { - if (twiddler_key_init() != 0) return NULL; -@@ -1438,104 +1696,116 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 1}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, -+ {"mm+ps2", "The \"MouseManPlus\" and similar devices (3 button with stick)", -+ "MouseManPlusPS/2", M_ps2, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"marblefx", "The Logitech Marble FX Trackball (4th button toggles stick)", -+ "MarbleFX", M_marblefx, I_mmplusps2, CS8 | STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, -+ {"tmmfx", "Logitech TrackMan Marble FX (serial, 4th button toggles stick)", -+ "TrackManFX", M_tmmfx, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 1}, -+ {"pcnps2", "Primax Cyber Navigator (and more?) on a PS/2 port.", -+ "", M_pcnps2, I_pcnps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, 1}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -- {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -+ {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, 0}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ -Only in ../imwheel/gpm-imwheel: mice.c.orig -diff -ru --exclude=Makefile ./mouse-test.c ../imwheel/gpm-imwheel/mouse-test.c ---- ./mouse-test.c Fri Nov 12 08:27:37 1999 -+++ ../imwheel/gpm-imwheel/mouse-test.c Sun Feb 27 16:30:46 2000 -@@ -10,6 +10,9 @@ - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -@@ -55,6 +58,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_WHEEL, DEF_NO_MIDDLE, - (Gpm_Type *)NULL - }; - -Only in ../imwheel/gpm-imwheel: mouse-test.c.orig diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel.reason b/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel.reason deleted file mode 100644 index 3fee802f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel.reason +++ /dev/null @@ -1,9 +0,0 @@ - -All of these patches add field to Gpm_Event, which is the quantum -of communication with gpm clients. Change Gpm_Event changes -the communication protocol, and thus is an incompatible change. - -If the protocol has to be changed, we need to create a new channel -and still keep the old protocol. Also, the new protocol must be as -good and extensible as possible, to avoid any similar incompatible -change in the future. diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel2.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel2.patch deleted file mode 100644 index 7cd1f869..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel2.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -r -u gpm-1.18.0/doc/gpm.8 gpm-1.18.0-wheel/doc/gpm.8 ---- gpm-1.18.0/doc/gpm.8 Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/doc/gpm.8 Sun Oct 10 15:23:48 1999 -@@ -263,6 +263,10 @@ - optional and its default value is 1. Default verbosity level is - 5 (`LOG_NOTICE'). - .TP -+-w -+Simulate wheel operation by pressing middle mouse button and -+y-axis movement. -+.TP - -2 - Force two buttons. This means that the middle button, if any, - will be taken as it was the right one. -diff -r -u gpm-1.18.0/gpm.c gpm-1.18.0-wheel/gpm.c ---- gpm-1.18.0/gpm.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpm.c Sun Oct 10 15:18:15 1999 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }, - }; -@@ -387,20 +388,23 @@ - { - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -+ event->dz=nEvent.dz; - event->buttons=nEvent.buttons; - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dz=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dz=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -408,6 +412,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dz = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -430,6 +440,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dz+=nEvent.dz; - } - else /* a pen */ - { -@@ -459,12 +470,13 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dz=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); - event->x=nEvent.x; - event->y=nEvent.y; -+ event->z=nEvent.z; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ - } -@@ -497,7 +509,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx, event->y+=event->dy; event->z+=event->dz; - statusB=event->buttons; - - i=open_console(O_RDONLY); -diff -r -u gpm-1.18.0/gpm.h gpm-1.18.0-wheel/gpm.h ---- gpm-1.18.0/gpm.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpm.h Sat Oct 9 20:45:44 1999 -@@ -114,7 +114,7 @@ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -- short dx, dy, x, y; -+ short dx, dy, dz, x, y, z; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -r -u gpm-1.18.0/gpmCfg.h gpm-1.18.0-wheel/gpmCfg.h ---- gpm-1.18.0/gpmCfg.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmCfg.h Sun Oct 10 14:16:21 1999 -@@ -63,5 +63,7 @@ - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_TOGGLE 0 - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.18.0/gpmInt.h gpm-1.18.0-wheel/gpmInt.h ---- gpm-1.18.0/gpmInt.h Mon Sep 13 08:33:55 1999 -+++ gpm-1.18.0-wheel/gpmInt.h Sun Oct 10 14:12:19 1999 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_simwheel; - Gpm_Type *m_type; - int fd; - }; -diff -r -u gpm-1.18.0/gpn.c gpm-1.18.0-wheel/gpn.c ---- gpm-1.18.0/gpn.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/gpn.c Sun Oct 10 15:37:31 1999 -@@ -212,7 +212,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +298,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::w23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -377,6 +379,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -r -u gpm-1.18.0/mice.c gpm-1.18.0-wheel/mice.c ---- gpm-1.18.0/mice.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mice.c Sun Oct 10 15:29:24 1999 -@@ -366,6 +366,61 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dz = (data[3] > 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dz >= 0) ? state->dz : 256+state->dz; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -1447,9 +1502,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.18.0/mouse-test.c gpm-1.18.0-wheel/mouse-test.c ---- gpm-1.18.0/mouse-test.c Mon Sep 13 08:33:54 1999 -+++ gpm-1.18.0-wheel/mouse-test.c Sun Oct 10 14:24:28 1999 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (Gpm_Type *)NULL - }; - - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel3.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel3.patch deleted file mode 100644 index 88f0266a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel3.patch +++ /dev/null @@ -1,1242 +0,0 @@ -Common subdirectories: gpm-cvstree.orig/CVS and gpm-cvstree/CVS -diff -c gpm-cvstree.orig/Makefile.in gpm-cvstree/Makefile.in -*** gpm-cvstree.orig/Makefile.in Fri Jan 21 00:10:00 2000 ---- gpm-cvstree/Makefile.in Mon Feb 14 18:28:31 2000 -*************** -*** 142,148 **** - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) -o root -m 4755 disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this ---- 142,148 ---- - for i in mev gpm-root; do \ - $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ - done -! $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this -diff -c gpm-cvstree.orig/config.h.in gpm-cvstree/config.h.in -*** gpm-cvstree.orig/config.h.in Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/config.h.in Mon Feb 14 18:40:49 2000 -*************** -*** 1,6 **** - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ ---- 1,6 ---- - /* config.h.in. Generated automatically from configure.in by autoheader. */ - /* Copyright (C) 1998 Ian Zimmerman */ -! /* $Id: imwheel3.patch,v 1.2 2002/05/28 19:13:56 nico Exp $ */ - - - /* Define if using alloca.c. */ -*************** -*** 53,66 **** - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - -- /* Define if you have the header file. */ -- #undef HAVE_NCURSES_H -- - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_SYS_SYSMACROS_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H ---- 53,66 ---- - /* Define if you have the header file. */ - #undef HAVE_LINUX_TTY_H - - /* Define if you have the header file. */ - #undef HAVE_NCURSES_CURSES_H - -! /* Define if you have the header file. */ -! #undef HAVE_NCURSES_H - - /* Define if you have the header file. */ - #undef HAVE_SYSLOG_H -+ -+ /* Define if you have the header file. */ -+ #undef HAVE_SYS_SYSMACROS_H -Common subdirectories: gpm-cvstree.orig/doc and gpm-cvstree/doc -Only in gpm-cvstree: gpm-root.c -diff -c gpm-cvstree.orig/gpm.c gpm-cvstree/gpm.c -*** gpm-cvstree.orig/gpm.c Mon Feb 7 12:40:11 2000 ---- gpm-cvstree/gpm.c Mon Feb 14 18:43:01 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 62,68 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; ---- 65,71 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }, - }; - struct mouse_features *which_mouse; -*************** -*** 74,80 **** - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_double=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ ---- 77,84 ---- - int opt_test=DEF_TEST; - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; -! int opt_repeater=0, opt_wheel_repeater=0, opt_double=0; -! int opt_wheel_swap=0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -*************** -*** 86,92 **** - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; ---- 90,96 ---- - char *prgname; - struct winsize win; - int maxx, maxy; -! int fifofd=-1, wheel_fifofd=-1; - - int eventFlag=0; - Gpm_Cinfo *cinfo[MAX_VC+1]; -*************** -*** 403,408 **** ---- 407,413 ---- - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ - /* static int buttonlock, buttonlockflag; */ -+ static int wheel_fakeup; - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) - #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -*************** -*** 410,415 **** ---- 415,421 ---- - - - oldT=event->type; -+ wheel_fakeup=0; - - if (eventFlag) - { -*************** -*** 422,428 **** - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! event->buttons=nEvent.buttons; - } - else - { ---- 428,442 ---- - } - event->dx=nEvent.dx; - event->dy=nEvent.dy; -! if(opt_wheel && nEvent.buttons&(GPM_B_UP|GPM_B_DOWN)) -! { -! event->buttons=nEvent.buttons&7; -! oldB=newB; newB=event->buttons; -! event->type=GPM_UP; -! wheel_fakeup=1; -! } -! else -! event->buttons=nEvent.buttons; - } - else - { -*************** -*** 443,449 **** - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- 457,465 ---- - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -! gpm_debug_log(LOG_DEBUG,"nEvent.buttons=%d opt_sequence=%d opt_wheel=%d\n",nEvent.buttons,opt_sequence[nEvent.buttons&7]&7,opt_wheel); -! nEvent.buttons = (opt_sequence[nEvent.buttons&7]&7)| -! (opt_wheel?((nEvent.buttons&GPM_B_UP)|(nEvent.buttons&GPM_B_DOWN)):0); - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - -*************** -*** 476,484 **** ---- 492,527 ---- - - } /* eventFlag */ - -+ if(!wheel_fakeup) -+ { - /*....................................... update the button number */ - - if ((event->buttons&GPM_B_MIDDLE) && !opt_three) opt_three++; -+ if ((event->buttons&GPM_B_UP || event->buttons&GPM_B_DOWN) && !opt_wheel) -+ opt_wheel++; -+ if (opt_wheel && event->buttons&(GPM_B_UP|GPM_B_DOWN)) -+ gpm_debug_log(LOG_DEBUG,"Wheel - %s%s\n",(event->buttons&GPM_B_UP?"Up ":""), -+ (event->buttons&GPM_B_DOWN?"Down":"")); -+ -+ -+ /* .................................... repeat wheel to special fifo */ -+ -+ if(wheel_fifofd -+ && (event->buttons&(GPM_B_DOWN|GPM_B_UP)) -+ && event->buttons>oldB) /* button down, not up! (not the wheel motion) */ -+ { -+ unsigned char buffer[1]; -+ -+ event->type=GPM_DOWN; -+ if(event->buttons&GPM_B_DOWN) -+ /* button 5 is down */ -+ if (!opt_wheel_swap) { buffer[0]=5; } else { buffer[0]=4; } -+ else -+ /* button 4 is down */ -+ if (!opt_wheel_swap) { buffer[0]=4; } else { buffer[0]=5; } -+ /* LOG(("repeat wheel: %s\n",buffer)); */ -+ write(wheel_fifofd,buffer,1); -+ } - - /*....................................... we're a repeater, aren't we? */ - -*************** -*** 499,504 **** ---- 542,550 ---- - event->y=nEvent.y; - } - repeated_type->repeat_fun(event, fifofd); /* itz Mon Jan 11 23:39:44 PST 1999 */ -+ /* From original patch -+ buffer[0]=((event->buttons&7) ^ 0x07) | 0x80; -+ */ - } - return 0; /* no events nor information for clients */ - } -*************** -*** 559,571 **** - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if (tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); -+ } - - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -! if ((!opt_wheel || (event->buttons&7)) && tv1.tv_sec && (DIF_TIME(tv1,tv2)type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|= (oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<buttons^=oldB; /* for button-up, tell which one */ -! event->type|=(oldT&GPM_MFLAG); - event->type|=(GPM_SINGLE<type & GPM_DOWN) - return processSpecial(event); - -! return 1; - } - - /*-------------------------------------------------------------------*/ ---- 672,678 ---- - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); - -! return (!wheel_fakeup); - } - - /*-------------------------------------------------------------------*/ -*************** -*** 925,931 **** - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd; - struct timeval timeout; - int maxfd=-1; - int pending; ---- 972,978 ---- - { - int ctlfd, newfd; - struct sockaddr_un ctladdr; -! int i, len, kd_mode, fd, j; - struct timeval timeout; - int maxfd=-1; - int pending; -*************** -*** 1087,1093 **** - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); ---- 1134,1140 ---- - if (ioctl(fd, KDGETMODE, &kd_mode)<0) - oops("ioctl(KDGETMODE)"); - close(fd); -! if (kd_mode != KD_TEXT && !opt_repeater && !opt_wheel_repeater) - { - wait_text(&mouse_table[1].fd); - maxfd=max(maxfd,mouse_table[1].fd); -*************** -*** 1107,1123 **** - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { - FD_CLR(which_mouse->fd,&selSet); pending--; -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! } - } - - /*....................................... got connection, process it */ ---- 1154,1191 ---- - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ Gpm_Event eventbuf; -+ int wheel_done; -+ - FD_CLR(which_mouse->fd,&selSet); pending--; -! wheel_done=0; -! do -! { -! if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -! { -! memcpy(&eventbuf,&event,sizeof(Gpm_Event)); -! /* -! * pass it to the client, if any -! * or to the default handler, if any -! * or to the selection handler -! */ /* FIXME -- check event.vc */ -! (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -! || (cinfo[0] && do_client(cinfo[0], &event)) -! || do_selection(&event); -! memcpy(&event,&eventbuf,sizeof(Gpm_Event)); -! } -! gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d\n", event.type, event.buttons); -! if(!wheel_done && opt_wheel && -! (event.type&(GPM_DOWN|GPM_DRAG)) && -! (event.buttons&(GPM_B_UP|GPM_B_DOWN))) -! { -! -! gpm_debug_log(LOG_DEBUG,"Button Up!\n"); -! wheel_done=1; -! eventFlag=1; -! } -! } while(eventFlag); -! } - } - - /*....................................... got connection, process it */ -*************** -*** 1197,1202 **** - prgname, getpid(), prgname); - exit(0); - } -! -! -! ---- 1265,1269 ---- - prgname, getpid(), prgname); - exit(0); - } -! /* vim:sw=2:ts=8 -! "*/ -diff -c gpm-cvstree.orig/gpm.h gpm-cvstree/gpm.h -*** gpm-cvstree.orig/gpm.h Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/gpm.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 69,80 **** ---- 72,87 ---- - - #define GPM_NODE_CTL GPM_NODE_DEV - #define GPM_NODE_FIFO _PATH_DEV "gpmdata" -+ #define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" - - /*....................................... Cfg buttons */ - - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 -+ #define GPM_B_UP 8 -+ #define GPM_B_DOWN 16 -+ - - /*....................................... The event types */ - -diff -c gpm-cvstree.orig/gpmCfg.h gpm-cvstree/gpmCfg.h -*** gpm-cvstree.orig/gpmCfg.h Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/gpmCfg.h Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified 9/8/1998 by Jonathan Atkins for wheel support -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/gpmInt.h gpm-cvstree/gpmInt.h -*** gpm-cvstree.orig/gpmInt.h Tue Jan 4 18:11:25 2000 ---- gpm-cvstree/gpmInt.h Mon Feb 14 18:32:35 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 64,69 **** ---- 67,73 ---- - int howmany; /* howmany bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ -+ int wheel; /* flag for wheel mice */ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -*************** -*** 87,92 **** ---- 91,97 ---- - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_wheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -*************** -*** 109,114 **** ---- 114,120 ---- - #define opt_time (which_mouse->opt_time) - #define opt_cluster (which_mouse->opt_cluster) - #define opt_three (which_mouse->opt_three) -+ #define opt_wheel (which_mouse->opt_wheel) - #define opt_glidepoint_tap (which_mouse->opt_glidepoint_tap) - #define opt_options (which_mouse->opt_options) - -*************** -*** 121,134 **** - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_double; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; ---- 127,141 ---- - extern char *opt_lut; - extern int opt_test, opt_ptrdrag; - extern int opt_kill; -! extern int opt_repeater, opt_wheel_repeater, opt_double; -! extern int opt_wheel_swap; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -! extern int fifofd, wheel_fifofd; - extern char *consolename; /* the selected one */ - - extern Gpm_Type *repeated_type; -diff -c gpm-cvstree.orig/gpn.c gpm-cvstree/gpn.c -*** gpm-cvstree.orig/gpn.c Fri Jan 14 01:11:05 2000 ---- gpm-cvstree/gpn.c Mon Feb 14 18:28:31 2000 -*************** -*** 8,13 **** ---- 8,16 ---- - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 187,192 **** ---- 190,196 ---- - " -A [limit] start with selection disabled (`aged')\n" - " -b baud-rate sets the baud rate (default %d)\n" - " -B sequence allows changing the buttons (default '%s')\n" -+ " wheel Swap direction of wheel rotation\n" - " -d delta sets the delta value (default %d) (must be 2 or more)\n" - " -D debug mode: don't auto-background\n" - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" -*************** -*** 210,216 **** - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; ---- 214,222 ---- - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -! " -V verbosity increase number of logged messages\n" -! " -w activate wheel\n" -! " -W activate wheel repeater\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -*************** -*** 319,325 **** - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, ---- 325,331 ---- - int - cmdline(int argc, char **argv) - { -! char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvVwW::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -*************** -*** 349,355 **** - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': opt_sequence = optarg; break; - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': ---- 355,367 ---- - if (optarg) opt_age_limit = atoi(optarg); - break; - case 'b': opt_baud = atoi(optarg); break; -! case 'B': { -! if (0==strncmp(optarg,"wheel",1)) -! { opt_wheel_swap=1; } -! else -! { opt_sequence = optarg; } -! break; -! } - case 'd': opt_delta = atoi(optarg); break; - case 'D': gpm_log_daemon = 0; break; - case 'g': -*************** -*** 395,400 **** ---- 407,414 ---- - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); - break; -+ case 'w': opt_wheel=1; break; -+ case 'W': opt_wheel_repeater=1; break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; - default: -*************** -*** 416,422 **** - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! - - /* duplicate initialization */ - ---- 430,442 ---- - if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) - { oops(GPM_NODE_FIFO); } - } -! if (opt_wheel_repeater) -! { -! if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST) -! oops(GPM_WHEEL_FIFO); -! if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0) -! oops(GPM_WHEEL_FIFO); -! } - - /* duplicate initialization */ - -diff -c gpm-cvstree.orig/liblow.c gpm-cvstree/liblow.c -*** gpm-cvstree.orig/liblow.c Thu Jan 27 23:19:29 2000 ---- gpm-cvstree/liblow.c Mon Feb 14 18:28:31 2000 -*************** -*** 5,10 **** ---- 5,13 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * This program is free software; you can redistribute it and/or modify -*************** -*** 632,637 **** ---- 635,642 ---- - case 0: ePtr->buttons=GPM_B_LEFT; break; - case 1: ePtr->buttons=GPM_B_MIDDLE; break; - case 2: ePtr->buttons=GPM_B_RIGHT; break; -+ case 3: ePtr->buttons=GPM_B_UP; break; -+ case 4: ePtr->buttons=GPM_B_DOWN; break; - default: /* Nothing */ break; - } - } -diff -c gpm-cvstree.orig/mev.c gpm-cvstree/mev.c -*** gpm-cvstree.orig/mev.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mev.c Mon Feb 14 18:28:31 2000 -*************** -*** 4,9 **** ---- 4,12 ---- - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -diff -c gpm-cvstree.orig/mice.c gpm-cvstree/mice.c -*** gpm-cvstree.orig/mice.c Tue Feb 8 00:13:02 2000 ---- gpm-cvstree/mice.c Mon Feb 14 18:40:23 2000 -*************** -*** 6,11 **** ---- 6,14 ---- - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 48,53 **** ---- 51,57 ---- - #include - #include - #include -+ #include - #include - #include - #include -*************** -*** 364,369 **** ---- 368,377 ---- - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ if ((data[3] & 0x0f) == 0xf) -+ state->buttons |= GPM_B_UP; -+ else if ((data[3] & 0x0f) == 0x1) -+ state->buttons |= GPM_B_DOWN; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -*************** -*** 469,482 **** - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - ---- 477,500 ---- - static int tap_active=0; /* there exist glidepoint ps2 mice */ - - state->buttons= -! !!(data[0]&1) * GPM_B_LEFT | -! !!(data[0]&2) * GPM_B_RIGHT | -! !!(data[0]&4) * GPM_B_MIDDLE| -! ((data[3]==0xff)?GPM_B_UP:0) | -! ((data[3]==0x01)?GPM_B_DOWN:0); -! #if 0 -! LOG(("Buttons: %d %d %d %d %d\n", -! (state->buttons&GPM_B_LEFT), -! (state->buttons&GPM_B_MIDDLE), -! (state->buttons&GPM_B_RIGHT), -! (state->buttons&GPM_B_UP), -! (state->buttons&GPM_B_DOWN))); -! LOG(("wheel? %d\n",opt_wheel)); -! #endif - if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ - state->buttons = tap_active = opt_glidepoint_tap; - else if (tap_active) -! if (data[0]==8 && !opt_wheel) - state->buttons = tap_active = 0; - else state->buttons = tap_active; - -*************** -*** 540,568 **** - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i; -! -! if (check_no_argv(argc, argv)) return NULL; -! for (i=0; i<6; i++) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! fprintf( stderr, "netmouse: No acknowledge (got %d)\n", c ); -! return NULL; - } - } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; - } - } -! return type; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ---- 558,688 ---- - struct Gpm_Type *type, int argc, char **argv) - { - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; -! } -! -! static int M_netmousepro(Gpm_Event *state, unsigned char *data) -! { -! /* Avoid this beasts if you can. They connect to normal PS/2 port, -! but their protocol is one byte longer... So if you have notebook -! (like me) with internal PS/2 mouse, it will not work -! together. They have four buttons, but two middle buttons can not -! be pressed simultaneously, and two middle buttons do not send -! 'up' events (however, they autorepeat...) -! -! Still, you might want to run this mouse in plain PS/2 mode - -! where it behaves correctly except that middle 2 buttons do -! nothing. -! -! Protocol is -! 3 bytes like normal PS/2 -! 4th byte: 0xff button 'down', 0x01 button 'up' -! [this is so braindamaged that it *must* be some kind of -! compatibility glue...] -! -! Pavel Machek -! */ -! -! state->buttons= -! !!(data[0]&1) * GPM_B_LEFT + -! !!(data[0]&2) * GPM_B_RIGHT + -! !!(data[0]&4) * GPM_B_MIDDLE; -! if (data[3]==0x01) { state->buttons |= GPM_B_DOWN; } -! if (data[3]==0xff) { state->buttons |= GPM_B_UP; } -! -! if(data[1] != 0) -! state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -! else -! state->dx = 0; -! if(data[2] != 0) -! state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -! else -! state->dy = 0; -! return 0; -! } -! -! static Gpm_Type *I_netmousepro(int fd, unsigned short flags, struct Gpm_Type *type) -! { -! unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; -! int i,j,k; -! /* Sometimes is mouse in bad state and first initialization may fail. -! Do it 3*6 times. -! */ -! k=3; -! while (k>0) -! { i=0; j=6; -! while (i<6) { -! unsigned char c = 0; -! write( fd, magic+i, 1 ); -! read( fd, &c, 1 ); -! if (c != 0xfa) { -! if ((j--)==0) -! { fprintf( stderr, "netmouse: No acknowledge (got %d/%d)\n", c, i); -! return NULL; -! } -! else -! { i=0; } -! } -! else -! { i++; } -! } -! { -! unsigned char rep[3] = { 0, 0, 0 }; -! read( fd, rep, 1 ); -! read( fd, rep+1, 1 ); -! read( fd, rep+2, 1 ); -! if (rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { -! if (k==1) -! { fprintf( stderr, "netmouse: Invalid reply magic (got %d,%d,%d)\n", rep[0], rep[1], rep[2] ); -! return NULL; -! } -! else -! { k--; } -! } -! else -! { return type; } - } - } -! return NULL; - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -*************** -*** 810,816 **** - } - - -- - /* ncr pen support (Marc Meis) */ - - #define NCR_LEFT_X 40 ---- 930,935 ---- -*************** -*** 1634,1639 **** ---- 1753,1759 ---- - write (fd, s2, sizeof (s2)); - usleep (30000); - tcflush (fd, TCIFLUSH); -+ opt_wheel=type->wheel; - return type; - } - -*************** -*** 1772,1777 **** ---- 1892,1898 ---- - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char *c; - - /* Set speed to 9600bps (copied from I_summa, above :) */ - tcgetattr(fd, &tty); -*************** -*** 1945,2051 **** - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, -! - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -! - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -! - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - }; - - /*------------------------------------------------------------------------*/ ---- 2066,2172 ---- - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, NULL}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, R_msc}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -! {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ -! {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, NULL}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_empty, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -! {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, NULL}, - {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, NULL}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -! {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -! {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, NULL}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, NULL}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, NULL}, -! {"netmousepro", "Genius NetMouse Pro - 3 buttons and 2 buttons up/down like wheel.", -! "", M_netmousepro, I_netmousepro, CS7 | STD_FLG, -! {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 1, NULL}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, NULL}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, NULL}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -! {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, NULL}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -! {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, NULL}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, NULL}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -! {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, NULL}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -! {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, NULL}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, 0, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -! {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, 0, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, -! {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, 0, NULL}, - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -! {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, NULL}, - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -! {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, NULL}, - {"", "", - "", NULL, NULL, 0, -! {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, NULL} - }; - - /*------------------------------------------------------------------------*/ -diff -c gpm-cvstree.orig/mouse-test.c gpm-cvstree/mouse-test.c -*** gpm-cvstree.orig/mouse-test.c Tue Jan 18 06:10:30 2000 ---- gpm-cvstree/mouse-test.c Mon Feb 14 18:40:36 2000 -*************** -*** 10,15 **** ---- 10,18 ---- - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * -+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice -+ * -+ * - * 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 -*************** -*** 42,47 **** ---- 45,51 ---- - #include - #include - -+ #define NO_DEBUG - #include "gpmInt.h" /* to get mouse types */ - - #ifndef min -*************** -*** 56,62 **** - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (Gpm_Type *)NULL - }; - - /* and this is a workaroud */ ---- 60,66 ---- - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - (char *)NULL /* extra */, -! (int)(Gpm_Type *)NULL - }; - - /* and this is a workaroud */ -Common subdirectories: gpm-cvstree.orig/sample and gpm-cvstree/sample -Common subdirectories: gpm-cvstree.orig/tools and gpm-cvstree/tools diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel_new.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel_new.patch deleted file mode 100644 index 0dd9bb76..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel_new.patch +++ /dev/null @@ -1,829 +0,0 @@ -diff -r -u gpm-1.19.3.original/doc/doc.gpm gpm-1.19.3/doc/doc.gpm ---- gpm-1.19.3.original/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3/doc/doc.gpm Mon Sep 25 07:51:52 2000 -@@ -911,8 +911,26 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short w; /* Extended element */ -+ Wheel position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These events types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw; /* Extended element */ -+ Wheel displacement after last event reading. -+ -+@item char pad[40]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are available for an event handler, Gpm_GetEventExt -+and Gpm_GetSnapshotExt, while after Gpm_GetEvent or Gpm_GetSnapshot -+their values are unpredictable. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -969,6 +987,13 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned 1 notch forward (toward the user). Turning a wheel more -+ than one notch will produce additional GPM_FWHEEL events. This is an -+ extended type - you need to put '#ifdef GPM_FWHEEL' before -+ using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. - @end table - - Cooked events are the following: -@@ -1022,10 +1047,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1366,8 +1396,28 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_Event *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+@table @code -+ int dw, w, result; -+ Gpm_Event mevnt; -+ -+#ifdef GPM_EVENT_EXT -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+#else -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = 0; -+#endif -+@end table -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1512,8 +1562,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_Event *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -diff -r -u gpm-1.19.3.original/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.original/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpm.c Mon Sep 25 07:02:20 2000 -@@ -4,6 +4,8 @@ - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -61,6 +63,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -384,7 +387,7 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusB; /* to return info */ - static int statusC=0; /* clicks */ - void get_console_size(Gpm_Event *ePtr); - -@@ -401,6 +404,7 @@ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +413,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +430,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +445,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +473,7 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; - } - else /* a pen */ - { -@@ -490,7 +503,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +525,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +541,7 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; event->w+=event->dw; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,6 +572,21 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ } -+ - switch(event->type) /* now provide the cooked bits */ - { - case GPM_DOWN: -@@ -583,6 +611,7 @@ - - case GPM_MOVE: - statusC=0; -+ - default: - break; - } -@@ -619,7 +648,7 @@ - event->clicks); - - /* update the global state */ -- statusX=event->x; statusY=event->y; -+ statusX=event->x; statusY=event->y; statusW=event->w; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -733,8 +762,8 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; event.w=statusW; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ -@@ -869,7 +898,7 @@ - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) - { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -+ Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0,0,statusW}; - do_client(info, &event); - } - -@@ -899,6 +928,7 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -diff -r -u gpm-1.19.3.original/gpm.h gpm-1.19.3/gpm.h ---- gpm-1.19.3.original/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3/gpm.h Mon Sep 25 07:02:29 2000 -@@ -3,6 +3,8 @@ - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -84,8 +86,6 @@ - GPM_DOWN=4, - GPM_UP= 8, - --#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) -- - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ -@@ -98,6 +98,11 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_FWHEEL 4096 /* wheel move forward - M.G. 2000/09/24 */ -+#define GPM_BWHEEL 8192 /* wheel move backward - M.G. 2000/09/24 */ -+ -+#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE|GPM_FWHEEL|GPM_BWHEEL)) -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -111,6 +116,19 @@ - - /*....................................... The reported event */ - -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventOld { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+} Gpm_EventOld; -+ -+#define GPM_EVENT_PAD_SIZE 20 /* Should be enough for now */ -+ - typedef struct Gpm_Event { - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; -@@ -118,6 +136,8 @@ - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -+ short dw, w; /* M.G. 2000/09/24 */ -+ int pad[GPM_EVENT_PAD_SIZE]; /* M.G. 2000/09/24 */ - } Gpm_Event; - - /*....................................... The handling function */ -@@ -181,6 +201,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_Event *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +267,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr); - - #ifdef __cplusplus - }; -diff -r -u gpm-1.19.3.original/gpmCfg.h gpm-1.19.3/gpmCfg.h ---- gpm-1.19.3.original/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -r -u gpm-1.19.3.original/gpmInt.h gpm-1.19.3/gpmInt.h ---- gpm-1.19.3.original/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3/gpmInt.h Fri Sep 22 08:00:56 2000 -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -diff -r -u gpm-1.19.3.original/gpn.c gpm-1.19.3/gpn.c ---- gpm-1.19.3.original/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -Only in gpm-1.19.3: install -diff -r -u gpm-1.19.3.original/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.original/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3/liblow.c Mon Sep 25 07:03:30 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -72,6 +74,7 @@ - void *gpm_data=NULL; - int gpm_zerobased=0; - int gpm_visiblepointer=0; -+int gpm_supply_dw = 0; - int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - - unsigned char _gpm_buf[6*sizeof(short)]; -@@ -400,7 +403,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_Event *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +411,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +425,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_Event))) != sizeof(Gpm_Event)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,10 +446,20 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -+} -+ -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_Event tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_EventOld)); -+ return rc; - } - - -diff -r -u gpm-1.19.3.original/libxtra.c gpm-1.19.3/libxtra.c ---- gpm-1.19.3.original/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/libxtra.c Mon Sep 25 07:03:53 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_Event *ePtr) - { - Gpm_Connect conn; - Gpm_Event event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_Event eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_EventOld)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -r -u gpm-1.19.3.original/mev.c gpm-1.19.3/mev.c ---- gpm-1.19.3.original/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mev.c Fri Sep 22 00:40:36 2000 -@@ -94,11 +94,11 @@ - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -335,7 +335,8 @@ - do_snapshot() - { - Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ int rsize=sizeof(Gpm_Event); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -480,7 +481,8 @@ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -r -u gpm-1.19.3.original/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.original/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3/mice.c Mon Sep 25 07:03:01 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -223,6 +225,7 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - return 0; - } -@@ -234,6 +237,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -258,6 +262,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -352,6 +357,7 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; - - return 0; - } -@@ -364,6 +370,7 @@ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - /* wheel (dz??) is (data[3] & 0x0f) */ - - return 0; -@@ -385,6 +392,7 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -398,6 +406,7 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; - return 0; - } - -@@ -406,6 +415,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; - return 0; - } - -@@ -414,6 +424,7 @@ - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; - return 0; - } - -@@ -495,9 +506,65 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ -+ return 0; -+} -+ -+static int R_imps2(Gpm_Event *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+ -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -533,6 +600,7 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; - return 0; - } - -@@ -598,6 +666,8 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -+ -+ state->dw= 0; - - if(mytype->packetlen==4) - { -@@ -694,7 +764,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +799,7 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; - } - - ox=x; oy=y; -@@ -767,7 +838,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -805,6 +876,7 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; - ox=x; oy=y; - return 0; - } -@@ -831,6 +903,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -922,6 +995,7 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -1049,6 +1123,8 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ - return 0; - } - #endif /* have joystick.h */ -@@ -1991,9 +2067,9 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -diff -r -u gpm-1.19.3.original/mouse-test.c gpm-1.19.3/mouse-test.c ---- gpm-1.19.3.original/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3/mouse-test.c Thu Sep 21 20:54:20 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel_new.reason b/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel_new.reason deleted file mode 100644 index 538a5c69..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/imwheel_new.reason +++ /dev/null @@ -1,42 +0,0 @@ -This patch is inspired by Jonathan Atkin's imwheel2.patch. - -It introduces a slightly different approach to mouse wheel -processing by GPM that allows to write a backward-compatible -code, and does not need recompiling all existing GPM-based -applications. - -Here is the short description of changes. For a detailed -description refer to gpm.info after applying the patch: - -- New members appended to Gpm_Event structure: - w, dw - wheel displacement after previous reading, and - current wheel position (initially set to 0) - pad - reserve for future extensions - -- New functions: Gpm_GetEventExt and Gpm_GetSnapshotExt allow - to get the extended Gpm_Event structure, while Gpm_GetEvent - and Gpm_GetSnapshot truncate it to the standard size for - backward compatibility - -- New event types: GPM_FWHEEL (wheel forward) and GPM_BWHEEL - (wheel backward) provide and alternative way of wheel - processing similar to ZAxis mapping in XFree86. - -- New definition: #define GPM_EVENT_EXT - allows to write a backward-compatible code. - -The gpm.info has been modified to reflect the changes. After -the patch is applied and installed, type 'info gpm' for more -information regarding wheel processing. - -The patch has been tested with PS/2 Intellimouse only. - -N.B. This patch does not associate wheel motion with a keystroke, -and does not automatically provide text scrolling - 'imwheel' -package by Jonathan Atkins implements those feature, however it -may be inconsistent with the current modifications. - -Michael Glickman - - - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/mouse_wheel.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/mouse_wheel.patch deleted file mode 100644 index fbc263f8..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/imwheel/mouse_wheel.patch +++ /dev/null @@ -1,1613 +0,0 @@ -diff -u -r gpm-1.19.3/doc/doc.gpm gpm-1.19.3.wheel/doc/doc.gpm ---- gpm-1.19.3/doc/doc.gpm Tue Jul 18 22:43:18 2000 -+++ gpm-1.19.3.wheel/doc/doc.gpm Wed Nov 22 21:47:30 2000 -@@ -852,10 +852,10 @@ - consoles. - @xref{Default Handlers}. - --When a client is involved, it is handled a @code{Gpm_Event} --structure, built by the server. The fields for @code{Gpm_Event} are the -+When a client is involved, it is handled a @code{Gpm_EventExt} structure -+built by the server. The fields for @code{Gpm_EventExt} are the - following: --@tindex Gpm_Event -+@tindex Gpm_EventExt - - @table @code - -@@ -911,8 +911,35 @@ - of them is active at a time, to allow using @code{switch} on the - value. Vertical outrun takes precedence on horizontal outrun. - @xref{Margins}. -+ -+@item short dw; /* Extended element */ -+ Wheel1 displacement after last event reading. -+ -+@item short w; /* Extended element */ -+ Wheel1 position. It is not checked on an overflow, and therefore -+ using dw is prefered. Another way of wheel processing is provided -+ by FWHEEL and BWHEEL event types. These event types must be disabled, -+ if wheel position is processed in an application. -+ -+@item short dw2; /* Extended element */ -+ Wheel2 displacement after last event reading. -+ -+@item short w2; /* Extended element */ -+ Wheel2 position. FWHEEL2 and BWHEEL2 are event types for the second -+ wheel, similar to FWHEEL and BWHEEL. -+ -+@item int pad[18]; /* Extended element */ -+ Reserved for future use. -+ - @end table - -+Extended elements are those added to original Gpm_Event structure -+in order to enable whell support. Extended elements are accessible -+by an event handler, as well as Gpm_GetEventExt and Gpm_GetSnapshotExt -+functions, while Gpm_GetEvent or Gpm_GetSnapshot operate on the -+original structure. Check if @code{GPM_EVENT_EXT} is -+defined before using extended elements and functions in an application. -+ - %========================================================================== - @node Margins, Event Types, Events, Gpm Internals - @section How margins are managed -@@ -941,7 +968,7 @@ - @node Event Types, Connection Details, Margins, Gpm Internals - @section Event Types - --The @code{type} field in @code{Gpm_Event} is made up of bit-wide -+The @code{type} field in @code{Gpm_EventExt} is made up of bit-wide - flags. The existing bit masks belong to two groups: bare events and - cooked events. The bit-mask @code{GPM_BARE_EVENTS} is provided to - extract bare events, by and-ing (@samp{&}) it with the @code{type} field. -@@ -969,6 +996,17 @@ - @item GPM_LEAVE - This is only delivered by the high level library, too. Events - of type @code{GPM_LEAVE} have all other fields undefined. -+@item GPM_FWHEEL -+ Wheel turned forward (toward the user). Turning a wheel more than one -+ notch (Intellimouse) or for a longer time (A4-tech mouse) will produce -+ additional GPM_FWHEEL events. This is an extended type - you need to -+ put '#ifdef GPM_FWHEEL' before using the type in your code. -+@item GPM_BWHEEL -+ Same as GPM_FWHEEL but for turning the wheel back. -+@item GPM_FWHEEL2 -+ Wheel 2 turned forward (right). See comments for GPM_FWHEEL -+@item GPM_BWHEEL2 -+ Wheel 2 turned back (left). - @end table - - Cooked events are the following: -@@ -1022,10 +1060,15 @@ - - @table @code - @item eventMask -- A bitmask of the events the client wants -- to receive. Both bare and cooked events are -- allowed to appear in the mask. -- -+ A bitmask of the events the client wants to receive. -+ Both bare and cooked events are allowed to appear in the mask. -+ In particular, GPM_FWHEEL and GPM_BWHEEL can be disabled by -+ omitting the masks: -+ -+ Gpm_Connect conn; -+ /* Enable all events, except GPM_FWHEEL and GPM_BWHEEL -+ conn.eventMask = ~(GPM_FWHEEL | GPM_BWHEEL); -+ - @item defaultMask - A mask to tell which events allow - a default treatment (the selection one). These are mouse events, -@@ -1171,7 +1214,7 @@ - application. It is passed two arguments and returns an integer value, - according to the following typedef: - --@code{typedef int Gpm_Handler(Gpm_Event *@var{event}, void *@var{clientdata});} -+@code{typedef int Gpm_Handler(Gpm_EventExt *@var{event}, void *@var{clientdata});} - @tindex Gpm_Handler - - The @var{event} is used to instantiate the mouse event just received, -@@ -1366,8 +1409,35 @@ - failure, and 0 after closing the connection. Failure can happen if a - signal interrupted the read system call. This function doesn't work with - xterm mouse reporting and is meant for internal use by the library. -+ -+This function does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetEventExt (Gpm_EventExt *@var{event}); -+As Gpm_GetEvent, but returns extended part. For backward compatibility -+the application should check @code{GPM_EVENT_EXT}, as given by the following -+example: -+ -+@example @noindent -+ int dw, w, dw2, w, result; -+ -+#ifdef GPM_EVENT_EXT -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEventExt(&mevnt); -+ w = mevnt.w; dw = nevnt.dw; -+ @} -+#else -+ @{ -+ Gpm_Event mevnt; -+ result = Gpm_GetEvent(&mevnt); -+ w = dw = w2 = dw2 = 0; -+ @} -+#endif -+@end example -+ -+@end deftypefun -+ - %......................................................................... - @deftypefun int Gpm_CharsQueued (void); - -@@ -1431,7 +1501,7 @@ - %......................................................................... - @deftypefun int Gpm_DrawPointer (int @var{x}, int @var{y}, int @var{fd}); - --@deftypefunx int GPM_DRAWPOINTER (Gpm_Event *@var{ePtr};) -+@deftypefunx int GPM_DRAWPOINTER (Gpm_EventExt *@var{ePtr};) - - - These are actually macros. They should be used to draw the mouse pointer after -@@ -1512,8 +1582,14 @@ - events, and applications usually don't want to lose events, the function - returns 0 if the input queue is not empty. - -+The functions does not return the extended part. - @end deftypefun - -+@deftypefun int Gpm_GetSnapshotExt (Gpm_EventExt *@var{event}); -+As Gpm_GetSnapshot, but returns extended part. For backward compatibility -+the application should check whether @code{GPM_EVENT_EXT} has been defined. -+ -+@end deftypefun - - %-------------------------------------------------------------------------- - @node High Level Lib, Xterm, Low Level Library, The ClientLib -@@ -1668,7 +1744,7 @@ - @end deftypefun - - %......................................................................... --@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_Event *@var{ePtr}, void * @var{clientdata}); -+@deftypefun Gpm_Roi* Gpm_HandleRoi (Gpm_EventExt *@var{ePtr}, void * @var{clientdata}); - - - This function, which should not be invoked by the user, is the dispatching -@@ -1680,12 +1756,11 @@ - If no Roi is interested in he event the @code{*gpm_roi_handler} function - is invoked (if not null), with null clientdata. - --Reported events are all those in @code{Gpm_Event}, and also @code{GPM_ENTER} -+Reported events are all those in @code{Gpm_EventExt}, and also @code{GPM_ENTER} - and @code{GPM_LEAVE}. These can be used to toggle highlighting on a - button or to drop a menu if the menubutton is entered during a drag. - Remember that when Enter or Leave is notified, no other information in - the event item should be used. -- - - @end deftypefun - -diff -u -r gpm-1.19.3/gpm.c gpm-1.19.3.wheel/gpm.c ---- gpm-1.19.3/gpm.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpm.c Wed Nov 22 21:22:45 2000 -@@ -61,6 +61,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }, -@@ -230,7 +231,7 @@ - } - - /*-------------------------------------------------------------------*/ --static inline int do_selection(Gpm_Event *event) /* returns 0, always */ -+static inline int do_selection(Gpm_EventExt *event) /* returns 0, always */ - { - static int x1=1, y1=1, x2, y2; - #define UNPOINTER() 0 -@@ -286,7 +287,7 @@ - - /*-------------------------------------------------------------------*/ - /* returns 0 if the event has not been processed, and 1 if it has */ --static inline int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event) -+static inline int do_client(Gpm_Cinfo *cinfo, Gpm_EventExt *event) - { - Gpm_Connect info=cinfo->data; - int fd=cinfo->fd; -@@ -308,7 +309,7 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ write(fd,event, sizeof(Gpm_EventExt)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -384,23 +385,24 @@ - } - - --static int statusX,statusY,statusB; /* to return info */ -+static int statusX,statusY,statusW,statusW2,statusB; /* to return info */ - static int statusC=0; /* clicks */ --void get_console_size(Gpm_Event *ePtr); -+void get_console_size(Gpm_EventExt *ePtr); - - /*-------------------------------------------------------------------*/ --static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, -+static inline int processMouse(int fd, Gpm_EventExt *event, Gpm_Type *type, - int kd_mode) - { - char *data; - static int fine_dx, fine_dy; - static int i, j, m; -- static Gpm_Event nEvent; -+ static Gpm_EventExt nEvent; - static struct vt_stat stat; - static struct timeval tv1={0,0}, tv2; /* tv1==0: first click is single */ - static struct timeval timeout={0,0}; - fd_set fdSet; - static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ -+ static Gpm_Cinfo *ci; - /* static int buttonlock, buttonlockflag; */ - - #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -@@ -409,6 +411,7 @@ - - - oldT=event->type; -+ memset (event->pad, '\0', GPM_EVENT_PAD_SIZE * sizeof(int)); - - if (eventFlag) - { -@@ -425,13 +428,14 @@ - } - else - { -- event->dx=event->dy=0; -+ event->dx=event->dy=event->dw=event->dw2=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; - - do /* cluster loop */ - { -+ nEvent.dx=nEvent.dy=nEvent.dw=nEvent.dw2=0; - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -@@ -439,6 +443,12 @@ - else break; - } - -+ if (which_mouse->opt_simwheel && (nEvent.buttons & GPM_B_MIDDLE) && nEvent.dy) { -+ nEvent.buttons &= !GPM_B_MIDDLE; -+ nEvent.dw = nEvent.dy; -+ nEvent.dy = 0; -+ } -+ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -@@ -461,6 +471,8 @@ - /* increment the reported dx,dy */ - event->dx+=nEvent.dx; - event->dy+=nEvent.dy; -+ event->dw+=nEvent.dw; -+ event->dw2+=nEvent.dw2; - } - else /* a pen */ - { -@@ -490,7 +502,7 @@ - static struct timeval rept1,rept2; - gettimeofday(&rept2, (struct timezone *)NULL); - if (((rept2.tv_sec -rept1.tv_sec) *1000+(rept2.tv_usec-rept1.tv_usec)/1000)>250) -- { event->dx=0; event->dy=0; } -+ { event->dx=0; event->dy=0; event->dw=0; event->dw2=0; } - rept1=rept2; - - event->dy=event->dy*((win.ws_col/win.ws_row)+1); -@@ -512,7 +524,7 @@ - fine_dx %= opt_scale; fine_dy %= opt_scaley; - } - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && !event->dw && !event->dw2 && (event->buttons==oldB)) - do - { /* so to break */ - static long awaketime; -@@ -528,7 +540,8 @@ - - /*....................................... fill missing fields */ - -- event->x+=event->dx, event->y+=event->dy; -+ event->x+=event->dx; event->y+=event->dy; -+ event->w+=event->dw; event->w2+=event->dw2; - statusB=event->buttons; - - i=open_console(O_RDONLY); -@@ -559,7 +572,31 @@ - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - -- switch(event->type) /* now provide the cooked bits */ -+ ci = cinfo[stat.v_active]; -+ if (ci != NULL) -+ { -+ i = (ci->data).eventMask; -+ if (event->w > 0 && (i & GPM_FWHEEL)) -+ { -+ event->type |= GPM_FWHEEL; (event->w)--; -+ } -+ else -+ if (event->w < 0 && (i & GPM_BWHEEL)) -+ { -+ event->type |= GPM_BWHEEL; (event->w)++; -+ } -+ if (event->w2 > 0 && (i & GPM_FWHEEL2)) -+ { -+ event->type |= GPM_FWHEEL2; (event->w2)--; -+ } -+ else -+ if (event->w2 < 0 && (i & GPM_BWHEEL2)) -+ { -+ event->type |= GPM_BWHEEL2; (event->w2)++; -+ } -+ } -+ -+ switch(event->type & 0x0f) /* now provide the cooked bits */ - { - case GPM_DOWN: - GET_TIME(tv2); -@@ -567,7 +604,7 @@ - statusC++, statusC%=3; /* 0, 1 or 2 */ - else statusC=0; - event->type|=(GPM_SINGLE<type|=(GPM_SINGLE<type |= GPM_MFLAG; - event->type|=(GPM_SINGLE<x; statusY=event->y; -+ statusW=event->w; statusW2=event->w2; - - if (opt_special && event->type & GPM_DOWN) - return processSpecial(event); -@@ -671,7 +711,7 @@ - int i; - Gpm_Cinfo *cinfoPtr, *next; - Gpm_Connect conn; -- static Gpm_Event event; -+ static Gpm_EventExt event; - static struct vt_stat stat; - - gpm_debug_log(LOG_INFO,"Request on %i (console %i)", ci->fd, vc); -@@ -733,15 +773,16 @@ - oops("get_shift_state"); - close(i); - event.vc = stat.v_active; -- event.x=statusX; event.y=statusY; -- event.dx=maxx; event.dy=maxy; -+ event.x=statusX; event.y=statusY; -+ event.w=statusW; event.w2=statusW2; -+ event.dx=maxx; event.dy=maxy; - event.buttons= statusB; - event.clicks=statusC; - /* fall through */ - - case GPM_REQ_BUTTONS: - event.type= (opt_three==1 ? 3 : 2); /* buttons */ -- write(ci->fd,&event,sizeof(Gpm_Event)); -+ write(ci->fd,&event,sizeof(Gpm_EventExt)); - break; - - case GPM_REQ_NOPASTE: -@@ -868,16 +909,16 @@ - - /* if the client gets motions, give it the current position */ - if(request->eventMask & GPM_MOVE) -- { -- Gpm_Event event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0}; -- do_client(info, &event); -+ { Gpm_EventExt event={0,0,vc,0,0,statusX,statusY,GPM_MOVE,0,0, -+ 0,statusW,0,statusW2}; -+ do_client(info, &event); - } - - return newfd; - } - - /*-------------------------------------------------------------------*/ --void get_console_size(Gpm_Event *ePtr) -+void get_console_size(Gpm_EventExt *ePtr) - { - int i, prevmaxx, prevmaxy; - struct mouse_features *which_mouse; /* local */ -@@ -899,6 +940,8 @@ - if (!prevmaxx) { /* first invocation, place the pointer in the middle */ - statusX = ePtr->x = maxx/2; - statusY = ePtr->y = maxy/2; -+ statusW = ePtr->w = 0; -+ statusW2 = ePtr->w2 = 0; - } else { /* keep the pointer in the same position where it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; -@@ -935,7 +978,7 @@ - struct timeval timeout; - int maxfd=-1; - int pending; -- Gpm_Event event; -+ Gpm_EventExt event; - - prgname=argv[0]; - -diff -u -r gpm-1.19.3/gpm.h gpm-1.19.3.wheel/gpm.h ---- gpm-1.19.3/gpm.h Fri Jan 28 09:09:00 2000 -+++ gpm-1.19.3.wheel/gpm.h Wed Nov 22 21:23:55 2000 -@@ -98,6 +98,12 @@ - GPM_LEAVE=1024 /* leave event, used in Roi's */ - }; - -+#define GPM_WHEEL -+#define GPM_FWHEEL 4096 /* wheel1 move forward */ -+#define GPM_BWHEEL 8192 /* wheel1 move backward */ -+#define GPM_FWHEEL2 16384 /* wheel2 move forward(right) */ -+#define GPM_BWHEEL2 32768 /* wheel2 move backward(left) */ -+ - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) - #define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -@@ -120,9 +126,24 @@ - enum Gpm_Margin margin; - } Gpm_Event; - -+#define GPM_EVENT_PAD_SIZE 19 /* Should be enough for now */ -+#define GPM_EVENT_EXT -+ -+typedef struct Gpm_EventExt { -+ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ -+ unsigned short vc; -+ short dx, dy, x, y; -+ enum Gpm_Etype type; -+ int clicks; -+ enum Gpm_Margin margin; -+ short dw, w; -+ short dw2, w2; -+ int pad[GPM_EVENT_PAD_SIZE]; -+} Gpm_EventExt; -+ - /*....................................... The handling function */ - --typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); -+typedef int Gpm_Handler(Gpm_EventExt *event, void *clientdata); - - /*....................................... The connection data structure */ - -@@ -181,6 +202,7 @@ - extern int Gpm_Open(Gpm_Connect *, int); - extern int Gpm_Close(void); - extern int Gpm_GetEvent(Gpm_Event *); -+extern int Gpm_GetEventExt(Gpm_EventExt *); - extern int Gpm_CharsQueued(void); - extern int Gpm_Getc(FILE *); - #define Gpm_Getchar() Gpm_Getc(stdin) -@@ -246,6 +268,7 @@ - char *Gpm_GetLibVersion(int *where); - char *Gpm_GetServerVersion(int *where); - int Gpm_GetSnapshot(Gpm_Event *ePtr); -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr); - - #ifdef __cplusplus - }; -diff -u -r gpm-1.19.3/gpmCfg.h gpm-1.19.3.wheel/gpmCfg.h ---- gpm-1.19.3/gpmCfg.h Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/gpmCfg.h Thu Sep 21 20:42:12 2000 -@@ -62,5 +62,7 @@ - #define DEF_TEST 0 - #define DEF_PTRDRAG 1 /* double or triple click */ - #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ -+#define DEF_SIMWHEEL 0 /* simulate wheel with middle button and */ -+ /* y-axis movement */ - - #endif /* _GPMCFG_INCLUDED */ -diff -u -r gpm-1.19.3/gpmInt.h gpm-1.19.3.wheel/gpmInt.h ---- gpm-1.19.3/gpmInt.h Tue Jul 18 22:18:54 2000 -+++ gpm-1.19.3.wheel/gpmInt.h Sat Nov 11 18:55:32 2000 -@@ -56,7 +56,7 @@ - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ -- int (*fun)(Gpm_Event *state, unsigned char *data); -+ int (*fun)(Gpm_EventExt *state, unsigned char *data); - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - unsigned short flags; -@@ -66,7 +66,7 @@ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - -- int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ -+ int (*repeat_fun)(Gpm_EventExt *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ - } Gpm_Type; - -@@ -88,6 +88,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_glidepoint_tap; -+ int opt_simwheel; - char *opt_options; /* extra textual configuration */ - Gpm_Type *m_type; - int fd; -@@ -148,7 +149,7 @@ - /* mice.c */ - extern int M_listTypes(void); - /* special.c */ --int processSpecial(Gpm_Event *event); -+int processSpecial(Gpm_EventExt *event); - int twiddler_key(unsigned long message); - int twiddler_key_init(void); - -diff -u -r gpm-1.19.3/gpn.c gpm-1.19.3.wheel/gpn.c ---- gpm-1.19.3/gpn.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/gpn.c Thu Sep 21 20:53:38 2000 -@@ -177,7 +177,9 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -w simulate wheel operation by pressing middle\n" -+ " mouse button and y-axis movement\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -286,7 +288,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TvV::w23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -359,6 +361,9 @@ - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -+ break; -+ case 'w': -+ which_mouse->opt_simwheel=1; - break; - case '2': opt_three=-1; break; - case '3': opt_three=1; break; -diff -u -r gpm-1.19.3/hltest.c gpm-1.19.3.wheel/hltest.c ---- gpm-1.19.3/hltest.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/hltest.c Sat Nov 11 19:28:24 2000 -@@ -281,7 +281,7 @@ - * Gpm_PushRoi on creation, and is used to differentiate them - */ - --int handler(Gpm_Event *ePtr, void *clientdata) -+int handler(Gpm_EventExt *ePtr, void *clientdata) - { - WinInfo *info=clientdata; - int number=info->number; -@@ -391,7 +391,7 @@ - * This extra handler is only used for the background and left bar - */ - --int xhandler(Gpm_Event *ePtr, void *clientdata) -+int xhandler(Gpm_EventExt *ePtr, void *clientdata) - { - static int x=0,y=0; - int back=0; -diff -u -r gpm-1.19.3/libcurses.c gpm-1.19.3.wheel/libcurses.c ---- gpm-1.19.3/libcurses.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libcurses.c Sat Nov 11 19:20:12 2000 -@@ -47,7 +47,7 @@ - fd_set selSet; - int max, flag, result; - int fd=STDIN_FILENO; --static Gpm_Event ev; -+static Gpm_EventExt ev; - - if (!gpm_flag || gpm_fd==-1) return GET(win); - if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); -@@ -76,7 +76,7 @@ - if (flag==-1) - continue; - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern gpm_convert_event(char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -u -r gpm-1.19.3/libhigh.c gpm-1.19.3.wheel/libhigh.c ---- gpm-1.19.3/libhigh.c Tue Jan 18 08:34:00 2000 -+++ gpm-1.19.3.wheel/libhigh.c Sat Nov 11 19:18:59 2000 -@@ -132,9 +132,9 @@ - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - --int Gpm_HandleRoi(Gpm_Event *ePtr, void *clientdata) -+int Gpm_HandleRoi(Gpm_EventExt *ePtr, void *clientdata) - { --static Gpm_Event backEvent; -+static Gpm_EventExt backEvent; - Gpm_Roi *roi=gpm_current_roi; - - /* -diff -u -r gpm-1.19.3/liblow.c gpm-1.19.3.wheel/liblow.c ---- gpm-1.19.3/liblow.c Tue Jul 18 22:06:06 2000 -+++ gpm-1.19.3.wheel/liblow.c Sat Nov 11 19:23:43 2000 -@@ -6,6 +6,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -400,7 +402,7 @@ - } - - /*-------------------------------------------------------------------*/ --int Gpm_GetEvent(Gpm_Event *event) -+int Gpm_GetEventExt(Gpm_EventExt *event) - { - int count; - MAGIC_P((int magic)); -@@ -408,6 +410,7 @@ - if (!gpm_flag) return 0; - - #ifdef GPM_USE_MAGIC -+ - if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int)) - { - if (count==0) -@@ -421,7 +424,7 @@ - } - #endif - -- if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event)) -+ if ((count=read(gpm_fd,event,sizeof(Gpm_EventExt))) != sizeof(Gpm_EventExt)) - { - #ifndef GPM_USE_MAGIC - if (count==0) -@@ -442,12 +445,22 @@ - return -1; - } - -+ - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; - } - -+int Gpm_GetEvent(Gpm_Event *event) -+{ Gpm_EventExt tmp_event; -+ int rc; -+ rc = Gpm_GetEventExt(&tmp_event); -+ if (event != NULL) -+ memcpy(event, &tmp_event, sizeof(Gpm_Event)); -+ return rc; -+} -+ - - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -@@ -464,7 +477,7 @@ - { - fd_set selSet; - int max, flag, result; -- static Gpm_Event ev; -+ static Gpm_EventExt ev; - int fd=fileno(f); - static int count; - -@@ -502,7 +515,7 @@ - if (FD_ISSET(fd,&selSet)) - return fgetc(f); - -- if (Gpm_GetEvent(&ev) && gpm_handler -+ if (Gpm_GetEventExt(&ev) && gpm_handler - && (result=(*gpm_handler)(&ev,gpm_data))) - { - gpm_hflag=1; -@@ -516,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ extern gpm_convert_event(unsigned char *data, Gpm_EventExt *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -@@ -600,7 +613,7 @@ - } - - /*-------------------------------------------------------------------*/ --int gpm_convert_event(unsigned char *mdata, Gpm_Event *ePtr) -+int gpm_convert_event(unsigned char *mdata, Gpm_EventExt *ePtr) - { - static struct timeval tv1={0,0}, tv2; - static int clicks=0; -diff -u -r gpm-1.19.3/libxtra.c gpm-1.19.3.wheel/libxtra.c ---- gpm-1.19.3/libxtra.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/libxtra.c Sat Nov 11 19:16:22 2000 -@@ -5,6 +5,8 @@ - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza -+ * imps2 wheel support: Michael Glickman 2000/09/24 -+ * Influenced by Jonathan Atkin's patch - * - * 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 -@@ -87,14 +89,14 @@ - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ --int Gpm_GetSnapshot(Gpm_Event *ePtr) -+int Gpm_GetSnapshotExt(Gpm_EventExt *ePtr) - { - Gpm_Connect conn; -- Gpm_Event event; -+ Gpm_EventExt event; - fd_set sillySet; - struct timeval to={0,0}; - int i; -- -+ - if (!gpm_ver_i) - { - if (0 == Gpm_GetServerVersion(NULL)) { -@@ -129,14 +131,25 @@ - return 0; - write(gpm_fd,&conn,sizeof(Gpm_Connect)); - -- if ((i=Gpm_GetEvent(ePtr))!=1) -- return -1; -+ if (Gpm_GetEventExt(ePtr)!=1) return -1; - - i=ePtr->type; ePtr->type=0; - return i; /* number of buttons */ - } -+ -+int Gpm_GetSnapshot(Gpm_Event *ePtr) -+{ -+ int rc; -+ Gpm_EventExt eTmp; -+ rc = Gpm_GetSnapshotExt(&eTmp); -+ if (ePtr) -+ memcpy(ePtr, &eTmp, sizeof(Gpm_Event)); -+ return rc; -+ -+} - - - /* Local Variables: */ - /* c-indent-level: 2 */ - /* End: */ -+ -diff -u -r gpm-1.19.3/mev.c gpm-1.19.3.wheel/mev.c ---- gpm-1.19.3/mev.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mev.c Sat Nov 11 19:17:46 2000 -@@ -90,15 +90,15 @@ - int opt_pointer = 0; - - /*===================================================================*/ --int user_handler(Gpm_Event *event, void *data) -+int user_handler(Gpm_EventExt *event, void *data) - { - if (opt_fit) Gpm_FitEvent(event); - -- printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), " -+ printf("mouse: event 0x%05X at %2i,%2i (delta %2i,%2i,%2i,%2i), " - "buttons %i, modifiers 0x%02X\r\n", - event->type, - event->x, event->y, -- event->dx, event->dy, -+ event->dx, event->dy, event->dw, event->dw2, - event->buttons, event->modifiers); - - if (event->type & (GPM_DRAG|GPM_DOWN)) { -@@ -110,7 +110,7 @@ - } - - /*-------------------------------------------------------------------*/ --int emacs_handler(Gpm_Event *event, void *data) -+int emacs_handler(Gpm_EventExt *event, void *data) - { - int i,j; - static int dragX, dragY; -@@ -230,8 +230,8 @@ - /*===================================================================*/ - int usage(void) - { -- printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -- "Usage: %s [options]\n",prgname); -+// printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" -+// "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" -@@ -334,8 +334,9 @@ - void - do_snapshot() - { -- Gpm_Event event; -- int i=Gpm_GetSnapshot(&event); -+ Gpm_EventExt event; -+ int rsize=sizeof(Gpm_EventExt); -+ int i=Gpm_GetSnapshotExt(&event); - char *s; - - if (-1 == i) { -@@ -479,8 +480,9 @@ - } /*if*/ - } /*if*/ - if (FD_ISSET(gpm_fd, &readset)) { -- Gpm_Event evt; -- if (Gpm_GetEvent(&evt) > 0) { -+ Gpm_EventExt evt; -+ if (Gpm_GetEventExt(&evt) > 0) { -+/* if (Gpm_GetEvent(&evt) > 0) { */ - my_handler(&evt, 0); - } else { - fprintf(stderr, "Oops, Gpm_GetEvent()\n"); -diff -u -r gpm-1.19.3/mice.c gpm-1.19.3.wheel/mice.c ---- gpm-1.19.3/mice.c Wed Mar 8 01:10:00 2000 -+++ gpm-1.19.3.wheel/mice.c Wed Nov 22 21:51:35 2000 -@@ -25,7 +25,7 @@ - * This file is part of the mouse server. The information herein - * is kept aside from the rest of the server to ease fixing mouse-type - * issues. Each mouse type is expected to fill the `buttons', `dx' and `dy' -- * fields of the Gpm_Event structure and nothing more. -+ * fields of the Gpm_EventExt structure and nothing more. - * - * Absolute-pointing devices (support by Marc Meis), are expecting to - * fit `x' and `y' as well. Unfortunately, to do it the window size must -@@ -208,7 +208,7 @@ - * The return value is the number of unprocessed bytes - */ - --static int M_ms(Gpm_Event *state, unsigned char *data) -+static int M_ms(Gpm_EventExt *state, unsigned char *data) - { - /* - * some devices report a change of middle-button state by -@@ -223,17 +223,21 @@ - prev = state->buttons; - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - --static int M_ms_plus(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus(Gpm_EventExt *state, unsigned char *data) - { - static unsigned char prev=0; - - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -248,7 +252,7 @@ - return 0; - } - --static int M_ms_plus_lr(Gpm_Event *state, unsigned char *data) -+static int M_ms_plus_lr(Gpm_EventExt *state, unsigned char *data) - { - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS -@@ -258,6 +262,8 @@ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - - /* Allow motion *and* button change (Michael Plass) */ - -@@ -285,7 +291,7 @@ - int SUMMA_BORDER=100; - int summamaxx,summamaxy; - char summaid=-1; --static int M_summa(Gpm_Event *state, unsigned char *data) -+static int M_summa(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -307,7 +313,7 @@ - - - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ --static int R_summa(Gpm_Event *state, int fd) -+static int R_summa(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - static int x,y; -@@ -335,7 +341,7 @@ - - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ --static int M_geni(Gpm_Event *state, unsigned char *data) -+static int M_geni(Gpm_EventExt *state, unsigned char *data) - { - /* this is a little confusing. If we use the stylus, we - * have three buttons (tip, lower, upper), and if -@@ -352,25 +358,48 @@ - - state->dx = ((data[1] & 0x3f) ) * ((data[0] & 0x10)?1:-1); - state->dy = ((data[2] & 0x3f) ) * ((data[0] & 0x8)?-1:1); -+ state->dw= 0; -+ state->dw2= 0; - - return 0; - } - - /* m$ 'Intellimouse' (steveb 20/7/97) */ --static int M_ms3(Gpm_Event *state, unsigned char *data) -+static int M_ms3(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; -+ -+ return 0; -+} -+ -+/* A4 tech 4D mouse serial (michg@alphalink.com.au 11/11/00) */ -+static int M_a4d(Gpm_EventExt *state, unsigned char *data) -+{ -+ state->buttons= ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[3] & 0x10) >> 3) /* middle */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } - - return 0; - } - - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ --static int M_brw(Gpm_Event *state, unsigned char *data) -+static int M_brw(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x20) >> 4) /* middle */ -@@ -385,6 +414,9 @@ - data[0], data[1], data[2], data[3]); - return -1; - } -+ state->dw= data[3] & 0x0f; -+ if (data[3] & 0x08) state->dw -= 16; -+ state->dw2= 0; - /* wheel (dz) is (data[3] & 0x0f) */ - /* where is the side button? I can sort of detect it at 9600 baud */ - /* Note this mouse is very noisy */ -@@ -392,35 +424,41 @@ - return 0; - } - --static int M_bare(Gpm_Event *state, unsigned char *data) -+static int M_bare(Gpm_EventExt *state, unsigned char *data) - { - /* a bare ms protocol */ - state->buttons= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_sun(Gpm_Event *state, unsigned char *data) -+static int M_sun(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]); - state->dy= -(signed char)(data[2]); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_msc(Gpm_Event *state, unsigned char *data) -+static int M_msc(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - - /* itz Mon Jan 11 23:51:38 PST 1999 this code moved here from gpm.c */ - /* (processMouse) */ - --static int R_msc(Gpm_Event *state, int fd) -+static int R_msc(Gpm_EventExt *state, int fd) - { - signed char buffer[5]; - -@@ -432,39 +470,121 @@ - - } - --static int M_logimsc(Gpm_Event *state, unsigned char *data) /* same as msc */ -+static int M_logimsc(Gpm_EventExt *state, unsigned char *data) /* same as msc */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)(data[1]) + (signed char)(data[3]); - state->dy= -((signed char)(data[2]) + (signed char)(data[4])); -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_mm(Gpm_Event *state, unsigned char *data) -+static int M_mm(Gpm_EventExt *state, unsigned char *data) - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_logi(Gpm_Event *state, unsigned char *data) /* equal to mm */ -+static int M_logi(Gpm_EventExt *state, unsigned char *data) /* equal to mm */ - { - state->buttons= data[0] & 0x07; - state->dx= (data[0] & 0x10) ? data[1] : - data[1]; - state->dy= (data[0] & 0x08) ? - data[2] : data[2]; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - --static int M_bm(Gpm_Event *state, unsigned char *data) /* equal to sun */ -+static int M_bm(Gpm_EventExt *state, unsigned char *data) /* equal to sun */ - { - state->buttons= (~data[0]) & 0x07; - state->dx= (signed char)data[1]; - state->dy= -(signed char)data[2]; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_ps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; -+ return 0; -+} -+ -+static int M_imps2(Gpm_EventExt *state, unsigned char *data) -+{ -+ static int tap_active=0; /* there exist glidepoint ps2 mice */ -+ -+ state->buttons= -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; -+ -+ if (data[0]==0 && opt_glidepoint_tap) /* by default this is false */ -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ -+ /* Some PS/2 mice send reports with negative bit set in data[0] -+ * and zero for movement. I think this is a bug in the mouse, but -+ * working around it only causes artifacts when the actual report is -256; -+ * they'll be treated as zero. This should be rare if the mouse sampling -+ * rate is set to a reasonable value; the default of 100 Hz is plenty. -+ * (Stephen Tell) -+ */ -+ if(data[1] != 0) -+ state->dx= (data[0] & 0x10) ? data[1]-256 : data[1]; -+ else -+ state->dx = 0; -+ if(data[2] != 0) -+ state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); -+ else -+ state->dy = 0; -+ state->dw = (data[3] >= 128) ? data[3]-256 : data[3]; -+ state->dw2= 0; -+ - return 0; - } - --static int M_ps2(Gpm_Event *state, unsigned char *data) -+/* A4 tech 4D mouse PS/2 michg@alphalink.com.au 2000/11/11 */ -+static int M_a4dps2(Gpm_EventExt *state, unsigned char *data) - { - static int tap_active=0; /* there exist glidepoint ps2 mice */ - -@@ -495,10 +615,40 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ -+ /* Wheels */ -+ switch(data[3] & 0x0f) -+ { case 0x01: state->dw= 1; state->dw2 = 0; break; -+ case 0x02: state->dw= 0; state->dw2 = 1; break; -+ case 0x0f: state->dw=-1; state->dw2 = 0; break; -+ case 0x0e: state->dw= 0; state->dw2 = -1; break; -+ default: state->dw= 0; state->dw2 = 0; -+ } -+ - return 0; - } - --static int M_netmouse(Gpm_Event *state, unsigned char *data) -+/* -+static int R_imps2(Gpm_EventExt *state, int fd) -+{ -+ unsigned char buffer[4]; -+ -+ buffer[0] = ((state->buttons & GPM_B_LEFT) ? 0x01 : 0) | -+ ((state->buttons & GPM_B_RIGHT) ? 0x02 : 0) | -+ ((state->buttons & GPM_B_MIDDLE) ? 0x04 : 0); -+ -+ if (state->dx < 0) buffer[0] |= 0x10; -+ if (state->dy > 0) buffer[0] |= 0x20; -+ -+ buffer[1] = ( state->dx >= 0) ? state->dx : 256+state->dx; -+ buffer[2] = (-state->dy >= 0) ? -state->dy : 256-state->dy; -+ buffer[3] = ( state->dw >= 0) ? state->dw : 256+state->dw; -+ -+ return write(fd,buffer,4); -+} -+*/ -+ -+static int M_netmouse(Gpm_EventExt *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, - but their protocol is one byte longer... So if you have notebook -@@ -533,6 +683,8 @@ - state->dy= -((data[0] & 0x20) ? data[2]-256 : data[2]); - else - state->dy = 0; -+ state->dw= 0; -+ state->dw2= 0; - return 0; - } - -@@ -566,7 +718,7 @@ - } - - #define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) --static int M_mman(Gpm_Event *state, unsigned char *data) -+static int M_mman(Gpm_EventExt *state, unsigned char *data) - { - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte -@@ -598,7 +750,10 @@ - prev= ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if (mytype->packetlen==4) b=data[3]>>4; - } -- -+ -+ state->dw= 0; -+ state->dw2= 0; -+ - if(mytype->packetlen==4) - { - if(b == 0) -@@ -653,7 +808,7 @@ - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - --static int M_wacom(Gpm_Event *state, unsigned char *data) -+static int M_wacom(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -694,7 +849,7 @@ - if (!IsA(UltraPad)){ /* Tool out of active area */ - ox=-1; - state->buttons=0; -- state->dx=state->dy=0; -+ state->dx=state->dy=state->dw=0; - } - - return 0; /* nothing more to do so leave */ -@@ -729,6 +884,8 @@ - - state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); -+ state->dw= 0; -+ state->dw2= 0; - } - - ox=x; oy=y; -@@ -756,7 +913,7 @@ - #define CAL_Y_MAX 0xF40 - #define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - --static int M_calus(Gpm_Event *state, unsigned char *data) -+static int M_calus(Gpm_EventExt *state, unsigned char *data) - { - int x, y; - -@@ -767,7 +924,7 @@ - + GPM_B_MIDDLE * ((data[0]>>3) & 1) - + GPM_B_RIGHT * ((data[0]>>4) & 1); - -- state->dx = 0; state->dy = 0; -+ state->dx = 0; state->dy = 0; state->dw= 0; state->dw2= 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col+1 -@@ -788,7 +945,7 @@ - return 0; - } - --static int M_calus_rel(Gpm_Event *state, unsigned char *data) -+static int M_calus_rel(Gpm_EventExt *state, unsigned char *data) - { - static int ox=-1, oy; - int x, y; -@@ -805,6 +962,8 @@ - + GPM_B_RIGHT * ((data[0]>>4) & 1); - - state->dx = (x-ox)/5; state->dy = (oy-y)/5; -+ state->dw = 0; -+ state->dw2 = 0; - ox=x; oy=y; - return 0; - } -@@ -822,7 +981,7 @@ - #define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) - #define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - --static int M_ncr(Gpm_Event *state, unsigned char *data) -+static int M_ncr(Gpm_EventExt *state, unsigned char *data) - { - int x,y; - -@@ -831,6 +990,7 @@ - - state->dx = (signed char)data[1]; /* currently unused */ - state->dy = (signed char)data[2]; -+ state->dw = 0; - - x = ((int)data[3] << 8) + (int)data[4]; - y = ((int)data[5] << 8) + (int)data[6]; -@@ -864,7 +1024,7 @@ - return 0; - } - --static int M_twid(Gpm_Event *state, unsigned char *data) -+static int M_twid(Gpm_EventExt *state, unsigned char *data) - { - unsigned long message=0UL; int i,h,v; - static int lasth, lastv, lastkey, key, lock=0, autorepeat=0; -@@ -922,6 +1082,8 @@ - { lasth = h; lastv = v; lock = 1; } - state->dx = -(h-lasth); lasth = h; - state->dy = -(v-lastv); lastv = v; -+ state->dw = 0; -+ state->dw2 = 0; - - #elif defined(TWIDDLER_BALLISTIC) - { -@@ -996,7 +1158,7 @@ - #ifdef HAVE_LINUX_JOYSTICK_H - /* Joystick mouse emulation (David Given) */ - --static int M_js(Gpm_Event *state, unsigned char *data) -+static int M_js(Gpm_EventExt *state, unsigned char *data) - { - struct JS_DATA_TYPE *jdata = (void*)data; - static int centerx = 0; -@@ -1049,12 +1211,15 @@ - if ((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - -+ state->dw = 0; -+ state->dw2 = 0; -+ - return 0; - } - #endif /* have joystick.h */ - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_serial(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_serial(Gpm_EventExt *state, unsigned char *data) - { - syn_process_serial_data (state, data); - -@@ -1063,14 +1228,14 @@ - - - /* Synaptics TouchPad mouse emulation (Henry Davies) */ --static int M_synaptics_ps2(Gpm_Event *state, unsigned char *data) -+static int M_synaptics_ps2(Gpm_EventExt *state, unsigned char *data) - { - syn_process_ps2_data (state, data); - - return 0; - } - --static int M_mtouch(Gpm_Event *state, unsigned char *data) -+static int M_mtouch(Gpm_EventExt *state, unsigned char *data) - { - /* - * This is a simple decoder for the MicroTouch touch screen -@@ -1150,7 +1315,7 @@ - static int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - static int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - --static int M_gunze(Gpm_Event *state, unsigned char *data) -+static int M_gunze(Gpm_EventExt *state, unsigned char *data) - { - /* - * This generates button-1 events, by now. -@@ -1257,7 +1422,7 @@ - /* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ - static int wizardpad_width = -1; - static int wizardpad_height = -1; --static int M_wp(Gpm_Event *state, unsigned char *data) -+static int M_wp(Gpm_EventExt *state, unsigned char *data) - { - int x, y, pressure; - -@@ -1593,9 +1758,10 @@ - struct Gpm_Type *type, int argc, char **argv) - { - struct termios tty; -+ char rep1, rep2, rep3, rep4; - - /* accept "-o dtr", "-o rts" and "-o both" */ -- if (option_modem_lines(fd, argc, argv)) return NULL; -+// if (option_modem_lines(fd, argc, argv)) return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette -@@ -1616,8 +1782,7 @@ - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ -- -- return type; -+ return type; - } - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ -@@ -1991,12 +2156,18 @@ - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel", -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4dps2", "A4tech 4D (ps2) - 3 buttons and 2 wheels", -+ "", M_a4dps2, I_imps2, CS7 | STD_FLG, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"a4d", "A4tech 4D (serial) - 3 buttons and 2 wheels", -+ "", M_a4d, I_pnp, CS7 | STD_FLG, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -@@ -2018,7 +2189,6 @@ - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -- - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -diff -u -r gpm-1.19.3/mouse-test.c gpm-1.19.3.wheel/mouse-test.c ---- gpm-1.19.3/mouse-test.c Tue Jan 18 09:23:00 2000 -+++ gpm-1.19.3.wheel/mouse-test.c Sat Nov 11 19:28:59 2000 -@@ -55,6 +55,7 @@ - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, -+ DEF_SIMWHEEL, - (char *)NULL /* extra */, - (Gpm_Type *)NULL - }; -@@ -502,7 +503,7 @@ - struct item *cur=*nextitem; - int packetheads=0; - int match=0; -- Gpm_Event event; -+ Gpm_EventExt event; - - if (packetsize!=cur->this->packetlen) - { -@@ -583,7 +584,7 @@ - for (nextitem=&list; *nextitem; /* nothing */) - { - struct item *cur=*nextitem; -- Gpm_Event event; -+ Gpm_EventExt event; - - /* try to decode button press and release */ - for (i=0;i - - - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/README b/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/README deleted file mode 100644 index ce5cc0a3..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/README +++ /dev/null @@ -1,25 +0,0 @@ -From: Radoslaw Garbacz -To: rubini@linux.it -Date: Mon, 19 Jun 2000 12:28:02 +0000 -Subject: gpm and usb touchscreen - - My name is Radoslaw Garbacz. -I have added support to MicroTouch usb devices in gpm application. I -send You the patch and the source of mice.c (which I changed). - Please send me any suggestions about it. - If You think that is is good idea to join my changes to official -release of gpm I'll be very glad. -I also send You source of microtouch device driver to check my changes. - -It is also nessesary to copy touchscreen.h file to ./include/linux -directory. - -I changed the gpm, version 1.19.1. - -Best reagrds. - --- - >>> POS Experts Consulting <<< - Radoslaw Garbacz - tel : (048 71) 354 80 85 - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c b/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c deleted file mode 100644 index 30376630..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/mt_calibra.c +++ /dev/null @@ -1,81 +0,0 @@ -// copyrights (c) WWO -// -// Written by Rados³aw Garbacz -// 14/06/2000 -// A simple calibration program for micro touch screen. - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "touchscreen.h" -//#include <> - -int getStatus(int _hFile) -{ - unsigned char buff[20]; - int nRet; - - // printf("Get status\n"); - if((nRet = ioctl(_hFile, TSCRN_CONTROLLER_STATUS, buff)) < 0) { - printf("Error ioctl %d\n", nRet); - close(_hFile); - exit(1); - } - // printf("cmd status = %d\n",buff[3]); - - return buff[3]; -}; -int main() -{ - int nRet, hFile; - char buff[50]; - - memset(buff, 0, sizeof(buff)); - - if((hFile = open("/dev/usb/usbtest", O_RDONLY)) < 0) { - printf("Error open %d\n", hFile); - return 0; - }; - (void) getStatus(hFile); - printf("Soft reset of device\n"); - if((nRet = ioctl(hFile, 73)) < 0) { - printf("Error ioctl %d\n", nRet); - return 0; - } - (void) getStatus(hFile); - printf("Calibrate controler extended \n"); - *buff = TSCRN_CORNER_CALIBRATION_TYPE; - if((nRet = ioctl(hFile, TSCRN_CALIBRATION, buff)) < 0) { - printf("Error ioctl %d\n", nRet); - return 0; - } - printf("\n"); - // while((nRet = getStatus(hFile)) != 1) - // printf("wait for staus 1 status=%d\r",nRet); - // printf("\n"); - while((nRet = getStatus(hFile)) < 2) { - printf("wait for lower left corner %d\n", nRet); - sleep(1); - } - printf("\n"); - while((nRet = getStatus(hFile)) < 3) { - printf("lower left corner complited;wait for upper right corner %d\n", - nRet); - sleep(1); - } - printf("\n"); - if((nRet = getStatus(hFile)) == 3) - printf("upper right corner complited %d\n", nRet); - else - printf("upper right corner error %d\n", nRet); - - printf(" koniec kalibracji OK ioctl: %d \n", nRet); - close(hFile); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/touchscreen.c b/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/touchscreen.c deleted file mode 100644 index ec1e17ba..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/touchscreen.c +++ /dev/null @@ -1,1029 +0,0 @@ - -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - * History - * - * 0.1 06/05/2000 (RGA) - * Development work was begun. - * - * 0.2 09/05/2000 (RGA) - * Documentation about MicroTouch controller was arrived. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include /* used in new tty drivers */ -#include /* used in new tty drivers */ -#include -#include -#include -#include - -#ifdef CONFIG_KERNELD -# include -#endif - -//#define DEBUG -#define TSCRN_IOCTL -//#define __TEST_NO_DEVICE__ - -#define TSCRN_MAX_MNR 16 /* We're allocated 16 minors */ -#define TSCRN_BASE_MNR 48 /* USB Scanners start at minor 48 */ - -#define IS_EP_BULK(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) -#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) -#define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0) -#define IS_EP_INTR_IN(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) -#define IS_EP_INTR_OUT(ep) (IS_EP_INTR(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) - -#define USB_TSCRN_MINOR(X) MINOR((X)->i_rdev) - TSCRN_BASE_MNR - -#ifdef DEBUG -# define TSCRN_DEBUG(X) X -#else -# define TSCRN_DEBUG(X) -#endif - -#include -#include -#include "touchscreen.h" - -struct tscrn_usb_data { - struct usb_device *dev; - wait_queue_head_t wait; - struct urb irq; - struct urb ctrlin; - struct urb ctrlout; - devrequest *setup_packet; // for control transfers - unsigned int ifnum; // Interface number of the USB device - kdev_t minor; // TouchScreen minor - used in disconnect() - unsigned char data[TSCRN_USB_RAPORT_SIZE_DATA]; // Data buffer X-Y, and - // button - int nLoopCounter; // number of data packet last received +1 - char isopen; // Not zero if the device is open - char present; // Not zero if device is present - unsigned char *obuf, *ibuf; // transfer buffers - unsigned char *pToRead, *pToWrite; // pointers to toRead cell of buffer - // and to toWrite one - char intr_ep; // Endpoint assignments - struct input_dev input_dev; // to work as an input device driver -}; - -static struct tscrn_usb_data *p_tscrn_table[TSCRN_MAX_MNR] = - { NULL, /* ... */ }; - -MODULE_AUTHOR("Radoslaw Garbacz, garbacz@posexperts.com.pl"); -MODULE_DESCRIPTION("USB touchscreen driver"); - -static __s32 vendor = -1, product = -1; - -MODULE_PARM(vendor, "i"); -MODULE_PARM_DESC(vendor, "User specified USB idVendor"); - -MODULE_PARM(product, "i"); -MODULE_PARM_DESC(product, "User specified USB idProduct"); - -/* Forward declarations */ -static struct usb_driver touchscreen_driver; - -/* Procedures */ - -/** - * Runs after ctrl requests. - */ -static void ctrl_touchscreen(struct urb *urb) -{ - struct tscrn_usb_data *tscrn = urb->context; - - dbg("ctrl_touchscreen(%d): status=%d", tscrn->minor, urb->status); - - if(waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - return; -}; - -/** - * Runs on new data received from device - * The buffer should keep the last state of device, thus the buffer overflow - * can occurre - * The client can't read data when pToRead == pToWrite - */ -static void irq_touchscreen(struct urb *urb) -{ - /* - * data raports... - */ - struct tscrn_usb_data *tscrn = urb->context; - struct tscrn_usb_data_report *data = - (struct tscrn_usb_data_report *) tscrn->data; - - if(urb->status) - return; - - // return when driver was clesed - if(!tscrn->isopen) - return; - - // increase loop counter - // !!! Unfortunately the data was lost to seldom !!! - // if((int)GET_LOOP(data) != tscrn->nLoopCounter) - // warn("warn:Lost data new loop %d previous loop - // %d",(int)GET_LOOP(data),(int)tscrn->nLoopCounter); - - input_report_key(&tscrn->input_dev, BTN_LEFT, IS_TOUCHED(data)); - input_report_abs(&tscrn->input_dev, ABS_X, GET_XC(data)); - input_report_abs(&tscrn->input_dev, ABS_Y, GET_YC(data)); - - tscrn->nLoopCounter = (GET_LOOP(data)) + 1; - - // store data to buffer - memcpy(tscrn->pToWrite, data, TSCRN_USB_RAPORT_SIZE_DATA); - // next data to next cell - if(tscrn->pToRead == NULL) - tscrn->pToRead = tscrn->pToWrite; - - tscrn->pToWrite += TSCRN_USB_RAPORT_SIZE_DATA; - if(tscrn->pToWrite >= tscrn->obuf + OBUF_SIZE) - tscrn->pToWrite = tscrn->obuf; - - if(waitqueue_active(&tscrn->wait)) - wake_up_interruptible(&tscrn->wait); - - // dbg("irq_touchscreen(): GET_Data - // 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d", - // (int)data[0],(int)data[1],(int)data[2],(int)data[3],(int)data[4],(int)data[5],(int)data[6],(int)data[7],(int)data[8],(int)data[9],(int)data[10], - // tscrn->ctrlout.status); - - return; -} - -static int open_touchscreen(struct inode *inode, struct file *file) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("open_touchscreen: tscrn_minor:%d", minor); - - if(!p_tscrn_table[minor]) { - err("open_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - dev = tscrn->dev; - - if(!dev) { - return -ENODEV; - } - - if(!tscrn->present) { - return -ENODEV; - } - - if(tscrn->isopen) { - return -EBUSY; - } - // clear up the data buffer - memset(tscrn->obuf, 0x0, OBUF_SIZE); - tscrn->pToRead = NULL; - tscrn->pToWrite = tscrn->obuf; - - tscrn->isopen = 1; - - file->private_data = tscrn; /* Used by the read and write metheds */ - - MOD_INC_USE_COUNT; - - return 0; -} - -static int close_touchscreen(struct inode *inode, struct file *file) -{ - struct tscrn_usb_data *tscrn; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - minor = USB_TSCRN_MINOR(inode); - - dbg("close_touchscreen: tscrn_minor:%d", minor); - - if(!p_tscrn_table[minor]) { - err("close_touchscreen(%d): invalid tscrn_minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - - tscrn->isopen = 0; - - file->private_data = NULL; - - MOD_DEC_USE_COUNT; - - return 0; -} - -static ssize_t read_touchscreen(struct file *file, char *buffer, - size_t count, loff_t * ppos) -{ - struct tscrn_usb_data *tscrn; - struct usb_device *dev; - - ssize_t bytes_read; /* Overall count of bytes_read */ - ssize_t ret; - - kdev_t minor; - - int partial; /* Number of bytes successfully read */ - int this_read; /* Max number of bytes to read */ - - // int result; - - unsigned char *buf, *pToRead; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - - tscrn = file->private_data; - minor = tscrn->minor; - buf = tscrn->obuf; - pToRead = tscrn->pToRead; - dev = tscrn->dev; - - bytes_read = 0; - ret = 0; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) - return 0; // no new data - - if(signal_pending(current)) { - ret = -EINTR; - return ret; - } - - this_read = - (count >= - TSCRN_USB_RAPORT_SIZE_DATA) ? TSCRN_USB_RAPORT_SIZE_DATA : count; - - partial = this_read; - // dbg("read stats(%d): result:%d this_read:%d partial:%d", minor, result, - // this_read, partial); - dbg("read count=%d", count); - - if(partial) { /* Data returned */ - if(copy_to_user(buffer, tscrn->pToRead, this_read)) { - ret = -EFAULT; - return ret; // break; - } - count -= partial; - bytes_read += partial; - buffer += partial; - tscrn->pToRead += partial; - if(tscrn->pToRead >= tscrn->obuf + OBUF_SIZE) - tscrn->pToRead = tscrn->obuf; - } - - dbg("read ended bytes_read(%d)", bytes_read); - - return ret ? ret : bytes_read; -} - -/** -* Zmiana dla j±dra 2.2.x z select na poll -*/ -static unsigned int poll_touchscreen(struct file *file, - struct poll_table_struct *_wait) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - struct inode *inode; - struct dentry *dentry; - - kdev_t minor; - - dentry = file->f_dentry; - inode = dentry->d_inode; - minor = USB_TSCRN_MINOR(inode); - - dbg("poll_touchscreen(%d): entered", minor); - - if(!p_tscrn_table[minor]) { - err("poll_touchscreen(%d): invalid minor", minor); - return 0; - // return -ENODEV; - }; - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - // if(_selType != SEL_IN) - // return -EPERM; - - if((tscrn->pToWrite == tscrn->pToRead) || (tscrn->pToRead == NULL)) { - poll_wait(file, &tscrn->wait, _wait); - return 0; - }; - - return 1; -}; - -static int ioctl_touchscreen(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct usb_device *dev; - struct tscrn_usb_data *tscrn; - - int nRet; - - kdev_t minor; - -#ifdef __TEST_NO_DEVICE__ - return -ENODEV; -#endif - minor = USB_TSCRN_MINOR(inode); - - dbg("ioctl_touchscreen(%d): entered cmd=%d", minor, cmd); - - if(!p_tscrn_table[minor]) { - err("ioctl_touchscreen(%d): invalid minor", minor); - return -ENODEV; - } - - tscrn = p_tscrn_table[minor]; - dev = tscrn->dev; - - switch (cmd) { - case TSCRN_USER_REQUEST: - { - /* - * sends reset command - */ - struct { - __u8 data; - __u8 request; - __u16 value; - __u16 index; - } args; - - if(copy_from_user(&args, (void *) arg, sizeof(args))) - return -EFAULT; - - // for the present a soft reset - tscrn->setup_packet->requesttype = args.data; - tscrn->setup_packet->request = args.request; - tscrn->setup_packet->value = args.value; - tscrn->setup_packet->index = args.index; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), - (unsigned char *) tscrn->setup_packet, NULL, 0, - ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlout))) { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, - tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): cmd status=%d nRet=%d", minor, - tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): cmd status=%d", minor, - tscrn->ctrlout.status); - return tscrn->ctrlout.status; - }; - case TSCRN_CLEAR_HALT: - { - // when end_point is STALLED always returned -1 at first - // and OK on second exec, then end_point returns to normal state - return usb_clear_halt(dev, 0x00); // 0x80 - }; - case TSCRN_HARD_RESET: - { - tscrn->setup_packet->requesttype = - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_HARD_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), - (unsigned char *) tscrn->setup_packet, NULL, 0, - ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlout))) { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, - tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, - tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_SOFT_RESET: - { - tscrn->setup_packet->requesttype = - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESET; - tscrn->setup_packet->value = TSCRN_USB_PARAM_SOFT_RESET; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0), - (unsigned char *) tscrn->setup_packet, NULL, 0, - ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlout))) { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, - tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, - tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_CONTROLLER_STATUS: - { - tscrn->setup_packet->requesttype = - USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_STATUS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_STATUS; - memset(tscrn->ibuf, 0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), - (unsigned char *) tscrn->setup_packet, tscrn->ibuf, - TSCRN_USB_RAPORT_SIZE_STATUS, ctrl_touchscreen, - tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlin))) { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, - tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor, (int) tscrn->ibuf[0], (int) tscrn->ibuf[1], (int) tscrn->ibuf[2], (int) tscrn->ibuf[3], (int) tscrn->ibuf[4], (int) tscrn->ibuf[5], (int) tscrn->ibuf[6], (int) tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if(copy_to_user - ((void *) arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_STATUS)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CONTROLLER_ID: - { - tscrn->setup_packet->requesttype = - USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - memset(tscrn->ibuf, 0x0, IBUF_SIZE); - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), - (unsigned char *) tscrn->setup_packet, tscrn->ibuf, - TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlin))) { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, - tscrn->ctrlin.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlin.status); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor, (int) tscrn->ibuf[0], (int) tscrn->ibuf[1], (int) tscrn->ibuf[2], (int) tscrn->ibuf[3], (int) tscrn->ibuf[4], (int) tscrn->ibuf[5], (int) tscrn->ibuf[6], (int) tscrn->ibuf[7], tscrn->ctrlin.status, nRet); - - if(tscrn->ctrlin.status == 0) - if(copy_to_user - ((void *) arg, tscrn->ibuf, TSCRN_USB_RAPORT_SIZE_ID)) - return -EFAULT; - - return tscrn->ctrlin.status; - }; - case TSCRN_CALIBRATION: - { - __u16 type; - - if(copy_from_user(&type, (void *) arg, sizeof(type))) { - err("ioctl_touchscreen(%d): copy from user error arg=%d.", minor, - *((int *) arg)); - return -EFAULT; - }; - - switch (type) { - case TSCRN_EXTENDED_CALIBRATION_TYPE: - case TSCRN_CORNER_CALIBRATION_TYPE: - break; - default: - err("ioctl_touchscreen(%d): unknown calibration type %d.", minor, - type); - return -EFAULT; - - }; - tscrn->setup_packet->requesttype = - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CALIBRATION; - tscrn->setup_packet->value = type; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), - (unsigned char *) tscrn->setup_packet, NULL, 0, - ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlout))) { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, - tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, - tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - case TSCRN_RESTORE_DEFAULTS: - { - tscrn->setup_packet->requesttype = - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_RESTORE_DEFAULTS; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = 0; - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_sndctrlpipe(dev, 0x0), - (unsigned char *) tscrn->setup_packet, NULL, 0, - ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlout))) { - err("ioctl_touchscreen(%d): errror=%d status=%d.", minor, nRet, - tscrn->ctrlout.status); - return nRet; - } - dbg("ioctl_touchscreen(%d): status=%d nRet=%d", minor, - tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("ioctl_touchscreen(%d): status=%d", minor, tscrn->ctrlout.status); - - return tscrn->ctrlout.status; - }; - default: - return -ENOIOCTLCMD; - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////// -static void *probe_touchscreen(struct usb_device *dev, unsigned int ifnum) -{ - struct tscrn_usb_data *tscrn; - struct usb_interface_descriptor *interface; - struct usb_endpoint_descriptor *endpoint; - -#ifdef DEBUG - int nRet, nCounter; -#endif - // devrequest *setup_packet; - - int ep_cnt; - - kdev_t minor; - - char valid_device = 0; - char have_intr; - - if(vendor != -1 && product != -1) { - info - ("probe_touchscreen: User specified USB touchscreen -- Vendor:Product - %x:%x", - vendor, product); - } - - /* - * 1. Check Vendor/Product - * 2. Determine/Assign Bulk Endpoints - * 3. Determine/Assign Intr Endpoint - */ - - /* - * - * NOTE: Just because a product is supported here does not mean that - * applications exist that support the product. It's in the hopes - * that this will allow developers a means to produce applications - * that will support USB products. - * - * Until we detect a device which is pleasing, we silently punt. - */ - - if(dev->descriptor.idVendor == MICROTOUCH_VENDOR_ID - && dev->descriptor.idProduct == MICROTOUCH_PRODUCT_ID) - valid_device = 1; - // no user specification devices !!! - // -- else - // -- /* User specified */ - // -- if (dev->descriptor.idVendor == vendor - // -- && dev->descriptor.idProduct == product) - // -- valid_device = 1; - - if(!valid_device) - return NULL; /* We didn't find anything pleasing */ - - if(ifnum != 0) { - info("probe_touchscreen: not correct interface no."); - return NULL; - } - /* - * After this point we can be a little noisy about what we are trying to - * configure. - */ - - if(dev->descriptor.bNumConfigurations != 1) { - info("probe_touchscreen: Only one device configuration is supported."); - return NULL; - } - - if(dev->config[0].bNumInterfaces != 1) { - info("probe_touchscreen: Only one device interface is supported."); - return NULL; - } - - interface = dev->config[0].interface[ifnum].altsetting; - // interface = dev->actconfig[0].interface[ifnum].altsetting; - endpoint = interface[ifnum].endpoint; - - /* - * Start checking for two bulk endpoints OR two bulk endpoints *and* one - * interrupt endpoint. If we have an interrupt endpoint go ahead and - * setup the handler. FIXME: This is a future enhancement... - */ - - dbg("probe_touchscreen: Number of Endpoints:%d", - (int) interface->bNumEndpoints); - - if(interface->bNumEndpoints != 1) { - info("probe_touchscreen: Only one endpoints supported."); - return NULL; - } - // ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0; - ep_cnt = have_intr = 0; - - if(IS_EP_INTR(endpoint[ep_cnt])) { - have_intr = ++ep_cnt; - dbg("probe_touchscreen: intr_ep:%d", have_intr); - } else { - info("probe_touchscreen: Undetected endpoint. Notify the maintainer."); - return NULL; /* Shouldn't ever get here unless we have - * something weird */ - } - - /* - * Determine a minor number and initialize the structure associated - * with it. The problem with this is that we are counting on the fact - * that the user will sequentially add device nodes for the touchscreen - * devices. */ - - /* - * Use firs free file devices - */ - for(minor = 0; minor < TSCRN_MAX_MNR; minor++) { - if(!p_tscrn_table[minor]) - break; - } - - /* - * Check to make sure that the last slot isn't already taken - */ - if(p_tscrn_table[minor]) { - err("probe_touchscreen: No more minor devices remaining."); - return NULL; - } - - dbg("probe_touchscreen: Allocated minor:%d", minor); - - if(!(tscrn = kmalloc(sizeof(struct tscrn_usb_data), GFP_KERNEL))) { - err("probe_touchscreen: Out of memory."); - return NULL; - } - memset(tscrn, 0, sizeof(struct tscrn_usb_data)); - dbg("probe_touchscreen(%d): Address of tscrn:%p", minor, tscrn); - - /* - * Ok, now initialize all the relevant values - */ - if(!(tscrn->obuf = (char *) kmalloc(OBUF_SIZE, GFP_KERNEL))) { - err("probe_touchscreen(%d): Not enough memory for the output buffer.", - minor); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): obuf address:%p", minor, tscrn->obuf); - - if(!(tscrn->ibuf = (char *) kmalloc(IBUF_SIZE, GFP_KERNEL))) { - err("probe_touchscreen(%d): Not enough memory for the input buffer.", - minor); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): ibuf address:%p", minor, tscrn->ibuf); - - if(! - (tscrn->setup_packet = - (void *) kmalloc(sizeof(*tscrn->setup_packet), GFP_KERNEL))) { - err("probe_touchscreen(%d): Not enough memory for the statuc.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): setup_packet address:%p, size=%d size2=%d", - minor, tscrn->setup_packet, sizeof(*tscrn->setup_packet), - sizeof(devrequest)); - memset((char *) tscrn->setup_packet, 0, sizeof(*tscrn->setup_packet)); - - // Initiation input_dev structure - tscrn->input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - tscrn->input_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT); // | - // BIT(BTN_RIGHT) - // | - // BIT(BTN_MIDDLE); - tscrn->input_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - - // Initialization toRead and toWrite variables - tscrn->pToWrite = tscrn->obuf; - tscrn->pToRead = NULL; - - // Initiation wait queue - dbg("probe_touchscreen(%d): initialization wait_queue", minor); - init_waitqueue_head(&tscrn->wait); - dbg("probe_touchscreen(%d): wait_queue initialized", minor); - -#ifdef DEBUG - // ///////////////////////////////////////////////////////////////////////////////// - // Only for testing, not for normal useing of device driver - // Register the interface - if(!(nRet = usb_interface_claimed(&dev->actconfig[0].interface[ifnum]))) { - dbg("probe_touchscreen(%d): interface_claimed=%d", minor, nRet); - usb_driver_claim_interface(&touchscreen_driver, - &dev->actconfig[0].interface[ifnum], tscrn); - } else - dbg("probe_touchscreen(%d): error interface_claimed=%d", minor, nRet); - dbg("probe_touchscreen(%d): Configuring CTRL handler for intr EP:%d", minor, - have_intr); - /* - * sends reset command - */ - // receive answer data - tscrn->setup_packet->requesttype = - USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; - tscrn->setup_packet->request = USB_REQ_GET_CONFIGURATION; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x0; // ifnum; - tscrn->setup_packet->length = 1; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), - (unsigned char *) tscrn->setup_packet, tscrn->ibuf, - sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlin))) { - err("probe_touchscreen(%d): GET_CONFIGURATION:Get smth error=%d status=%d.", minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - nCounter = 10; - dbg("probe_touchscreen(%d): GET_CONFIGURATION:wait for data: status=%d nRet=%d", minor, tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_CONFIGURATION:gets 0x%x,0x%x status=%d nRet=%d", minor, (int) tscrn->ibuf[0], (int) tscrn->ibuf[1], tscrn->ctrlin.status, nRet); - if(tscrn->ctrlin.status == (-32)) { - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe", minor, - tscrn->ctrlin.status); - nRet = usb_clear_halt(dev, 0x00); - dbg("probe_touchscreen(%d): get error -32 status=%d - reset pipe nRet=%d", - minor, tscrn->ctrlin.status, nRet); - } - // - // receive answer data - tscrn->setup_packet->requesttype = - USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT; - tscrn->setup_packet->request = USB_REQ_GET_STATUS; - tscrn->setup_packet->value = 0x0; - tscrn->setup_packet->index = 0x81; - tscrn->setup_packet->length = 2; - FILL_CONTROL_URB(&tscrn->ctrlin, dev, - usb_rcvctrlpipe(dev, 0x80), - (unsigned char *) tscrn->setup_packet, tscrn->ibuf, - sizeof(tscrn->ibuf), ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlin))) { - err("probe_touchscreen(%d): GET_STATUS:Get smth error=%d status=%d .", - minor, nRet, tscrn->ctrlin.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_STATUS: status=%d nRet=%d", minor, - tscrn->ctrlin.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_STATUS:gets 0x%x,0x%x,0x%x status=%d nRet=%d", minor, (int) tscrn->ibuf[0], (int) tscrn->ibuf[1], (int) tscrn->ibuf[2], tscrn->ctrlin.status, nRet); - - // -- // get controller id report - tscrn->setup_packet->requesttype = - USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; - tscrn->setup_packet->request = TSCRN_USB_REQUEST_CONTROLLER_ID; - tscrn->setup_packet->value = 0; - tscrn->setup_packet->index = 0; - tscrn->setup_packet->length = TSCRN_USB_RAPORT_SIZE_ID; - - memset((char *) tscrn->ibuf, 0, IBUF_SIZE); - - FILL_CONTROL_URB(&tscrn->ctrlout, dev, - usb_rcvctrlpipe(dev, 0x80), - (unsigned char *) tscrn->setup_packet, tscrn->ibuf, - TSCRN_USB_RAPORT_SIZE_ID, ctrl_touchscreen, tscrn); - - if((nRet = usb_submit_urb(&tscrn->ctrlout))) { - err("probe_touchscreen(%d): GET_ID:error=%d status=%d .", minor, nRet, - tscrn->ctrlout.status); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor, (int) tscrn->ibuf[0], (int) tscrn->ibuf[1], (int) tscrn->ibuf[2], (int) tscrn->ibuf[3], (int) tscrn->ibuf[4], (int) tscrn->ibuf[5], (int) tscrn->ibuf[6], (int) tscrn->ibuf[7], tscrn->ctrlout.status, nRet); - interruptible_sleep_on(&tscrn->wait); - dbg("probe_touchscreen(%d): GET_ID gets 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x status=%d nRet=%d", minor, (int) tscrn->ibuf[0], (int) tscrn->ibuf[1], (int) tscrn->ibuf[2], (int) tscrn->ibuf[3], (int) tscrn->ibuf[4], (int) tscrn->ibuf[5], (int) tscrn->ibuf[6], (int) tscrn->ibuf[7], tscrn->ctrlout.status, nRet); -#endif - // ////////////////////////////////////////////////////////////////////////////////// - /* - * Ok, if we detected an interrupt EP, setup a handler for it - */ - if(have_intr) { - dbg("probe_touchscreen(%d): Configuring IRQ handler for intr EP:%d", - minor, have_intr); - FILL_INT_URB(&tscrn->irq, dev, usb_rcvintpipe(dev, 0x81), // endpoint[(int - // )(have_intr-1)].bEndpointAddress), - tscrn->data, TSCRN_USB_RAPORT_SIZE_DATA, irq_touchscreen, - tscrn, endpoint[(int) (have_intr - 1)].bInterval); - // 2); - - if(usb_submit_urb(&tscrn->irq)) { - err("probe_touchscreen(%d): Unable to allocate INT URB.", minor); - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - kfree(tscrn); - return NULL; - } - // the status will be -115 -> thist means EINPROGRESS, but it should be - // that. - dbg("probe_touchscreen(%d): IRQ done interval=%d status=%d", minor, - endpoint[(int) (have_intr - 1)].bInterval, tscrn->irq.status); - } - - tscrn->intr_ep = have_intr; - tscrn->present = 1; - tscrn->dev = dev; - tscrn->minor = minor; - tscrn->isopen = 0; - - input_register_device(&tscrn->input_dev); - - return p_tscrn_table[minor] = tscrn; -} - -static void disconnect_touchscreen(struct usb_device *dev, void *ptr) -{ - struct tscrn_usb_data *tscrn = (struct tscrn_usb_data *) ptr; - - // if(tscrn->intr_ep) - // { - if(tscrn->irq.status != 0) { - dbg("disconnect_touchscreen(%d): Unlinking IRQ URB", tscrn->minor); - usb_unlink_urb(&tscrn->irq); - } - // } - if(tscrn->ctrlin.status != 0) { - dbg("disconnect_touchscreen(%d): Unlinking CTRLIN URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlin); - } - if(tscrn->ctrlout.status != 0) { - dbg("disconnect_touchscreen(%d): Unlinking CTRLOUT URB", tscrn->minor); - usb_unlink_urb(&tscrn->ctrlout); - } - - input_unregister_device(&tscrn->input_dev); - usb_driver_release_interface(&touchscreen_driver, - &tscrn->dev->actconfig->interface[tscrn-> - ifnum]); - - kfree(tscrn->ibuf); - kfree(tscrn->obuf); - kfree(tscrn->setup_packet); - - dbg("disconnect_touchscreen: De-allocating minor:%d", tscrn->minor); - p_tscrn_table[tscrn->minor] = NULL; - kfree(tscrn); -} - -static struct file_operations usb_touchscreen_fops = { - read:read_touchscreen, - // write: write_touchscreen, - poll:poll_touchscreen, - ioctl:ioctl_touchscreen, - open:open_touchscreen, - release:close_touchscreen, -}; - -static struct usb_driver touchscreen_driver = { - "touchscreen", - probe_touchscreen, - disconnect_touchscreen, - {NULL, NULL}, - &usb_touchscreen_fops, - TSCRN_BASE_MNR -}; - -void __exit usb_touchscreen_exit(void) -{ - usb_deregister(&touchscreen_driver); -} - -int __init usb_touchscreen_init(void) -{ - if(usb_register(&touchscreen_driver) < 0) - return -1; - - info("USB Touchscreen support registered."); - return 0; -} - -module_init(usb_touchscreen_init); -module_exit(usb_touchscreen_exit); diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/touchscreen.h b/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/touchscreen.h deleted file mode 100644 index f19c7d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/kernel-driver/touchscreen.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- linux-c -*- */ - -/* - * Driver for USB Touchscreen (Microtech - IBM SurePos 4820) - * - * Copyright (C) 2000 Wojciech Woziwodzki - * Written by Radoslaw Garbacz - * - * The header file - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Originally based upon scanner.c (David E. Nelson). - * - */ - - -#include -#include - - -// CTRL numbers of commands define -#define TSCRN_SOFT_RESET 73 -#define TSCRN_HARD_RESET 74 -#define TSCRN_CALIBRATE 75 -#define TSCRN_CONTROLLER_STATUS 76 -#define TSCRN_RESTORE_DEFAULTS 77 -#define TSCRN_CONTROLLER_ID 78 -#define TSCRN_REPORT_ENABLE 79 -#define TSCRN_CLEAR_HALT 80 -#define TSCRN_USER_REQUEST 81 -#define TSCRN_CALIBRATION 82 -// device requests define -#define TSCRN_USB_REQUEST_RESET 7 -#define TSCRN_USB_REQUEST_CALIBRATION 4 -#define TSCRN_USB_REQUEST_STATUS 6 -#define TSCRN_USB_REQUEST_RESTORE_DEFAULTS 8 -#define TSCRN_USB_REQUEST_CONTROLLER_ID 10 -// define requests parameters -// for reset request -#define TSCRN_USB_PARAM_SOFT_RESET 1 -#define TSCRN_USB_PARAM_HARD_RESET 2 -// for calibrate request -#define TSCRN_EXTENDED_CALIBRATION_TYPE 1 -#define TSCRN_CORNER_CALIBRATION_TYPE 2 - -// define raport sizes -#define TSCRN_USB_RAPORT_SIZE_DATA 11 -#define TSCRN_USB_RAPORT_SIZE_STATUS 8 -#define TSCRN_USB_RAPORT_SIZE_ID 16 - -#define IBUF_SIZE TSCRN_USB_RAPORT_SIZE_ID -//input data buffer 12 * data raports -#define OBUF_SIZE TSCRN_USB_RAPORT_SIZE_DATA*12 - - -#define MICROTOUCH_VENDOR_ID 0x0596 -#define MICROTOUCH_PRODUCT_ID 0x0001 - -//the report no 1 field definitions -#define IS_TOUCHED_BYTE(data) ((data & 0x40) ? 1:0) -#define IS_TOUCHED(str) ((str->PenStatus & 0x40) ? 1:0) -#define GET_XC(str) (str->XCompensHi<<8 | str->XCompensLo) -#define GET_YC(str) (str->YCompensHi<<8 | str->YCompensLo) -#define GET_XR(str) (str->XRawHi<<8 | str->XRawLo) -#define GET_YR(str) (str->YRawHi<<8 | str->YRawLo) -//#define GET_XC(str) (str->XCompensHi*256+str->XCompensLo) -//#define GET_YC(str) (str->YCompensHi*256+str->YCompensLo) -//#define GET_XR(str) (str->XRawHi*256+str->XRawLo) -//#define GET_YR(str) (str->YRawHi*256+str->YRawLo) -#define GET_LOOP(str) (str->LoopCounter) - -struct tscrn_usb_data_report -{ - __u8 Id; // 0x01 for this report - __u8 LoopCounter; - __u8 PenStatus; // 7b = 1; 6b is 1 for touching, 0 when not touching - __u8 XCompensLo; //compensed low 8 bits of the X coordinate - __u8 XCompensHi; // high X - __u8 YCompensLo; // low Y - __u8 YCompensHi; // high Y - __u8 XRawLo; //raw low 8 bits of the X coordinate - __u8 XRawHi; // high X - __u8 YRawLo; // low Y - __u8 YRawHi; // high Y -}; - -struct tscrn_usb_status_report -{ - __u8 Id; // 0x06 - __u16 POCStatus; // power on check status - __u8 CMDStatus; // last commad status - __u8 TouchStatus; // finger up/down - __u8 Filter[3]; // filter, for future expansion -}; - -struct tscrn_usb_controller_id_raport -{ - __u8 Id; // 0x0C - __u16 ControllerType; // Controller type - __u8 FWMajorRevision; // firmware major revision level - __u8 FMMinorRevision; // firmware minor revision level - __u8 Features; // special features - __u8 ROMChecksum; // ROM Checksum - __u16 Reserved01; - __u8 Reserved02; - __u8 Reserved03; - __u8 Reserved04; - __u8 Reserved05; - __u8 Reserved06; - __u8 Reserved07; -}; - - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/mice.c.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/mice.c.patch deleted file mode 100644 index 82a3ddab..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/microtouch-usb/mice.c.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- mice.c-old Tue Mar 7 15:10:00 2000 -+++ mice.c Mon Jun 19 14:03:57 2000 -@@ -58,6 +58,7 @@ - - #include /* MAJOR */ - #include -+#include - - #ifdef HAVE_LINUX_JOYSTICK_H - #include -@@ -200,6 +201,7 @@ - /* real absolute coordinates for absolute devices, not very clean */ - - #define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ -+//#define REALPOS_MAX 0xFFFF /* min 0 max=16383, but due to change. */ - int realposx=-1, realposy=-1; - - /*========================================================================*/ -@@ -1070,6 +1072,130 @@ - return 0; - } - -+/** -+ * Convert data from usb devices to event type structure. -+ */ -+static int M_usbmt(Gpm_Event *state, unsigned char *data) -+{ -+ /* -+ * This is a simple decoder for the MicroTouch touch screen -+ * usb devices. It uses the "tablet" format and only generates button-1 -+ * events. Check README.microtouch for additional information. -+ */ -+ int x, y; -+ static int avgx=-1, avgy; /* average over time, for smooth feeling */ -+ static int upx, upy; /* keep track of last finger-up place */ -+ static struct timeval uptv, tv; /* time of last up, and down events */ -+ struct tscrn_usb_data_report *stData; -+ -+ #define REAL_TO_XCELL(x) ((x * win.ws_col / 0x3FFF)+1) -+ #define REAL_TO_YCELL(y) ((y * win.ws_row / 0x3FFF)+1) -+ -+ #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -+ #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ -+ (t2.tv_usec-t1.tv_usec)/1000) -+ #define MIN_XR 0xaf0 -+ #define MAX_XR 0x34d0 -+ #define MIN_YR 0xc4e -+ #define MAX_YR 0x33f4 -+ #define XRAW_TO_X(x) (((x - MIN_XR)<=0?1:(x - MIN_XR)) * 0x3FFF / (MAX_XR - MIN_XR)) -+ #define YRAW_TO_Y(y) (((y - MIN_YR)<=0?1:(y - MIN_YR)) * 0x3FFF / (MAX_YR - MIN_YR)) -+ #define MIN_XC 0xc8 -+ #define MAX_XC 0xff78 -+ #define MIN_YC 0x0 -+ #define MAX_YC 0xff78 -+ #define XC_TO_X(x) (((x - MIN_XC)<=0?1:(x - MIN_XC)) * 0x3FFF / (MAX_XC - MIN_XC)) -+ #define YC_TO_Y(y) (((y - MIN_YC)<=0?1:(y - MIN_YC)) * 0x3FFF / (MAX_YC - MIN_YC)) -+ -+ stData = (struct tscrn_usb_data_report *)data; -+ if (!IS_TOUCHED(stData)) -+ { -+ /* -+ * finger-up event: this is usually offset a few pixels, -+ * so ignore this x and y values. And invalidate avg. -+ */ -+ upx = avgx; -+ upy = avgy; -+ GET_TIME(uptv); /* ready for the next finger-down */ -+ tv.tv_sec = 0; -+ state->buttons = 0; -+ avgx=-1; /* invalidate avg */ -+ return 0; -+ } -+ -+ /* based on compensated coordinates */ -+ //x = ((unsigned int)GET_XC(stData))>>2; -+ x = XC_TO_X(GET_XC(stData)); -+ if(x <= 0) x = 1; -+ if(x > 0x3fff) x = 0x3fff; -+ y = 0x3fff - YC_TO_Y(GET_YC(stData)); -+ //y = (0xffff - (unsigned int)(GET_YC(stData))>>2); -+ if(y <= 0) y = 1; -+ if(y > 0x3fff) y = 0x3fff; -+ /* based on X,Y raw coordinates */ -+ //x = XRAW_TO_X(GET_XR(stData)); -+ //if(x <= 0) x = 1; -+ //if(x > 0x3fff) x = 0x3fff; -+ //y = 0x3fff - YRAW_TO_Y(GET_YR(stData)); -+ //if(y <= 0) y = 1; -+ //if(y > 0x3fff) y = 0x3fff; -+ -+ //syslog(LOG_DEBUG,"coordinates Xc=%u Yc=%u",GET_XC(stData),GET_YC(stData)); -+ //syslog(LOG_DEBUG,"coordinates Xr=%u Yr=%u",GET_XR(stData),GET_YR(stData)); -+ //syslog(LOG_DEBUG," max X =%u Y =%u",win.ws_col,win.ws_row); -+ //syslog(LOG_DEBUG,"coordinates x =%u y =%u",x,y); -+ -+ if (avgx < 0) /* press event */ -+ { -+ GET_TIME(tv); -+ if (DIF_TIME(uptv, tv) < opt_time) -+ { -+ /* count as button press placed at finger-up pixel */ -+ state->buttons = GPM_B_LEFT; -+ realposx = avgx = upx; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = upy; state->y = REAL_TO_YCELL(realposy); -+ upx = (upx - x); /* upx and upy become offsets to use for this drag */ -+ upy = (upy - y); -+ return 0; -+ } -+ /* else, count as a new motion event */ -+ tv.tv_sec = 0; /* invalidate */ -+ realposx = avgx = x; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = y; state->y = REAL_TO_YCELL(realposy); -+ } -+ -+ state->buttons = 0; -+ if (tv.tv_sec) /* a drag event: use position relative to press */ -+ { -+ x += upx; -+ y += upy; -+ state->buttons = GPM_B_LEFT; -+ } -+ -+ realposx = avgx = (9*avgx + x)/10; state->x = REAL_TO_XCELL(realposx); -+ realposy = avgy = (9*avgy + y)/10; state->y = REAL_TO_YCELL(realposy); -+ -+ return 0; -+ -+ #undef XC_TO_X -+ #undef YC_TO_Y -+ #undef MIN_XC -+ #undef MAX_XC -+ #undef MIN_YC -+ #undef MAX_YC -+ #undef XRAW_TO_X -+ #undef YRAW_TO_Y -+ #undef MIN_XR -+ #undef MAX_XR -+ #undef MIN_YR -+ #undef MAX_YR -+ -+ #undef REAL_TO_XCELL -+ #undef REAL_TO_YCELL -+ #undef GET_TIME -+ #undef DIF_TIME -+} -+ - static int M_mtouch(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1768,6 +1894,15 @@ - return type; - } - -+static Gpm_Type *I_usbmt(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ //int i; -+ //for(i=0; i< argc; i++) -+ // syslog(LOG_DEBUG,"I_usbmt no=%d, val=%s",i,argv[i]); -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2042,6 +2177,11 @@ - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ -+ // usb touch-screen 12-06-2000 RGA -+ {"usbmt", "MicroTouch touch-screens usb (only button-1 events, by now)", -+ "", M_usbmt, I_usbmt, STD_FLG, -+ {0x01, 0x01, 0x00, 0x00}, 11, 1, 0, 1, 0}, - - {"", "", - "", NULL, NULL, 0, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/msuite.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/msuite.patch deleted file mode 100644 index f00fb065..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/msuite.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- gpm-1.18.1/gpm.h Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm.h Wed Jan 5 09:45:52 2000 -@@ -72,6 +72,13 @@ - - /*....................................... Cfg buttons */ - -+/* i think there are possible mouses with more, than 3 advanced buttons ? */ -+#define GPM_B_ADVANCED5 128 -+#define GPM_B_ADVANCED4 64 -+ -+#define GPM_B_ADVANCED3 32 -+#define GPM_B_ADVANCED2 16 -+#define GPM_B_ADVANCED1 8 - #define GPM_B_LEFT 4 - #define GPM_B_MIDDLE 2 - #define GPM_B_RIGHT 1 ---- gpm-1.18.1/gpm-root.y Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/gpm-root.y Wed Jan 5 09:45:52 2000 -@@ -214,6 +214,11 @@ - button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} -+ | T_BUTTON '4' {$$=GPM_B_ADVANCED1;} -+ | T_BUTTON '5' {$$=GPM_B_ADVANCED2;} -+ | T_BUTTON '6' {$$=GPM_B_ADVANCED3;} -+ | T_BUTTON '7' {$$=GPM_B_ADVANCED4;} -+ | T_BUTTON '8' {$$=GPM_B_ADVANCED5;} - ; - - menu: '{' {$$=cfgcurrent=cfg_alloc();} ---- gpm-1.18.1/gpm.c Fri Nov 12 15:27:36 1999 -+++ gpm-1.18.2/gpm.c Wed Jan 5 09:50:40 2000 -@@ -411,7 +411,8 @@ - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* propagate buttons */ -- nEvent.buttons = opt_sequence[nEvent.buttons]&7; /* change the order */ -+ nEvent.buttons = (nEvent.buttons & 0xf8) | /* 1111 1000 (mask for normal buttons) */ -+ opt_sequence[nEvent.buttons]&7; /* change the order */ - oldB=newB; newB=nEvent.buttons; - if (!i) event->buttons=nEvent.buttons; - ---- gpm-1.18.1/mice.c Fri Nov 12 15:27:37 1999 -+++ gpm-1.18.2/mice.c Wed Jan 5 09:46:24 2000 -@@ -74,6 +74,25 @@ - * The return value is the number of unprocessed bytes - */ - -+/* -+ * M_msuite function was written by Vadim V. Osikov aka Osa -+ * (osa@re.com.ua, http://re.com.ua/~osa) -+ */ -+ -+static int M_msuite(Gpm_Event *state, unsigned char *data) { -+ if ( data [1] == GPM_EXTRA_MAGIC_1 && data [2] == GPM_EXTRA_MAGIC_2 ) { -+ // advanced side buttons are D5 (lower) - D3 (higher) -+ state -> buttons |= ( ( data [0] & 7) << 3 ) ; -+ } else { -+ state -> buttons = ((data[0] & 0x20) >> 3) /* left */ -+ | ((data[0] & 0x10) >> 4); /* right */ -+ state -> dx = (char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); -+ state -> dy = (char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -+ // state -> dz = (signed char)((data [3] & 0xf) << 4) >> 4 ; -+ } -+ return 0 ; -+} -+ - static int M_ms(Gpm_Event *state, unsigned char *data) - { - /* -@@ -1436,6 +1455,9 @@ - */ - - Gpm_Type mice[]={ -+ {"msuite", "The MouseSuite 98 (side buttons and wheel) protocol.", -+ "", M_msuite, I_serial, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 4, 1, 1, 0}, - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/pnp.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/pnp.patch deleted file mode 100644 index 43664d10..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/pnp.patch +++ /dev/null @@ -1,562 +0,0 @@ -diff -uNrX gpm-ignore-files gpm-1.18.1/gpmInt.h gpm-1.18.1.eb1/gpmInt.h ---- gpm-1.18.1/gpmInt.h Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/gpmInt.h Sun Jan 30 00:30:04 2000 -@@ -67,6 +67,7 @@ - - int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ - /* itz Mon Jan 11 23:27:54 PST 1999 */ -+ char *pnp_names[10]; - } Gpm_Type; - - #define GPM_EXTRA_MAGIC_1 0xAA -Binary files gpm-1.18.1/hltest and gpm-1.18.1.eb1/hltest differ -diff -uNrX gpm-ignore-files gpm-1.18.1/mice.c gpm-1.18.1.eb1/mice.c ---- gpm-1.18.1/mice.c Fri Nov 12 07:27:37 1999 -+++ gpm-1.18.1.eb1/mice.c Sun Jan 30 03:19:45 2000 -@@ -1189,6 +1189,349 @@ - return type; - } - -+ -+/* The routines: -+ * pnpgets, pnpparse, & pnpproto are by Kazutaka YOKOTA, see below. -+ * -+ * This is code ripped almost directly out of X to enable automatic -+ * protocol selection in gpm. -+ * -+ * Eric Biederman 30 January 2000 -+ */ -+/* -+ * Copyright 1998 by Kazutaka YOKOTA -+ * -+ * Permission to use, copy, modify, distribute, and sell this software and its -+ * documentation for any purpose is hereby granted without fee, provided that -+ * the above copyright notice appear in all copies and that both that -+ * copyright notice and this permission notice appear in supporting -+ * documentation, and that the name of Kazutaka YOKOTA not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Kazutaka YOKOTA makes no representations -+ * about the suitability of this software for any purpose. It is provided -+ * "as is" without express or implied warranty. -+ * -+ * KAZUTAKA YOKOTA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL KAZUTAKA YOKOTA BE LIABLE FOR ANY SPECIAL, INDIRECT OR -+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -+ * PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+ -+static int pnpgets(int fd, char *buf) -+{ -+ struct termios tty; -+ fd_set fds; -+ struct timeval timeout; -+ int i; -+ char c; -+ -+ /* -+ * Just put the device to 1200 baud. Thanks to Francois Chastrette -+ * for his great help and debugging with his own pnp device. -+ */ -+ tcgetattr(fd, &tty); -+ -+ tty.c_iflag = IGNBRK | IGNPAR; -+ tty.c_oflag = 0; -+ tty.c_lflag = 0; -+ tty.c_line = 0; -+ tty.c_cc[VTIME] = 0; -+ tty.c_cc[VMIN] = 1; -+ tty.c_cflag = (CS7 | CREAD | CLOCAL | HUPCL) | B1200; -+ tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ -+ -+ /* toggle rts */ -+ ioctl(fd, TIOCMGET, &i); -+ i |= TIOCM_DTR; /* DTR = 1 */ -+ i &= ~TIOCM_RTS; /* RTS = 0 */ -+ ioctl(fd, TIOCMSET, &i); -+ usleep(200000); -+ -+ /* wait for response */ -+ tcflush(fd, TCIFLUSH); -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ -+ /* try to read something */ -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ goto connect_idle; -+ -+ /* collect PnP COM device ID (2.1.7) */ -+ i = 0; -+ usleep(200000); /* the mouse must send `Begin ID' within 200msec */ -+ -+ while (read(fd, &c, 1) != 0) { -+ /* we may see "M", or "M3..." before `Begin ID' */ -+ if ((c == 0x08) || (c == 0x28)) { /* Begin ID */ -+ buf[i++] = c; -+ break; -+ } -+ } -+ -+ if (i <= 0) { -+ /* we haven't seen `Begin ID' in time... */ -+ goto connect_idle; -+ } -+ -+ ++c; /* make it `End ID' */ -+ for (;;) { -+ FD_ZERO(&fds); -+ FD_SET(fd, &fds); -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 200000; -+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) -+ break; -+ -+ read (fd, &buf[i], 1); -+ if (buf[i++] == c) /* End ID */ -+ break; -+ if (i >= 256) -+ break; -+ } -+ if (buf[i -1] != c) -+ goto connect_idle; -+ return i; -+ -+ /* -+ * According to PnP spec, we should set DTR = 1 and RTS = 0 while -+ * in idle state. But, `moused' shall set DTR = RTS = 1 and proceed, -+ * assuming there is something at the port even if it didn't -+ * respond to the PnP enumeration procedure. -+ */ -+ disconnect_idle: -+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */ -+ ioctl(fd, TIOCMBIS, &i); -+ connect_idle: -+ return 0; -+} -+ -+/* serial PnP ID string */ -+typedef struct { -+ int revision; /* PnP revision, 100 for 1.00 */ -+ char *eisaid; /* EISA ID including mfr ID and product ID */ -+ char *serial; /* serial No, optional */ -+ char *class; /* device class, optional */ -+ char *compat; /* list of compatible drivers, optional */ -+ char *description; /* product description, optional */ -+ int neisaid; /* length of the above fields... */ -+ int nserial; -+ int nclass; -+ int ncompat; -+ int ndescription; -+} pnpid_t; -+ -+static int pnpparse(pnpid_t *id, char *buf, int len) -+{ -+ char s[3]; -+ int offset; -+ int sum = 0; -+ int i, j; -+ -+ id->revision = 0; -+ id->eisaid = NULL; -+ id->serial = NULL; -+ id->class = NULL; -+ id->compat = NULL; -+ id->description = NULL; -+ id->neisaid = 0; -+ id->nserial = 0; -+ id->nclass = 0; -+ id->ncompat = 0; -+ id->ndescription = 0; -+ -+ offset = 0x28 - buf[0]; -+ -+ /* calculate checksum */ -+ for (i = 0; i < len - 3; ++i) { -+ sum += buf[i]; -+ buf[i] += offset; -+ } -+ sum += buf[len - 1]; -+ for (; i < len; ++i) -+ buf[i] += offset; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP ID string: '%*.*s'\n", len, len, buf); -+ -+ /* revision */ -+ buf[1] -= offset; -+ buf[2] -= offset; -+ id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP rev %d.%02d\n", -+ id->revision / 100, id->revision % 100); -+ -+ /* EISA vender and product ID */ -+ id->eisaid = &buf[3]; -+ id->neisaid = 7; -+ -+ /* option strings */ -+ i = 10; -+ if (buf[i] == '\\') { -+ /* device serial # */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i - j == 8) { -+ id->serial = &buf[j]; -+ id->nserial = 8; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* PnP class */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->class = &buf[j]; -+ id->nclass = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* compatible driver */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == '\\') -+ break; -+ } -+ /* -+ * PnP COM spec prior to v0.96 allowed '*' in this field, -+ * it's not allowed now; just igore it. -+ */ -+ if (buf[j] == '*') -+ ++j; -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->compat = &buf[j]; -+ id->ncompat = i - j; -+ } -+ } -+ if (buf[i] == '\\') { -+ /* product description */ -+ for (j = ++i; i < len; ++i) { -+ if (buf[i] == ';') -+ break; -+ } -+ if (i >= len) -+ i -= 3; -+ if (i > j + 1) { -+ id->description = &buf[j]; -+ id->ndescription = i - j; -+ } -+ } -+ -+ /* checksum exists if there are any optional fields */ -+ if ((id->nserial > 0) || (id->nclass > 0) -+ || (id->ncompat > 0) || (id->ndescription > 0)) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP checksum: 0x%02X\n", sum); -+ sprintf(s, "%02X", sum & 0x0ff); -+ if (strncmp(s, &buf[len - 3], 2) != 0) { -+#if 0 -+ /* -+ * Checksum error!! -+ * I found some mice do not comply with the PnP COM device -+ * spec regarding checksum... XXX -+ */ -+ return 0; -+#endif -+ } -+ } -+ -+ return 1; -+} -+ -+static Gpm_Type *pnplookup(char *s, int len) -+{ -+ Gpm_Type *csr; -+ int index; -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP Looking up: %*.*s\n", len, len, s); -+ for(csr = mice; csr->fun; csr++) { -+ for(index = 0; csr->pnp_names[index]; index++) { -+ if (strncmp(csr->pnp_names[index], s, len) == 0) { -+ gpm_debug_log(LOG_DEBUG, "Mouse: PnP using: %*.*s\n", len, len, s); -+ return csr; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *pnpproto(pnpid_t *id) -+{ -+ Gpm_Type *type; -+ int i, j; -+ -+ if (id->nclass > 0) -+ if (strncmp(id->class, "MOUSE", id->nclass) != 0) -+ /* this is not a mouse! */ -+ return NULL; -+ -+ if (id->neisaid > 0) { -+ if (type = pnplookup(id->eisaid, id->neisaid)) { -+ return type; -+ } -+ } -+ -+ /* -+ * The 'Compatible drivers' field may contain more than one -+ * ID separated by ','. -+ */ -+ if (id->ncompat <= 0) -+ return NULL; -+ for (i = 0; i < id->ncompat; ++i) { -+ for (j = i; id->compat[i] != ','; ++i) -+ if (i >= id->ncompat) -+ break; -+ if (i > j) { -+ if (type = pnplookup(id->compat +j, i - j)) { -+ return type; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static Gpm_Type *I_pnp_auto(int fd, unsigned short flags, struct Gpm_Type *type) -+{ -+ int len; -+ char buf[256]; -+ pnpid_t pnpid; -+ int ret; -+ -+ ret = 0; -+ len = pnpgets(fd, buf); -+ -+ if (len) { -+ ret = pnpparse(&pnpid, buf, len); -+ } -+ if (ret == 0) { -+ return NULL; -+ } -+ -+ type = pnpproto(&pnpid); -+ if (type) { -+ type = type->init(fd, type->flags, type); -+ } -+ return type; -+} -+ -+ -+static int M_pnp_auto(Gpm_Event *state, unsigned char *data) -+{ -+ return -1; -+} -+ - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) - { -@@ -1438,84 +1781,126 @@ - Gpm_Type mice[]={ - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, {}}, - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ }}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, { -+ "PNP0F04", /* MouseSystems */ -+ "PNP0F05", /* MouseSystems */ -+ }}, - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, -- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -+ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, { -+ "LGI8001", /* Logitech serial */ -+ "PNP0F08", /* Logitech serial */ -+ "PNP0F17", /* Logitech compatible serial */ -+ }}, - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, NULL, STD_FLG, /* bm is sun */ -- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, { -+ "PNP0F00", /* MS bus */ -+ "PNP0F02", /* MS InPort */ -+ "PNP0F0D", /* MS InPort compatible */ -+ "PNP0F11", /* MS bus compatible */ -+ "PNP0F15", /* Logitech bus */ -+ "PNP0F18", /* Logitech bus compatible */ -+ }}, - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, NULL, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0, { -+ "PNP0F03", /* MS PS/2 */ -+ "PNP0F0E", /* MS PS/2 compatible */ -+ "PNP0F12", /* Logitech PS/2 */ -+ "PNP0F13", /* PS/2 */ -+ "PNP0F19", /* Logitech PS/2 compatible */ -+ }}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, -- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -+ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, {}}, - {"wacom", "Wacom graphire tablet: pen, mouse", - "", M_wacom, I_wacom, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 8, 8, 0, 0, 0, {}}, - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, -- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, {}}, - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, {}}, - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, {}}, -+ {"pnp+", "Plug and pray. New mice may not run with '-t ms'.", -+ "", M_ms_plus, I_pnp, CS7 | STD_FLG, -+ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, { -+ "KYEEZ00", /* Genius EZScroll */ -+ "KYE0001", /* Genius PnP Mouse */ -+ "PNP0F01", /* MS serial */ -+ "PNP0F09", /* MS BallPoint serial */ -+ "PNP0F0A", /* MS PnP serial */ -+ "PNP0F0B", /* MS PnP BallPoint serial */ -+ "PNP0F0C", /* MS serial comatible */ -+ "PNP0F0F", /* MS BallPoint compatible */ -+ }}, - {"imps2", "Microsoft Intellimouse (ps2) - 3 buttons, wheel unused", - "", M_ps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "MSH0001", /* MS IntelliMouse */ -+ "MSH0004", /* MS IntelliMouse TrackBall */ -+ "KYE0003", /* Genius NetMouse */ -+ "LGI800C", /* Logitech MouseMan (4 button model) */ -+ "LGI8050", /* Logitech MouseMan+ */ -+ "LGI8051", /* Logitech FirstMouse+ */ -+ }}, - {"netmouse", "Genius NetMouse - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, {}}, - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, {}}, - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -+ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, {}}, - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, -- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -+ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0, {}}, - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, -- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -+ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0, {}}, - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, {}}, - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, { -+ "KYE0002", -+ }}, - - #ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, -- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, -+ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0, {}}, - #endif - - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -@@ -1523,19 +1908,38 @@ - {0x98, 0x98, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, -- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, -+ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, {}}, - - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, -- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, -+ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, {}}, - - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, -- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, -+ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0, {}}, -+ -+ {"auto", "Automatic PNP mouse selection", -+ "", M_pnp_auto, I_pnp_auto, 0, -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {}}, - - {"", "", - "", NULL, NULL, 0, -- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -+ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, {NULL}} -+#if notyet -+ { -+ "KML0001", /* Kensignton ThinkingMouse */ -+ "PNP0F06", /* Genius Mouse */ -+ "PNP0F07", /* Genius Mouse */ -+ "PNP0F10", /* TI QuickPort */ -+ "PNP0F14", /* MS Kids Mouse */ -+ "PNP0F16", /* Logitech SWIFT */ -+ "PNP0F1A", /* Logitech SWIFT compatible */ -+ "PNP0F1B", /* HP Omnibook */ -+ "PNP0F1C", /* Compaq LTE TrackBall PS/2 */ -+ "PNP0F1D", /* Compaq LTE TrackBall serial */ -+ "PNP0F1E", /* MS Kids TrackBall */ -+ } -+#endif - }; - - /*------------------------------------------------------------------------*/ - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/pnp.reason b/software/gpm/browse_source/gpm-1.99.7/patches/todo/pnp.reason deleted file mode 100644 index 5afe12b7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/pnp.reason +++ /dev/null @@ -1,23 +0,0 @@ - -> Attached is a patch that takes this functionality from XFree86 and -> integrates it into gpm. And adds a mouse type specifically for this -> auto detection. - -I though a while about this, and I'd like to do it in another way, to -avoid clubbering the mouse table every so often. - -What I'd like to have is a "pnp.c" file, that includes the probing -functions as well as the table of pnp mouse types. Similarly to -synaptics and twiddler support, then, the functions in mice.c can call -the ones defined in pnp.c. - -The advantage of this is that there is no need to change the mouse -type data structure, and no need to add ID's of mice to the table of -types, which will quickly become exceedingly long. Moreover, having -the table of pnp ID's as an external object allows to export it to an -external text file, so that adding support for a new mouse type (a pnp -one) would be trivial: no more "plese try this patch, recompile and -tell us if it works" to ask to users, just "pleas add this line to -/etc/gpm-pnp.conf and try again". - -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/read/alps_touchpad b/software/gpm/browse_source/gpm-1.99.7/patches/todo/read/alps_touchpad deleted file mode 100644 index 1c96bd20..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/read/alps_touchpad +++ /dev/null @@ -1,211 +0,0 @@ -From - Wed Jun 6 23:37:30 2001 -Received: from localhost (rubini@localhost [127.0.0.1]) - by morgana.systemy.it (8.9.3/8.9.3/Debian/GNU) with ESMTP id XAA19571 - for ; Fri, 20 Oct 2000 23:39:21 +0200 -Received: from pop - by fetchmail-4.6.4 POP3 - for (single-drop); Fri, 20 Oct 2000 23:39:21 MEST -Received: from debye.prosa.it ([213.255.48.146]) by pop.systemy.it (8.8.8/8.8.3) with ESMTP id VAA03605 for ; Fri, 20 Oct 2000 21:10:11 +0200 -Received: by debye.prosa.it (Postfix) - id DBDB0BF70; Fri, 20 Oct 2000 21:07:30 +0200 (CEST) -Delivered-To: rubini@prosa.it -Received: from ns.prosa.it (ns.prosa.it [213.255.48.149]) - by debye.prosa.it (Postfix) with ESMTP - id CD41CBF6E; Fri, 20 Oct 2000 21:07:29 +0200 (CEST) -Received: from wien.prosa.it (localhost [127.0.0.1]) - by ns.prosa.it (Postfix) with ESMTP - id 3106EA75E2; Fri, 20 Oct 2000 21:10:05 +0200 (CEST) -Delivered-To: gpm@ns.prosa.it -Received: from debye.prosa.it (debye.prosa.it [213.255.48.146]) - by ns.prosa.it (Postfix) with ESMTP id 3B8A6A75D9 - for ; Fri, 20 Oct 2000 21:09:58 +0200 (CEST) -Received: by debye.prosa.it (Postfix) - id A7481BF70; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Delivered-To: gpm@prosa.it -Received: from penney.prosa.it (penney.prosa.it [213.255.48.131]) - by debye.prosa.it (Postfix) with ESMTP id 91269BF6E - for ; Fri, 20 Oct 2000 21:07:16 +0200 (CEST) -Received: from mercure.math.u-bordeaux.fr (mercure.math.u-bordeaux.fr [147.210.16.143]) - by penney.prosa.it (Postfix) with ESMTP id A51951B6007 - for ; Fri, 20 Oct 2000 21:09:56 +0200 (CEST) -Received: from math.u-bordeaux.fr (sadir.math.u-bordeaux.fr [147.210.16.221]) - by mercure.math.u-bordeaux.fr (8.9.3/8.9.1) with ESMTP id VAA11093 - for ; Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Received: (from allomber@localhost) - by math.u-bordeaux.fr (8.9.3+Sun/8.9.1) id VAA09151; - Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Date: Fri, 20 Oct 2000 21:09:55 +0200 (MET DST) -Message-Id: <200010201909.VAA09151@math.u-bordeaux.fr> -From: Bill Allombert -To: gpm@prosa.it -Cc: Bill.Allombert@math.u-bordeaux.fr -Subject: [Gpm] patch for ALPS Glidepoint. -Sender: gpm-admin@prosa.it -Errors-To: gpm-admin@prosa.it -X-BeenThere: gpm@lists.prosa.it -X-Mailman-Version: 2.0beta4 -Precedence: bulk -Reply-To: gpm@prosa.it -List-Id: -X-UIDL: 37cc9bf9ea94901361d200f5338c6e93 -Status: RO - -Hello, - -this is a patch for gpm 1.19.3. to handle ALPS GlidePoint in absolute -mode. It maps tap as left button and left button as middle -button. Drags finished because the finger is on the edge of the -touchpad are locked until the drag restart. - -The patch for gpm.c allows the glidepoint to revert to absolute mode -automatically, for example after a suspend. - -Best regards, - -Bill Allombert. - -allomber@math.u-bordaeux.fr - -------------- - -diff -u gpm-1.19.3.orig/gpm.c gpm-1.19.3/gpm.c ---- gpm-1.19.3.orig/gpm.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/gpm.c Thu Oct 19 22:36:31 2000 -@@ -341,12 +341,24 @@ - - if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) - { -- if (m_type->getextra) -+ if (m_type->getextra==1) - { - data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; - gpm_debug_log(LOG_DEBUG,"Extra %02x",data[0]); - return data; - } -+ /* Bill Allombert Thu Oct 19 20:25:12 UTC 2000 */ -+ /* allow touchpads to revert automatically to absolute mode */ -+ if (m_type->getextra==2 && (data[0]&0xc8)==0x08) -+ { -+ /*TouchPad has returned to relative mode...*/ -+ /*read the packet...*/ -+ read(fd,data,2); -+ /*revert to absolute mode*/ -+ m_type=(m_type->init)(fd, m_type->flags, m_type,-1,NULL); -+ gpm_debug_log(LOG_DEBUG,"gpm: touchpad returned to absolute.\n"); -+ return NULL; -+ }/*end*/ - gpm_debug_log(LOG_DEBUG,"Error in protocol"); - return NULL; - } -diff -u gpm-1.19.3.orig/mice.c gpm-1.19.3/mice.c ---- gpm-1.19.3.orig/mice.c Tue Mar 7 15:10:00 2000 -+++ gpm-1.19.3/mice.c Thu Oct 19 22:46:43 2000 -@@ -1280,6 +1280,65 @@ - return 0; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static int M_alps2(Gpm_Event *state, unsigned char *data) -+{ -+ /*driver for PS2 ALPS TouchPad in Advanced mode -+ (i.e. absolute x/y/z) -+ bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -+ byte 0:| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -+ byte 1:| 0 | X 6..0 | -+ byte 2:| 0 | X 10..7 | 0 | Finger | Gesture | -+ byte 3:| 0 | Y 9..7 | 1 |(Middle)| Right | Left | -+ byte 4:| 0 | Y 6..0 | -+ byte 5:| 0 | Z 6..0 | -+ */ -+ static int ox, oy, draglock=0, enter=0; -+ -+ long x = data[1] | ((data[2]&0x78)<<4); -+ long y = data[4] | ((data[3]&0x70)<<3); -+ long z = data[5]; -+ long tap = data[2]&1,finger=data[2]&2; -+ -+ if (!finger)/*leave touchpad*/ -+ { -+ state->dx = state->dy = 0; -+ /* if we are in the edges*/ -+ if (x<150 || y<150 || x>950 || y>700 ) -+ { -+ if (tap && ox==x && oy==y) -+ draglock=1; -+ } -+ else if (draglock) -+ { -+ draglock=0; -+ } -+ enter=0; -+ } -+ else if ( !enter ) /* enter touchpad */ -+ { -+ state->dx = state->dy = 0; -+ ox=x; oy=y; -+ enter=1; -+ } -+ else -+ { -+ /*resolution in 240 counts per inch*/ -+ /*geometry is normaly 47x31 mm */ -+ /*synaptic use roughly 6144 X counts ad reports 11%=676*/ -+ /*there is 47/25.4*240=444 counts here*/ -+ state->dx = (x-ox)/2; -+ state->dy = (y-oy)/2; -+ ox=x; oy=y; -+ } -+ if (draglock) tap=1; -+ state->buttons= -+ tap * GPM_B_LEFT + -+ ((data[3]&1)?GPM_B_MIDDLE:0) + -+ ((data[3]&2)?GPM_B_RIGHT:0); -+ return 0; -+} -+ - /*========================================================================*/ - /* Then, mice should be initialized */ - -@@ -1913,6 +1972,26 @@ - return type; - } - -+/* ALPS touchpad, ps2 version: Bill Allombert Thu Oct 19 20:19:54 UTC 2000 */ -+static Gpm_Type *I_alps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ int i; -+ unsigned char c = 0; -+ unsigned char magic[] = {0xf5, 0xf5, 0xf5, 0xf5, 0xf4}; -+ /* Switch to Advanced mode*/ -+ for (i=0; i\n",i,c); -+ return NULL; -+ } -+ } -+ return type; -+} -+ - /*========================================================================*/ - /* Finally, the table */ - #define STD_FLG (CREAD|CLOCAL|HUPCL) -@@ -2043,6 +2122,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"alps2", "ALPS PS2 GlidePoint", -+ "glidepoint_ps2", M_alps2, I_alps2, STD_FLG, -+ {0xff, 0xff, 0x00, 0x00}, 6, 1, 2, 0, 0}, - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} - -__ -Gpm mailing list at Gpm@lists.prosa.it -Send help as subject to gpm-request@lists.prosa.it for help -Archives at http://www.prosa.it/mailman/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/read/gpm.screen.unified.diff b/software/gpm/browse_source/gpm-1.99.7/patches/todo/read/gpm.screen.unified.diff deleted file mode 100644 index 2c982a23..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/read/gpm.screen.unified.diff +++ /dev/null @@ -1,108 +0,0 @@ -diff -uwr gpm-1.19.3.orig/liblow.c gpm-1.19.3/liblow.c ---- gpm-1.19.3.orig/liblow.c Tue Jul 18 14:06:06 2000 -+++ gpm-1.19.3/liblow.c Fri Dec 1 00:20:10 2000 -@@ -77,7 +77,8 @@ - unsigned char _gpm_buf[6*sizeof(short)]; - unsigned short * _gpm_arg = (unsigned short *)_gpm_buf +1; - --int gpm_consolefd=-1; /* used to invoke ioctl() */ -+enum { GPM_FD_INVALID = -1, GPM_FD_SCREEN = -2 }; -+int gpm_consolefd = GPM_FD_INVALID; /* used to invoke ioctl() */ - int gpm_morekeys=0; - /*-------------------------------------------------------------------*/ - static inline int putdata(int where, Gpm_Connect *what) -@@ -114,7 +115,14 @@ - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /*if*/ -- if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { -+ if (GPM_FD_SCREEN == gpm_consolefd) { -+ /* TODO: */ -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } else if (gpm_consolefd <= 0) -+ /* safety check */ -+ return; -+ else if (ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /*if*/ - if (!win.ws_col || !win.ws_row) { -@@ -177,7 +185,7 @@ - /*-------------------------------------------------------------------*/ - int Gpm_Open(Gpm_Connect *conn, int flag) - { -- char tty[32]; -+ char tty[64]; - char *term; - int i; - struct sockaddr_un addr; -@@ -236,13 +244,40 @@ - if (!t) goto err; - strcpy(tty,t); - if (strncmp(tty,"/dev/tty",8) || !isdigit(tty[8])) -+ { -+ char* sty = getenv("STY"); -+ /* as set by SCREEN, e.g -+ * STY=417.tty1.kristine -+ * ^hostname -+ */ -+ if (sty) -+ { -+ /* STY is set. Check, if it has a valid form */ -+ int n, vc; -+ if (strlen(sty) >= sizeof tty -+ || 3 != sscanf(sty, "%d.tty%d.%s", &n, &vc, tty)) -+ goto err; -+ else -+ { -+ /* we're inside a SCREEN session. Don't connect to -+ * the tty as below. TODO: how can we get lines -+ * and columns from SCREEN ? */ -+ gpm_consolefd = GPM_FD_SCREEN; -+ conn->vc = vc; -+ win.ws_col = 80; -+ win.ws_row = 25; -+ } -+ } -+ else - goto err; -+ } -+ else - conn->vc=atoi(tty+8); - } - else /* a default handler -- use console */ - sprintf(tty,"/dev/tty0"); - -- if (gpm_consolefd==-1) -+ if (gpm_consolefd == GPM_FD_INVALID) /* NOT called for SCREEN */ - if ((gpm_consolefd=open(tty,O_WRONLY))<0) - { - gpm_debug_log(LOG_ERR,"%s: %s",tty,strerror(errno)); -@@ -254,6 +289,7 @@ - - /*....................................... Get screen dimensions */ - -+ if (gpm_consolefd != GPM_FD_SCREEN) /* NOT called for SCREEN */ - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if (!win.ws_col || !win.ws_row) -@@ -395,7 +431,7 @@ - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); - #endif - close(gpm_consolefd); -- gpm_consolefd=-1; -+ gpm_consolefd = GPM_FD_INVALID; - return 0; - } - -diff -uwr gpm-1.19.3.orig/special.c gpm-1.19.3/special.c ---- gpm-1.19.3.orig/special.c Mon Jan 17 22:34:00 2000 -+++ gpm-1.19.3/special.c Fri Dec 1 00:19:05 2000 -@@ -26,6 +26,7 @@ - - /* This file is compiled conditionally, see the Makefile */ - -+#include /* OPEN_MAX */ - #include - #include - #include diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/reinit.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/reinit.patch deleted file mode 100644 index 692610c7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/reinit.patch +++ /dev/null @@ -1,233 +0,0 @@ -Only in gpm-1.17.9.mod: MODIFIED -diff -u gpm-1.17.9/README gpm-1.17.9.mod/README ---- gpm-1.17.9/README Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/README Fri Jan 21 20:55:49 2000 -@@ -268,3 +268,6 @@ - - Edmund Grimley Evans (edmund@vocalis.com) - Added "-t ms+lr" -+George Staikos (staikos@0wned.org) -+ Added support for auto-reinitialise of mouse. -+ -Common subdirectories: gpm-1.17.9/doc and gpm-1.17.9.mod/doc -diff -u gpm-1.17.9/gpm.c gpm-1.17.9.mod/gpm.c ---- gpm-1.17.9/gpm.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpm.c Fri Jan 21 20:50:40 2000 -@@ -60,7 +60,7 @@ - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }, - }; -@@ -404,7 +404,7 @@ - if ( ((data=getMouseData(fd,m_type,kd_mode))==NULL) - || ((*(m_type->fun))(&nEvent,data)==-1) ) - { -- if (!i) return 0; -+ if (!i) return -1; - else break; - } - -@@ -865,27 +865,17 @@ - unlink(GPM_NODE_CTL); - } - --/*-------------------------------------------------------------------*/ --int main(int argc, char **argv) --{ -- int ctlfd, newfd; -- struct sockaddr_un ctladdr; -- int i, len, kd_mode, fd; -- struct timeval timeout; -- int maxfd=-1; -- int pending; -- Gpm_Event event; - -- prgname=argv[0]; -- setuid(0); /* just in case... */ -- --/*....................................... parse command line */ -+/* -+ * Moved the initialization code in here so we can reuse it if -+ * the auto-reinit flag is set and the mouse is unplugged on us. -+ * -+ * George Staikos - Jan 21/2000 -+ */ - -- cmdline(argc, argv); -- atexit(gpm_exited); -+static inline int initMouse(int i, int *fd, int *maxfd) -+{ - -- for (i=1; i <= 1+opt_double; i++) -- { - which_mouse=mouse_table+i; /* used to access options */ - - /* open the device with ndelay, to catch a locked device */ -@@ -893,22 +883,22 @@ - { - if (!strcmp(opt_dev,"-")) - fd=0; -- else if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ else if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - else /* use "/dev/mouse" */ - { - opt_dev = "/dev/mouse"; -- if ((fd=open(opt_dev,O_RDWR | O_NDELAY))<0) -+ if ((*fd=open(opt_dev,O_RDWR | O_NDELAY))<0) - { oops(opt_dev); } - } - - /* and then reset the flag */ -- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); -+ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); - - /* init the device, and change mouse type */ - if (m_type->init) -- m_type=(m_type->init)(fd, m_type->flags, m_type); -+ m_type=(m_type->init)(*fd, m_type->flags, m_type); - if (!m_type) - { oops("mouse initialization failed"); } - -@@ -916,13 +906,39 @@ - { - unsigned int modem_lines; - -- ioctl(fd, TIOCMGET, &modem_lines); -+ ioctl(*fd, TIOCMGET, &modem_lines); - modem_lines &= ~opt_toggle; -- ioctl(fd, TIOCMSET, &modem_lines); -+ ioctl(*fd, TIOCMSET, &modem_lines); - } - -- which_mouse->fd=fd; -- maxfd=max(fd, maxfd); -+ which_mouse->fd=*fd; -+ *maxfd=max(*fd, *maxfd); -+} -+ -+ -+ -+/*-------------------------------------------------------------------*/ -+int main(int argc, char **argv) -+{ -+ int ctlfd, newfd; -+ struct sockaddr_un ctladdr; -+ int i, len, kd_mode, fd; -+ struct timeval timeout; -+ int maxfd=-1; -+ int pending; -+ Gpm_Event event; -+ -+ prgname=argv[0]; -+ setuid(0); /* just in case... */ -+ -+/*....................................... parse command line */ -+ -+ cmdline(argc, argv); -+ atexit(gpm_exited); -+ -+ for (i=1; i <= 1+opt_double; i++) -+ { -+ initMouse(i, &fd, &maxfd); - } /*for*/ - - /*....................................... catch interesting signals */ -@@ -1055,8 +1071,10 @@ - which_mouse=mouse_table+i; /* used to access options */ - if (FD_ISSET(which_mouse->fd,&selSet)) - { -+ int rc; - FD_CLR(which_mouse->fd,&selSet); pending--; -- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) -+ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode); -+ if (rc > 0) - /* - * pass it to the client, if any - * or to the default handler, if any -@@ -1065,6 +1083,16 @@ - (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) - || (cinfo[0] && do_client(cinfo[0], &event)) - || do_selection(&event); -+ else if ((rc == -1) && opt_auto_reinit) { -+ /* try to reinitialise the mouse */ -+ gpm_debug_log(LOG_WARNING, -+ "Mouse was removed. Trying to reinitialise.\n"); -+ FD_CLR(which_mouse->fd, &selSet); -+ close(which_mouse->fd); -+ initMouse(i, &fd, &maxfd); -+ FD_CLR(which_mouse->fd, &selSet); -+ } -+ } else { - } - } - -diff -u gpm-1.17.9/gpmInt.h gpm-1.17.9.mod/gpmInt.h ---- gpm-1.17.9/gpmInt.h Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/gpmInt.h Fri Jan 21 20:19:38 2000 -@@ -87,6 +87,7 @@ - char *opt_type, *opt_dev, *opt_sequence; - int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; - int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; -+ int opt_auto_reinit; - Gpm_Type *m_type; - int fd; - }; -@@ -110,7 +111,8 @@ - #define opt_toggle (which_mouse->opt_toggle) - #define opt_glidepoint_tap \ - (which_mouse->opt_glidepoint_tap) -- -+#define opt_auto_reinit \ -+ (which_mouse->opt_auto_reinit) - #define m_type (which_mouse->m_type) - - /* the other variables */ -diff -u gpm-1.17.9/gpn.c gpm-1.17.9.mod/gpn.c ---- gpm-1.17.9/gpn.c Fri Aug 6 01:35:33 1999 -+++ gpm-1.17.9.mod/gpn.c Fri Jan 21 20:13:18 2000 -@@ -212,7 +212,8 @@ - " Use a non-existent type (e.g. \"help\") to get a list\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" -- " -V verbosity increase number of logged messages\n", -+ " -V verbosity increase number of logged messages\n" -+ " -y automatically reinitialize when unplugged\n", - DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, - DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -@@ -296,7 +297,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TyvV::23"; - int i, opt; - FILE *f; - static struct {char *in; char *out;} seq[] = { -@@ -374,6 +375,7 @@ - break; - case 't': opt_type=optarg; break; - case 'T': opt_test++; break; -+ case 'y': opt_auto_reinit++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -diff -u gpm-1.17.9/mouse-test.c gpm-1.17.9.mod/mouse-test.c ---- gpm-1.17.9/mouse-test.c Fri Aug 6 01:35:34 1999 -+++ gpm-1.17.9.mod/mouse-test.c Fri Jan 21 20:18:57 2000 -@@ -54,7 +54,7 @@ - struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, DEF_SCALE /*scaley*/, -- DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, -+ DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_TOGGLE, DEF_GLIDEPOINT_TAP, 0, - (Gpm_Type *)NULL - }; - -Common subdirectories: gpm-1.17.9/sample and gpm-1.17.9.mod/sample diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff b/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff deleted file mode 100644 index bf6827fd..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-owl-gpm-root.diff +++ /dev/null @@ -1,499 +0,0 @@ -diff -urN gpm-1.19.6.orig/conf/gpm-root.conf gpm-1.19.6/conf/gpm-root.conf ---- gpm-1.19.6.orig/conf/gpm-root.conf Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/conf/gpm-root.conf Sat Oct 6 04:48:34 2001 -@@ -18,7 +18,7 @@ - "tty 8" f.jptty "8" - "" f.nop - "more of them..." { -- -+ - "tty 9" f.jptty "9" - "tty 10" f.jptty "10" - "tty 11" f.jptty "11" -@@ -33,7 +33,6 @@ - "tty 17" f.jptty "17" - } - } -- - } - - button 2 { -@@ -47,12 +46,10 @@ - "%b %d %Y" f.time - "%H:%M" f.time - "" f.nop -- "load: " f.load -+ "load: " f.load - "free:" f.free - "" f.nop -- "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" -- "print mail headers to tty" f.bgcmd -- "grep '^From ' /var/spool/mail/$USER | tail" -+ "report disk usage to ~/du" f.bgcmd "du ~ | sort -rn > ~/du" - } - - button 3 { -diff -urN gpm-1.19.6.orig/doc/doc.gpm.in gpm-1.19.6/doc/doc.gpm.in ---- gpm-1.19.6.orig/doc/doc.gpm.in Thu Oct 4 01:35:54 2001 -+++ gpm-1.19.6/doc/doc.gpm.in Sat Oct 6 04:48:34 2001 -@@ -135,7 +135,6 @@ - - As of release 0.96, a default-handler is released with gpm, and can be - used to handle Control-Mouse events to draw menus on the screen. --The @code{gpm-root} program, however, needs kernel 1.1.73 or newer. - @xref{gpm-root}. - - Release 1.00 has been an incompatible one (is is incompatible with -@@ -1945,17 +1944,9 @@ - - The program @code{gpm-root} is designed to handle Control-Mouse events to - draw menus on the background of the current tty. The actual menus --are described by a configuration file in the user's home directory. -- --Please note that @code{gpm-root} needs to run with Linux 1.1.73 or --newer, because previous kernels lack some screen handling capabilities --required by the program. -+are described by the configuration file, @file{/etc/gpm-root.conf}. - - The program uses the files @file{/dev/vcs*} to draw to the console screen. --These are available only from kernel 1.1.81 onward. If you miss those --device nodes, you should create them using @code{create_vcs} in the --distribution directory. The tool won't run with kernels older than 1.1.81, --because they lacked a full screen dump/restore capability. - - Available command line options are the following: - -@@ -1966,14 +1957,6 @@ - Allowed strings are @samp{shift}, @samp{anyAlt}, @samp{leftAlt}, - @samp{rightAlt}, @samp{control}. - --@item -u -- Deny using user-specific configuration files. With this -- option on, only @file{/etc/gpm-root.conf} will be used as a source -- of configuration information. This option -- is intended for those system administrators who fear security could -- be broken by this daemon. Things should be sufficiently secure, but -- if you find a hole please tell me about it. -- - @item -D - Do not automatically enter background operation when started, - and log messages to the standard error stream, not the syslog -@@ -2172,9 +2155,8 @@ - - %M .SH BUGS - --Known bugs have been fixed. In particular, if you invoke @code{gpm-root} --right after @code{gpm}, it will delay a few seconds before trying to connect --to the daemon. -+Anyone with access to the console may cause @code{gpm-root} to run any of -+the commands given in @file{/etc/gpm-root.conf} as root. - - @ignore - .SH AUTHOR -@@ -2184,7 +2166,6 @@ - .nf - /dev/gpmctl The socket used to connect to gpm. - /etc/gpm-root.conf The default configuration file. --$(HOME)/.gpm-root The user configuration file. - /dev/vcs* Virtual Console Screens - .fi - -diff -urN gpm-1.19.6.orig/src/Makefile.in gpm-1.19.6/src/Makefile.in ---- gpm-1.19.6.orig/src/Makefile.in Tue Oct 2 18:26:25 2001 -+++ gpm-1.19.6/src/Makefile.in Sat Oct 6 04:57:41 2001 -@@ -20,7 +20,7 @@ - - # Main portion: regular build rules - --GSRC = gpm.c gpn.c mice.c special.c twiddler.c synaptics.c -+GSRC = closeall.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c - - GOBJ = $(GSRC:.c=.o) debuglog.o devfs.o - -@@ -73,6 +73,7 @@ - mouse-test: mice.o twiddler.o synaptics.o - - $(PROG): libgpm.a -+gpm-root: closeall.o - - libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ -@@ -86,13 +87,12 @@ - - STRIP = -s - --install: check -+install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm -+ $(INSTALL_PROGRAM) gpm-root $(sbindir)/gpm-root - $(INSTALL_DATA) -m 644 libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h -- for i in mev gpm-root; do \ -- $(INSTALL_PROGRAM) $$i $(bindir)/$$i ;\ -- done -+ $(INSTALL_PROGRAM) mev $(bindir)/mev - $(INSTALL_PROGRAM) disable-paste $(bindir)/disable-paste - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional -diff -urN gpm-1.19.6.orig/src/closeall.c gpm-1.19.6/src/closeall.c ---- gpm-1.19.6.orig/src/closeall.c Thu Jan 1 03:00:00 1970 -+++ gpm-1.19.6/src/closeall.c Sat Oct 6 04:48:34 2001 -@@ -0,0 +1,27 @@ -+#include -+#include -+ -+#ifdef __linux__ -+#include -+#endif -+ -+int close_all(void) -+{ -+ int fd, max; -+ -+ max = sysconf(_SC_OPEN_MAX); -+ if (max <= 0) -+ return -1; -+ -+#ifdef __linux__ -+ if (max < NR_OPEN) -+ max = NR_OPEN; -+#endif -+ -+ for (fd = 3; fd < max; fd++) { -+ if (close(fd) && errno != EBADF) -+ return -1; -+ } -+ -+ return 0; -+} -diff -urN gpm-1.19.6.orig/src/gpm-root.y gpm-1.19.6/src/gpm-root.y ---- gpm-1.19.6.orig/src/gpm-root.y Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpm-root.y Sat Oct 6 04:50:11 2001 -@@ -26,8 +26,6 @@ - - %{ - --static char rcsid[] = "$Id: gpm-1.19.6-owl-gpm-root.diff,v 1.2 2002/05/28 19:13:57 nico Exp $"; -- - #include - #include - #include -@@ -64,6 +62,8 @@ - #define VCS_MAJOR 7 - #endif - -+extern int close_all(void); -+ - #define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - - #include "headers/gpmInt.h" /* itz Thu Aug 13 14:10:26 PDT 1998 -@@ -78,6 +78,7 @@ - #include "headers/wd.h" /* when debugging macros */ - - #define USER_CFG ".gpm-root" -+#undef USER_CFG - #define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - - #define DEFAULT_FORE 7 -@@ -117,7 +118,9 @@ - /* provide defaults */ - int opt_mod = 4; /* control */ - int opt_buf = 0; /* ask the kernel about it */ -+#ifdef USER_CFG - int opt_user = 1; /* allow user cfg files */ -+#endif - - - -@@ -134,7 +137,7 @@ - typedef struct Draw { - short width; /* length of longest item */ - short height; /* the number of items */ -- short uid; /* owner */ -+ int uid; /* owner */ - short buttons; /* which button */ - short fore,back,bord,head; /* colors */ - char *title; /* name */ -@@ -321,10 +324,18 @@ - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ i++; - } -- - /* get '"' as '\"' */ -- while (s[i++]!='\"' && s[i-2] !='\\') -+ while (s[i-1]!='\"' && (i < 2 || s[i-2]!='\\')) - ; - s[i-1]=0; yylval.string=(char *)strdup(s); return T_STRING; - -@@ -342,7 +353,17 @@ - } - /* get a single word and convert it */ - do -- s[i++]=c; -+ { -+ if (i>=sizeof(s)-1) -+ { -+ yyerror("line too long"); -+ if (s[i]!='\n') -+ while ((c=getc(cfgfile))!='\n' && c!=EOF); -+ cfglineno++; -+ break; -+ } -+ s[i++]=c; -+ } - while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; -@@ -447,9 +468,10 @@ - /*====================================================================*/ - void f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ if (setgid(pass->pw_gid) < 0 || -+ initgroups(pass->pw_name, pass->pw_gid) < 0 || -+ setuid(pass->pw_uid) < 0) -+ exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -@@ -525,7 +547,6 @@ - /*---------------------------------------------------------------------*/ - int f_bgcmd(int mode, DrawItem *self, int uid) - { -- int i; - struct passwd *pass; - - switch (mode) -@@ -545,10 +566,11 @@ - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); -- open("/dev/null",O_RDONLY); /* stdin */ -- open("/dev/tty0",O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - -@@ -683,22 +705,18 @@ - FILE *f; - double l1,l2,l3; - -- l1=l2=l3=0.0; -- - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+20); -- self->name=realloc(self->name,strlen(self->name)+20); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2f %5.2f %5.2f"); -- sprintf(self->name,self->clientdata,l1,l2,l3); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+3*20); - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); -- sprintf(self->name,self->clientdata,l1,l2,l3); -+ sprintf(self->name,"%s %5.2f %5.2f %5.2f", -+ (char *)self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: -@@ -714,24 +732,20 @@ - long l1,l2; - char s[80]; - -- l1=l2=0; - switch (mode) - { - case F_CREATE: /* modify name, just to fake its length */ -- self->clientdata=malloc(strlen(self->name)+30); -- self->name=realloc(self->name,strlen(self->name)+30); -- strcpy(self->clientdata,self->name); -- strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); -- sprintf(self->name,self->clientdata,(double)l1,(double)l2); -- break; -+ /* XXX: no failure checks */ -+ self->clientdata=strdup(self->name); -+ self->name=realloc(self->name,strlen(self->name)+2*30); - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; -- fgets(s,80,f); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); -- fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); -- sprintf(self->name,self->clientdata, -- (double)l1/1024/1024,(double)l2/1024/1024); -+ fgets(s,sizeof(s),f); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l1); -+ fgets(s,sizeof(s),f); sscanf(s,"%*s %*s %*s %ld",&l2); -+ sprintf(self->name,"%s %5.2fM mem + %5.2fM swap", -+ (char *)self->clientdata,(double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: -@@ -751,6 +765,7 @@ - { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; -+ /* XXX: "format features" */ - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); -@@ -832,20 +847,25 @@ - /* the return value tells whether it has been newly loaded or not */ - int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) - { -+#ifdef USER_CFG - struct passwd *pass; -+#endif - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_debug_log(LOG_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); -+#ifdef USER_CFG - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) - { -+#endif - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); -+#ifdef USER_CFG - } - else - { -@@ -853,6 +873,7 @@ - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } -+#endif - - if (stat(cfgname,&buf)==-1) - { -@@ -926,7 +947,9 @@ - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" -+#ifdef USER_CFG - " -u inhibit user configuration files\n" -+#endif - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); -@@ -972,12 +995,18 @@ - int opt; - - gpm_log_daemon = 1; -+#ifdef USER_CFG - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) -+#else -+ while ((opt = getopt(argc, argv,"m:DV::")) != -1) -+#endif - { - switch (opt) - { - case 'm': opt_mod=getmask(optarg, tableMod); break; -+#ifdef USER_CFG - case 'u': opt_user=0; break; -+#endif - case 'D': gpm_log_daemon = 0; break; - case 'V': - gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); -@@ -1201,10 +1230,9 @@ - int evflag; - int recursenow=0; /* not on first iteration */ - -- prgname=argv[0]; -- setuid(0); /* if we're setuid, force it */ -+ prgname = argv[0] ?: "gpm-root"; - -- if (getuid()) -+ if (getuid() != 0 || getuid() != geteuid()) - { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); -@@ -1285,7 +1313,13 @@ - } - if (!vc) - { -- oops("can't open mouse connection"); -+ fprintf(stderr,"%s: Can't open mouse connection\n",prgname); -+ exit (1); -+ } -+ if (gpm_fd == -2) -+ { -+ fprintf(stderr,"%s: Can't run in an xterm or rxvt\n",prgname); -+ exit(2); - } - - conn.eventMask=~0; /* grab everything away form selection */ -@@ -1325,6 +1359,7 @@ - - /*....................................... Loop */ - -+ posty = 0; - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} -diff -urN gpm-1.19.6.orig/src/special.c gpm-1.19.6/src/special.c ---- gpm-1.19.6.orig/src/special.c Tue Oct 2 18:48:54 2001 -+++ gpm-1.19.6/src/special.c Sat Oct 6 04:48:34 2001 -@@ -38,6 +38,8 @@ - - #include "headers/gpmInt.h" - -+extern int close_all(void); -+ - /* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event -@@ -67,7 +69,7 @@ - */ - int processSpecial(Gpm_Event *event) - { -- char *command=NULL; int i; -+ char *command=NULL; - FILE *consolef; - - if ((event->type & GPM_TRIPLE) -@@ -152,10 +154,11 @@ - - case 0: /* child */ - close(0); close(1); close(2); -- open(GPM_NULL_DEV,O_RDONLY); /* stdin */ -- open(consolename,O_WRONLY); /* stdout */ -- dup(1); /* stderr */ -- for (i=3;i /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - @} - - button 3 @{ -diff -ur gpm-1.19.6.orig/doc/gpm.info gpm-1.19.6/doc/gpm.info ---- gpm-1.19.6.orig/doc/gpm.info Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpm.info Fri Oct 5 08:48:17 2001 -@@ -1626,7 +1626,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/doc/gpmdoc.ps gpm-1.19.6/doc/gpmdoc.ps ---- gpm-1.19.6.orig/doc/gpmdoc.ps Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.ps Fri Oct 5 08:48:17 2001 -@@ -3466,7 +3466,7 @@ - 2190 y("")477 b(f.nop)430 2294 y("load:)46 b(")191 b(f.load)430 - 2398 y("free:")237 b(f.free)430 2501 y("---------")45 - b(f.nop)430 2605 y("disk)h(usage")g(f.bgcmd)94 b("du)47 --b(|)g(sort)g(-rn)g(>)g(/tmp/du")334 2709 y(})334 2916 -+b(|)g(sort)g(-rn)g(>)g(/var/run/du")334 2709 y(})334 2916 - y(button)g(3)g({)430 3020 y(name)g("jump")430 3228 y(foreground)e - (black)430 3332 y(background)g(red)430 3435 y(border)h(bright)g(yellow) - 430 3539 y(head)h(bright)f(yellow)430 3747 y("tty1")94 -diff -ur gpm-1.19.6.orig/doc/gpmdoc.txt gpm-1.19.6/doc/gpmdoc.txt ---- gpm-1.19.6.orig/doc/gpmdoc.txt Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/doc/gpmdoc.txt Fri Oct 5 08:48:17 2001 -@@ -1589,7 +1589,7 @@ - "load: " f.load - "free:" f.free - "---------" f.nop -- "disk usage" f.bgcmd "du | sort -rn > /tmp/du" -+ "disk usage" f.bgcmd "du | sort -rn > /var/run/du" - } - - button 3 { -diff -ur gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c ---- gpm-1.19.6.orig/src/gpn.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/gpn.c Fri Oct 5 09:00:00 2001 -@@ -224,16 +224,17 @@ - static void - check_uniqueness(void) - { -- static char tmp_pidfile[64]; -+ char tmp_pidfile[64]; - int fd; - FILE* fp = 0; - -- strncpy (tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", 63); -+ tmp_pidfile[0] = '\0'; -+ strncat(tmp_pidfile, GPM_NODE_DIR "gpmXXXXXX", sizeof(tmp_pidfile) - 1); - - if ((fd = mkstemp(tmp_pidfile)) == -1) { - oops("mkstemp()"); - } -- if ((fp = fdopen(fd,"w")) != NULL) { -+ if ((fp = fdopen(fd, "w")) != NULL) { - fprintf(fp,"%d\n",getpid()); - fclose(fp); - } else if (getuid()) { diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff b/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff deleted file mode 100644 index 18467283..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-owl-warnings.diff +++ /dev/null @@ -1,211 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 04:45:26 2001 -@@ -1144,9 +1144,9 @@ - * or to the default handler, if any - * or to the selection handler - */ /* FIXME -- check event.vc */ -- (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) -- || (cinfo[0] && do_client(cinfo[0], &event)) -- || do_selection(&event); -+ if (!(cinfo[event.vc] && do_client(cinfo[event.vc], &event))) -+ if (!(cinfo[0] && do_client(cinfo[0], &event))) -+ do_selection(&event); - } - } - -diff -ur gpm-1.19.6.orig/src/libcurses.c gpm-1.19.6/src/libcurses.c ---- gpm-1.19.6.orig/src/libcurses.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/libcurses.c Sat Oct 6 04:45:26 2001 -@@ -93,7 +93,7 @@ - /* JD patch 11/08/1998 */ - #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; -- extern gpm_convert_event(char *data, Gpm_Event *event); -+ extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - /* JD patch 11/08/1998 */ -diff -ur gpm-1.19.6.orig/src/liblow.c gpm-1.19.6/src/liblow.c ---- gpm-1.19.6.orig/src/liblow.c Tue Oct 2 00:08:47 2001 -+++ gpm-1.19.6/src/liblow.c Sat Oct 6 04:45:26 2001 -@@ -529,7 +529,7 @@ - #define DELAY_MS 100 - static struct timeval to={0,DELAY_MS*1000}; - static fd_set selSet; -- extern gpm_convert_event(unsigned char *data, Gpm_Event *event); -+ int gpm_convert_event(unsigned char *data, Gpm_Event *event); - int c; unsigned char mdata[4]; - - if (nbprevchar) /* if there are some consumed char ... */ -diff -ur gpm-1.19.6.orig/src/mice.c gpm-1.19.6/src/mice.c ---- gpm-1.19.6.orig/src/mice.c Thu Sep 27 16:50:29 2001 -+++ gpm-1.19.6/src/mice.c Sat Oct 6 04:45:26 2001 -@@ -50,7 +50,7 @@ - #include - #include - #include --#include -+#include - #include - - #include -@@ -665,10 +665,10 @@ - int treshold; - } wcmodell[] = { - /* ModellName Magic MaxX MaxY Border Tresh */ -- "UltraPad" , "UD", 0, 0, 250, 20, -- /* "Intuos" , "GD", 0, 0, 0, 20, not yet supported */ -- "PenPartner", "CT", 0, 0, 0, 20, -- "Graphire" , "ET", 5103, 3711, 0, 20 -+ {"UltraPad" , "UD", 0, 0, 250, 20}, -+ /*{"Intuos" , "GD", 0, 0, 0, 20}, not yet supported */ -+ {"PenPartner", "CT", 0, 0, 0, 20}, -+ {"Graphire" , "ET", 5103, 3711, 0, 20} - }; - - #define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) -@@ -1687,7 +1687,8 @@ - - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_imps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) - { - int id; - static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -diff -ur gpm-1.19.6.orig/src/synaptics.c gpm-1.19.6/src/synaptics.c ---- gpm-1.19.6.orig/src/synaptics.c Sun Sep 23 23:00:03 2001 -+++ gpm-1.19.6/src/synaptics.c Sat Oct 6 04:46:45 2001 -@@ -182,11 +182,12 @@ - { 0, No_Action } /* flag value */ - }; - -+#if 0 - static corner_action_type *upper_left_action = &corner_actions [0]; - static corner_action_type *lower_left_action = &corner_actions [1]; - static corner_action_type *upper_right_action = &corner_actions [2]; - static corner_action_type *lower_right_action = &corner_actions [3]; -- -+#endif - - /* - ** These types are used to read the configuration data from the config file. -@@ -212,43 +213,43 @@ - - static param_data_type param_data [] = { - /* enabling configuration parameters */ -- { "edge_motion_enabled", Flag_Param, &edge_motion_enabled }, -- { "edge_motion_speed_enabled", Flag_Param, &edge_motion_speed_enabled }, -- { "corner_taps_enabled", Flag_Param, &corner_taps_enabled }, -- { "taps_enabled", Flag_Param, &taps_enabled }, -- { "pressure_speed_enabled", Flag_Param, &pressure_speed_enabled }, -- { "tossing_enabled", Flag_Param, &tossing_enabled }, -- { "does_toss_use_static_speed", Flag_Param, &does_toss_use_static_speed }, -+ { "edge_motion_enabled", Flag_Param, {&edge_motion_enabled} }, -+ { "edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled} }, -+ { "corner_taps_enabled", Flag_Param, {&corner_taps_enabled} }, -+ { "taps_enabled", Flag_Param, {&taps_enabled} }, -+ { "pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled} }, -+ { "tossing_enabled", Flag_Param, {&tossing_enabled} }, -+ { "does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - /* pressure induced speed related configuration parameters */ -- { "low_pressure", Integer_Param, &low_pressure }, -- { "speed_up_pressure", Integer_Param, &speed_up_pressure }, -- { "pressure_factor", Float_Param, &pressure_factor }, -- { "standard_speed_factor", Float_Param, &standard_speed_factor }, -+ { "low_pressure", Integer_Param, {&low_pressure} }, -+ { "speed_up_pressure", Integer_Param, {&speed_up_pressure} }, -+ { "pressure_factor", Float_Param, {&pressure_factor} }, -+ { "standard_speed_factor", Float_Param, {&standard_speed_factor} }, - /* toss/catch related parameters */ -- { "min_toss_time", Integer_Param, &min_toss_time }, -- { "max_toss_time", Integer_Param, &max_toss_time }, -- { "toss_cleanup_time", Integer_Param, &toss_cleanup_time }, -- { "min_toss_dist", Integer_Param, &min_toss_dist }, -- { "static_toss_speed", Integer_Param, &static_toss_speed }, -- { "toss_speed_factor", Float_Param, &toss_speed_factor }, -+ { "min_toss_time", Integer_Param, {&min_toss_time} }, -+ { "max_toss_time", Integer_Param, {&max_toss_time} }, -+ { "toss_cleanup_time", Integer_Param, {&toss_cleanup_time} }, -+ { "min_toss_dist", Integer_Param, {&min_toss_dist} }, -+ { "static_toss_speed", Integer_Param, {&static_toss_speed} }, -+ { "toss_speed_factor", Float_Param, {&toss_speed_factor} }, - /* edge motion related configuration parameters */ -- { "edge_speed", Integer_Param, &edge_speed }, -+ { "edge_speed", Integer_Param, {&edge_speed} }, - /* corner tap actions */ -- { "upper_left_action", Corner_Param, &corner_actions [0] }, -- { "lower_left_action", Corner_Param, &corner_actions [1] }, -- { "upper_right_action", Corner_Param, &corner_actions [2] }, -- { "lower_right_action", Corner_Param, &corner_actions [3] }, -+ { "upper_left_action", Corner_Param, {&corner_actions [0]} }, -+ { "lower_left_action", Corner_Param, {&corner_actions [1]} }, -+ { "upper_right_action", Corner_Param, {&corner_actions [2]} }, -+ { "lower_right_action", Corner_Param, {&corner_actions [3]} }, - /* use wmode */ -- { "use_wmode", Flag_Param, &use_wmode }, -- { "finger_threshold", Integer_Param, &finger_threshold }, -- { "tap_lower_limit", Integer_Param, &tap_lower_limit }, -- { "tap_upper_limit", Integer_Param, &tap_upper_limit }, -- { "tap_range", Integer_Param, &tap_range }, -- { "tap_interval", Integer_Param, &tap_interval }, -- { "drag_lock", Flag_Param, &drag_lock }, -- { "multiple_click_delay", Integer_Param, &multiple_click_delay }, -+ { "use_wmode", Flag_Param, {&use_wmode} }, -+ { "finger_threshold", Integer_Param, {&finger_threshold} }, -+ { "tap_lower_limit", Integer_Param, {&tap_lower_limit} }, -+ { "tap_upper_limit", Integer_Param, {&tap_upper_limit} }, -+ { "tap_range", Integer_Param, {&tap_range} }, -+ { "tap_interval", Integer_Param, {&tap_interval} }, -+ { "drag_lock", Flag_Param, {&drag_lock} }, -+ { "multiple_click_delay", Integer_Param, {&multiple_click_delay} }, - /* end of list */ -- { NULL, Flag_Param, NULL } -+ { NULL, Flag_Param, {NULL} } - }; - - -@@ -1080,6 +1081,7 @@ - } - } - -+#if 0 - /* write 'cmd' to mode byte 1 */ - static void ps2_set_mode1(int fd, - byte cmd) -@@ -1088,6 +1090,7 @@ - ps2_putbyte(fd, 0xF3); - ps2_putbyte(fd, 0x0A); - } -+#endif - - /* write 'cmd' to mode byte 2 */ - static void ps2_set_mode2(int fd, -@@ -1155,6 +1158,7 @@ - cap->cap_palm_detect = check_bits (bytes[2], 0x01); - } - -+#if 0 - /* read the modes from the touchpad (in ps/2 format) */ - static void read_ps2_modes (int fd) - { -@@ -1165,6 +1169,7 @@ - gpm_debug_log (LOG_DEBUG,"PS/2 modes: %02X", bytes [2]); - #endif - } -+#endif - - /* Translate the reported data into a record for processing */ - static void syn_translate_ps2_report (unsigned char *data, -@@ -1229,9 +1234,6 @@ - static int drag_locked = 0; - - if (((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { -- unsigned int w = ((data[3] & 0x04) >> 2) | -- ((data[0] & 0x04) >> 1) | -- ((data[0] & 0x30) >> 2); - report->left = check_bits (data[0], 0x01); - report->middle = check_bits (data[0] ^ data[3], 0x01); - report->down = check_bits (data[0] ^ data[3], 0x02); diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff b/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff deleted file mode 100644 index 027de4ff..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/solar_patches/gpm-1.19.6-rh-owl-socket-mode.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur gpm-1.19.6.orig/src/gpm.c gpm-1.19.6/src/gpm.c ---- gpm-1.19.6.orig/src/gpm.c Tue Oct 2 00:02:25 2001 -+++ gpm-1.19.6/src/gpm.c Sat Oct 6 03:27:06 2001 -@@ -1030,10 +1030,10 @@ - len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL); - if (bind(ctlfd,(struct sockaddr *)(&ctladdr),len)==-1) - oops(ctladdr.sun_path); -- maxfd=max(maxfd,ctlfd); -+ maxfd=max(maxfd,ctlfd); - -- /* needs to be 0777, so all users can _try_ to access gpm */ -- chmod(GPM_NODE_CTL,0777); -+ if (chmod(GPM_NODE_CTL,0600)==-1) -+ oops(GPM_NODE_CTL); - - /*....................................... get screen dimensions */ - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/suvil-gpm-patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/suvil-gpm-patch deleted file mode 100644 index 1aa4f914..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/suvil-gpm-patch +++ /dev/null @@ -1,143 +0,0 @@ ---- ../original-gpm-1.19.2/mice.c Tue Mar 7 15:10:00 2000 -+++ mice.c Wed Jun 14 12:36:42 2000 -@@ -305,7 +305,6 @@ - return 0; - } - -- - /* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ - static int R_summa(Gpm_Event *state, int fd) - { -@@ -332,7 +331,55 @@ - return write(fd,buffer,5); - } - -+/* Suvil Penbrush Professional tablet support absolute mode*/ -+/* Summagraphics MM-Series format*/ -+/* (Grzegorz Adam Hankiewicz) gradha@iname.com Wed Jun 14 11:32:27 CEST 2000 */ -+int suvilmaxx,suvilmaxy; -+static int M_suvil (Gpm_Event *state, unsigned char *data) -+{ -+ int x, y; -+ -+ x = data[2] * 128 + data[1]; -+ y = data[4] * 128 + data[3]; -+ -+ if (x >= suvilmaxx) x = suvilmaxx; -+ if (y >= suvilmaxy) y = suvilmaxy; -+ -+ state->x = x * win.ws_col / suvilmaxx; -+ state->y = 1 + y * win.ws_row / suvilmaxy; -+ -+ realposx = x * REALPOS_MAX / suvilmaxx; -+ realposy = y * REALPOS_MAX / suvilmaxy; -+ -+ state->buttons = -+ !!(data[0]&1) * GPM_B_LEFT + -+ !!(data[0]&2) * GPM_B_RIGHT + -+ !!(data[0]&4) * GPM_B_MIDDLE; - -+ return 0; -+} -+ -+/* Wed Jun 14 11:32:27 CEST 2000 gradha@iname.com */ -+static int R_suvil(Gpm_Event *state, int fd) -+{ -+ signed char buffer[5]; -+ static int x, y; -+ -+ buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1:0) + -+ ((state->buttons & GPM_B_MIDDLE) > 0 ? 2:0) + -+ ((state->buttons & GPM_B_RIGHT) > 0 ? 3:0); -+ -+ x = realposx * suvilmaxx / REALPOS_MAX ; y = realposy; -+ -+ buffer[1] = x & 0x7f; -+ buffer[2] = (x >> 7) & 0x7f; -+ buffer[3] = y & 0x7f; -+ buffer[4] = (y >> 7) & 0x7f; -+ -+ -+ -+ return write (fd, buffer, 5); -+} - - /* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ - static int M_geni(Gpm_Event *state, unsigned char *data) -@@ -1768,6 +1815,57 @@ - return type; - } - -+static Gpm_Type *I_suvil(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ char byte; -+ char config[5]; -+ -+ #define SUVIL_SP66 0x06 -+ -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ setspeed (fd, 1200, 1200, 1, B1200|CS7|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ write (fd, 0, 1); /* Reset */ -+ usleep (400000); /* wait */ -+ -+ /* First try setting tablet to tablet mode */ -+ write (fd, "X", 1); -+ usleep (3000); -+ -+ /* Now set stablet speed to 9600 */ -+ setspeed (fd, 1200, 9600, 1, B9600|CS8|CREAD|CLOCAL|HUPCL|PARENB|PARODD); -+ -+ /* Set tablet to not report coordinates and ask model */ -+ write (fd, "D?", 2); -+ usleep (3000); -+ read (fd, &byte, 1); -+ -+ switch (byte) -+ { -+ case 'S': -+ case SUVIL_SP66: -+ byte = SUVIL_SP66; -+ /* Set upper left origin and read maximum resolution range */ -+ write (fd, "ba", 2); -+ read (fd, config, 5); -+ -+ suvilmaxx = config[2]*128+config[1]; -+ suvilmaxy = config[4]*128+config[3]; -+ -+ /* Finally set tablet to report absolute coordinates in stream mode */ -+ write (fd, "I!@", 3); -+ break; -+ -+ default: -+ /* Don't support this model */ -+ return NULL; -+ break; -+ } -+ -+ return type; -+} -+ - static Gpm_Type *I_mtouch(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv) - { -@@ -2043,6 +2141,9 @@ - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, - -+ {"suvil", "Suvil Penbrush Professional (sp-66)", "", M_suvil, I_suvil, STD_FLG, -+ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_suvil}, -+ - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} -@@ -2068,7 +2169,7 @@ - } - - -- -+ - /* - * Use 4 as indent-level. It used to be 2, but new stuff will be inserted - * using 4. diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/suvil-gpm-patch.readme b/software/gpm/browse_source/gpm-1.99.7/patches/todo/suvil-gpm-patch.readme deleted file mode 100644 index ad290419..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/suvil-gpm-patch.readme +++ /dev/null @@ -1 +0,0 @@ -Support for a new graphic tablet. Lokks good to me. diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/xfree4.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/xfree4.patch deleted file mode 100644 index 46b21cc4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/xfree4.patch +++ /dev/null @@ -1,202 +0,0 @@ -Index: doc/doc.gpm ---- doc/doc.gpm.orig Fri Mar 17 00:10:01 2000 -+++ doc/doc.gpm Fri Mar 17 00:15:51 2000 -@@ -398,6 +398,11 @@ - behaviour of @file{selection-1.7}, but it is sometimes confusing. - The default is not to show the pointer, which can be confusing as well. - -+@item -P -+ Use a pty as repeater device instead of a fifo, see @samp{-R}. -+ @file{/dev/gpmdata} will be a symbolic link to the pty. -+ XFree86 4.0 seems to need this. -+ - @item -q - Quit after changing mouse behaviour. This is intended to allow - users to change the mouse @emph{feeling} (@samp{-a}, @samp{-B}, @samp{-d}, -@@ -414,15 +419,17 @@ - - @item -R @var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while -- in graphic mode will be produced on the fifo @file{/dev/gpmdata} -- in protocol @var{name}. In principle, you can use the same -+ in graphic mode will be produced on the fifo (or symlink, see the -+ @samp{-P} option) @file{/dev/gpmdata} in protocol @var{name}. -+ In principle, you can use the same - names as for the @samp{-t} option, although repeating into some - protocols may not be implemented for a while. @xref{Mouse Types}. - In addition, you can specify @samp{raw} as the @var{name}, to repeat - the mouse data byte by byte, without any protocol translation. - If @var{name} is omitted, it defaults to @samp{msc}. - Using @i{gpm} in repeater mode, you can configure the X -- server to use its fifo as a mouse device. This option is useful for -+ server to use @file{/dev/gpmdata} as a mouse device. -+ This option is useful for - bus-mouse owners to override the single-open limitation. It is also - an easy way to manage those stupid dual-mode mice which force you - to keep the middle button down while changing video mode. The option -Index: gpn.c ---- gpn.c.orig Thu Mar 16 23:42:00 2000 -+++ gpn.c Fri Mar 17 00:20:19 2000 -@@ -45,6 +45,10 @@ - #include - #endif - -+#ifdef HAVE_PTY_H -+#include -+#endif -+ - #ifndef HAVE___U32 - typedef unsigned int __u32; - #endif -@@ -315,11 +319,68 @@ - return type; - } - -+#ifdef HAVE_OPENPTY -+#include -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ int master; -+ int ret = openpty(&master, ttyfd, ttyName, 0, 0); -+ -+ return (ret == 0 ? master : ret); -+} -+ -+#else /* HAVE_OPENPTY */ -+ -+static const char* major = "pqrstuvwxyzabcde"; -+static const char* minor = "0123456789abcdef"; -+ -+static int -+find_pty(int* ttyfd, char ttyName[]) -+{ -+ char ptempl[] = "/dev/ptyXX"; -+ char ttempl[] = "/dev/ttyXX"; -+ int fd = -1; -+ const char* map; -+ const char* mip; -+ -+ for (map = major; *map && fd == -1; map++) -+ { -+ ptempl[8] = *map; -+ ttempl[8] = *map; -+ for (mip = minor; *mip && fd == -1; mip++) -+ { -+ int fd2; -+ ptempl[9] = *mip; -+ ttempl[9] = *mip; -+ -+#ifndef O_NOCTTY -+#define O_NOCTTY 0 -+#endif -+ if ((fd = open(ptempl, O_RDWR)) != -1 && -+ (fd2 = open(ttempl, O_RDWR|O_NOCTTY)) != -1) -+ { -+ *ttyfd = fd2; -+ strcpy(ttyName, ttempl); -+ } -+ else -+ { -+ close(fd); -+ fd = -1; -+ } -+ } -+ } -+ -+ return fd; -+} -+#endif /* HAVE_OPENPTY */ -+ - /*===================================================================*/ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pPqr:R::s:S:t:TvV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -369,6 +430,7 @@ - which_mouse=mouse_table+2; break; - case 'o': opt_options = optarg; break; - case 'p': opt_ptrdrag=0; break; -+ case 'P': opt_ptyrep=1; break; - case 'q': opt_quit++; gpm_log_daemon = 0; break; - case 'r': - /* being called responsiveness, I must take the inverse */ -@@ -411,10 +473,24 @@ - } - if (opt_repeater) - { -- if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -- { oops(GPM_NODE_FIFO); } -- if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -- { oops(GPM_NODE_FIFO); } -+ if (opt_ptyrep) -+ { -+ char tty_name[32]; -+ int ttyfd; -+ -+ if ((fifofd=find_pty(&ttyfd,tty_name))==-1) -+ { oops("can't find free pty"); } -+ unlink(GPM_NODE_FIFO); -+ if (symlink(tty_name,GPM_NODE_FIFO)==-1) -+ { oops(GPM_NODE_FIFO); } -+ } -+ else -+ { -+ if (mkfifo(GPM_NODE_FIFO,0666) && errno!=EEXIST) -+ { oops(GPM_NODE_FIFO); } -+ if ((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK))<0) -+ { oops(GPM_NODE_FIFO); } -+ } - } - - -Index: configure.in ---- configure.in.orig Thu Mar 16 23:15:40 2000 -+++ configure.in Thu Mar 16 23:40:33 2000 -@@ -64,7 +64,7 @@ - CURSES_OBJS=libcurses.o ; fi ;; - esac - --AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h) -+AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h pty.h) - - ITZ_CHECK_TYPE(__u32,linux/types.h) - if test ${itz_cv_type___u32} = yes || test ${ac_cv_type___u32} = yes ; then -@@ -78,7 +78,8 @@ - SHLIB= - fi - --AC_CHECK_FUNCS(vsyslog syslog) -+AC_CHECK_LIB(util, openpty) -+AC_CHECK_FUNCS(openpty vsyslog syslog) - AC_FUNC_ALLOCA - - case $with_curses in -Index: gpmInt.h ---- gpmInt.h.orig Thu Mar 16 23:47:30 2000 -+++ gpmInt.h Thu Mar 16 23:48:13 2000 -@@ -128,6 +128,7 @@ - extern time_t opt_age_limit; - extern char *opt_special; - extern int opt_rawrep; -+extern int opt_ptyrep; - extern int fifofd; - extern char *consolename; /* the selected one */ - -Index: gpm.c ---- gpm.c.orig Thu Mar 16 23:48:34 2000 -+++ gpm.c Thu Mar 16 23:49:11 2000 -@@ -79,6 +79,7 @@ - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ - int opt_rawrep=0; -+int opt_ptyrep=0; - Gpm_Type *repeated_type=0; - - char *consolename = "/dev/tty0"; - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/xterm-mouse-for-console.patch b/software/gpm/browse_source/gpm-1.99.7/patches/todo/xterm-mouse-for-console.patch deleted file mode 100644 index 3ed33e3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/xterm-mouse-for-console.patch +++ /dev/null @@ -1,186 +0,0 @@ - * xterm-style mouse reporting with "gpm" - * -------------------------------------- - * - * With this patch, programs on the text console can use the mouse without - * using "libgpm" by requesting to get mouse reports such as button click - * events in xterm style (see "man 4 console_codes"). - * - * To let the 'ncurses' library take advantage of it, one has to add the - * 'kmous' capability from xterm to the LINUX console terminfo description. - * Recent ncurses versions (5.0) will then use it. - * - * The usual select and copy mechanism of gpm is still available by pressing - * the CNTRL button while using the mouse. Only the SHIFT and ALT key can - * be used as modifiers as described in the xterm interface. - * - * A patched terminal description "linux-mouse.tic" is included. Use command - * tic linux-mouse.tic - * to install it. Setting "TERM=linux-mouse" will switch to it. One can also - * substitute the original "TERM=linux" description with it. It will not - * cause any harm (in case you are still using an unpatched "gpm" or not using - * the mouse at all). - * - * Advantages: - * - There is no need for "libgpm" support in the ncurses library anymore. - * IMHO ncurses could ship with the patched terminfo description for the - * console and libgpm support could be removed. - * - Simplified interface to mouse (i. e. same as xterm). - * - * Internals: - * gpm will be made to query the status of the kernel 'mouse_report' variable - * before updating selection. If mouse_report is set, gpm tells the kernel to - * issue the xterm escape sequence to the program. - * - * Joerg Schoen 6/2000 - * - * This patch is under the GNU whatever-is-appropriate-here license. - * - * I can be reached via "JoergSchoen@maf.org". ONLY text emails please! - * -diff -Naur gpm.c gpm.c ---- gpm.c Fri Nov 12 14:27:36 1999 -+++ gpm.c Sun Jun 4 20:44:14 2000 -@@ -41,6 +41,14 @@ - #include /* KDGETMODE */ - #include /* winsize */ - -+#include /* to use KG_SHIFT and so on */ -+ -+/* These two flags in event->modifiers are used to -+ * signal mouse tracking for this console. -+ */ -+#define MOUSE_REPORT 0x40 -+#define MOUSE_REPORT2 0x80 -+ - #include "gpmInt.h" - - #ifndef max -@@ -166,8 +174,15 @@ - if ((fd=open_console(O_WRONLY))<0) - oops("open_console"); - gpm_debug_log(LOG_DEBUG,"ctl %i, mode %i",(int)*buf, arg[4]); -- if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) -- oops("ioctl(TIOCLINUX)"); -+ if (ioctl(fd, TIOCLINUX, buf+sizeof(short)-1) < 0) { -+ /* If we ask the kernel to report a mouse event (mode & 16), it -+ * could be that mouse report mode was switched off meanwhile, -+ * resulting in EINVAL. Just ignore it in this case. -+ */ -+ if(!((mode & 16) && errno == EINVAL)) -+ oops("ioctl(TIOCLINUX)"); -+ } -+ - close(fd); - - if (mode < 3) { -@@ -200,11 +215,58 @@ - } - - /*-------------------------------------------------------------------*/ -+static inline int do_mousereport(Gpm_Event *event) -+{ -+ int x2,y2,mode; -+ -+ x2=event->x; y2=event->y; -+ if (x2<1) x2++; else if (x2>maxx) x2--; -+ if (y2<1) y2++; else if (y2>maxy) y2--; -+ -+ switch(GPM_BARE_EVENTS(event->type)) { -+ case GPM_MOVE: -+ case GPM_DRAG: -+ selection_copy(x2,y2,x2,y2,3); /* just highlight pointer */ -+ return 0; -+ case GPM_DOWN: -+ switch (event->buttons) { -+ case GPM_B_LEFT: mode = 0; break; -+ case GPM_B_MIDDLE: mode = 1; break; -+ case GPM_B_RIGHT: mode = 2; break; -+ default: -+ /* FIXME: Is that the right thing to do? */ -+ return 0; -+ } -+ break; -+ case GPM_UP: -+ /* Don't report button up in report mode 1 */ -+ if(!(event->modifiers & MOUSE_REPORT2)) return 0; -+ mode = 3; -+ break; -+ } -+ -+ if(event->modifiers & (1<modifiers & ((1<modifiers & ((1<x; y2=event->y; - switch(GPM_BARE_EVENTS(event->type)) - { -@@ -506,6 +568,18 @@ - event->modifiers=6; /* code for the ioctl */ - if (ioctl(i,TIOCLINUX,&(event->modifiers))<0) - oops("get_shift_state"); -+ -+ /* Get also state of mouse_report */ -+ { -+ char report_state = 7; -+ -+ if(ioctl(i,TIOCLINUX,&report_state) < 0) oops("get_mouse_report"); -+ -+ if(report_state) -+ event->modifiers |= report_state == 2 ? -+ (MOUSE_REPORT|MOUSE_REPORT2) : MOUSE_REPORT; -+ } -+ - close(i); - event->modifiers |= j; /* add mouse-specific bits */ - event->vc = stat.v_active; -diff -Naur linux-mouse.tic linux-mouse.tic ---- linux-mouse.tic Thu Jan 1 01:00:00 1970 -+++ linux-mouse.tic Sun Jun 4 20:34:33 2000 -@@ -0,0 +1,29 @@ -+linux-mouse|linux console with mouse support in xterm style, -+ am, bce, eo, mir, msgr, xenl, xon, -+ colors#8, it#8, ncv#18, pairs#64, -+ acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, -+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, -+ clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M, -+ csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, -+ cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E[?25h\E[?0c, -+ dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, -+ dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, -+ flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, -+ ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, -+ il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, -+ kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, -+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, -+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, -+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, -+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D, -+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, -+ kmous=\E[M, -+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z, -+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, -+ rmacs=\E[10m, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m, -+ rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm, -+ setaf=\E[3%p1%dm, -+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, -+ sgr0=\E[m, smacs=\E[11m, smir=\E[4h, smpch=\E[11m, -+ smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, -+ u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/xterm-mouse-for-console.patch.readme b/software/gpm/browse_source/gpm-1.99.7/patches/todo/xterm-mouse-for-console.patch.readme deleted file mode 100644 index 3e25ac9d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/xterm-mouse-for-console.patch.readme +++ /dev/null @@ -1,2 +0,0 @@ -documentation is inside. Looks good to me -/alessandro diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 deleted file mode 100644 index 57190c1a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/002_force_repeat_000 +++ /dev/null @@ -1,102 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:32:26 2001 -@@ -79,6 +79,7 @@ - int opt_ptrdrag=DEF_PTRDRAG; - int opt_kill=0; - int opt_repeater=0, opt_double=0; -+int opt_force_repeat = 0; - char* opt_repeater_type = 0; - int opt_aged = 0; - char *opt_special=NULL; /* special commands, like reboot or such */ -@@ -379,7 +380,8 @@ - do - { - j=read(fd,edata-i,i); /* edata is pointer just after data */ -- if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) -+ if ((kd_mode!=KD_TEXT || opt_force_repeat) -+ && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata-i, j); - i-=j; - } -@@ -499,7 +501,7 @@ - - /*....................................... we're a repeater, aren't we? */ - -- if (kd_mode!=KD_TEXT) -+ if ((kd_mode!=KD_TEXT) || opt_force_repeat) - { - if (fifofd != -1 && ! opt_rawrep) - { -@@ -1127,17 +1129,16 @@ - * but actually it only matters if you have events. - */ - { -- int fd = open_console(O_RDONLY); -- if (ioctl(fd, KDGETMODE, &kd_mode)<0) -- oops("ioctl(KDGETMODE)"); -- close(fd); -- if (kd_mode != KD_TEXT && !opt_repeater) -- { -- wait_text(&mouse_table[1].fd); -- maxfd=max(maxfd,mouse_table[1].fd); -- readySet=connSet; -- FD_SET(mouse_table[1].fd,&readySet); -- continue; /* reselect */ -+ int fd = open_console(O_RDONLY); -+ if (ioctl(fd, KDGETMODE, &kd_mode)<0) -+ oops("ioctl(KDGETMODE)"); -+ close(fd); -+ if (kd_mode != KD_TEXT && !opt_repeater && !opt_force_repeat) { -+ wait_text(&mouse_table[1].fd); -+ maxfd=max(maxfd,mouse_table[1].fd); -+ readySet=connSet; -+ FD_SET(mouse_table[1].fd,&readySet); -+ continue; /* reselect */ - } - } - /*....................................... got mouse, process event */ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:32:33 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:32:26 2001 -@@ -172,6 +172,7 @@ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" -+ " -F Force always in repeat mode..\n" - " -s sample-rate sets the sample rate (default %d)\n" - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" -@@ -291,7 +292,7 @@ - int - cmdline(int argc, char **argv) - { -- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:TveV::23"; -+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23"; - int i, opt; - static struct {char *in; char *out;} seq[] = { - {"123","01234567"}, -@@ -356,6 +357,12 @@ - opt_repeater_type = "msc"; - } /*if*/ - break; -+ case 'F': -+ opt_force_repeat = 1; -+ opt_repeater++; -+ if (0 == opt_repeater_type) -+ opt_repeater_type = "msc"; -+ break; - case 's': opt_sample = atoi(optarg); break; - case 'S': - if (optarg) opt_special=optarg; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Sep 20 16:56:25 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:32:26 2001 -@@ -171,6 +171,7 @@ - extern int opt_test, opt_ptrdrag; - extern int opt_kill; - extern int opt_repeater, opt_double; -+extern int opt_force_repeat; - extern char* opt_repeater_type; - extern int opt_kernel, opt_explicittype; - extern int opt_aged; diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/003_wheel_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/003_wheel_000 deleted file mode 100644 index b1a79a28..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/003_wheel_000 +++ /dev/null @@ -1,144 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm.c gpm-1.19.5/src/gpm.c ---- gpm-1.19.5.orig/src/gpm.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/gpm.c Thu Oct 4 23:33:37 2001 -@@ -446,6 +446,7 @@ - else - { - event->dx=event->dy=0; -+ event->wdx=event->wdy=0; - - nEvent.modifiers = 0; /* some mice set them */ - FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; -@@ -488,6 +489,10 @@ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } -+ -+ /* propagate wheel */ -+ event->wdx += nEvent.wdx; -+ event->wdy += nEvent.wdy; - - select(fd+1,&fdSet,(fd_set *)NULL,(fd_set *)NULL,&timeout/* zero */); - } -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpm.h gpm-1.19.5/src/headers/gpm.h ---- gpm-1.19.5.orig/src/headers/gpm.h Wed Sep 12 17:07:34 2001 -+++ gpm-1.19.5/src/headers/gpm.h Thu Oct 4 23:33:37 2001 -@@ -115,6 +115,7 @@ - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - short dx, dy, x, y; -+ short wdx, wdy; - enum Gpm_Etype type; - int clicks; - enum Gpm_Margin margin; -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:33:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:33:37 2001 -@@ -359,16 +359,49 @@ - /* m$ 'Intellimouse' (steveb 20/7/97) */ - static int M_ms3(Gpm_Event *state, unsigned char *data) - { -+ state->wdx = state->wdy = 0; -+ - state->buttons= ((data[0] & 0x20) >> 3) /* left */ - | ((data[3] & 0x10) >> 3) /* middle */ - | ((data[0] & 0x10) >> 4); /* right */ - state->dx= (signed char)(((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy= (signed char)(((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); -- /* wheel (dz??) is (data[3] & 0x0f) */ -+ -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } - - return 0; - } - -+static int R_ms3(Gpm_Event *state, int fd) -+{ -+ char buf[4] = {0, 0, 0, 0}; -+ -+ buf[0] |= 0x40; -+ -+ buf[0] |= ((state->buttons & GPM_B_LEFT) ? 0x20 : 0); -+ buf[3] |= ((state->buttons & GPM_B_MIDDLE) ? 0x10 : 0); -+ buf[0] |= ((state->buttons & GPM_B_RIGHT) ? 0x10 : 0); -+ -+ buf[1] = state->dx & ~0xC0; -+ buf[0] |= (state->dx & 0xC0) >> 6; -+ -+ buf[2] = state->dy & ~0xC0; -+ buf[0] |= (state->dy & 0xC0) >> 4; -+ -+ if (state->wdy > 0) -+ buf[3] |= 0x0f; -+ else if (state->wdy < 0) -+ buf[3] |= 0x01; -+ -+ return write(fd,buf,4); -+} -+ -+ - /* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ - static int M_brw(Gpm_Event *state, unsigned char *data) - { -@@ -499,6 +532,39 @@ - return 0; - } - -+static int M_imps2(Gpm_Event *state, unsigned char *data) -+{ -+ static int tap_active=0; // there exist glidepoint ps2 mice -+ state->wdx = state->wdy = 0; // Clear them.. -+ -+ state->dx = state->dy = state->wdx = state->wdy = 0; -+ -+ state->buttons= ((data[0] & 1) << 2) // left -+ | ((data[0] & 6) >> 1); // middle and right -+ -+ if (data[0]==0 && opt_glidepoint_tap) // by default this is false -+ state->buttons = tap_active = opt_glidepoint_tap; -+ else if (tap_active) { -+ if (data[0]==8) -+ state->buttons = tap_active = 0; -+ else state->buttons = tap_active; -+ } -+ -+ // Standard movement.. -+ state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; -+ state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; -+ -+ // The wheels.. -+ switch (data[3] & 0x0f) { -+ case 0x0e: state->wdx = +1; break; -+ case 0x02: state->wdx = -1; break; -+ case 0x0f: state->wdy = +1; break; -+ case 0x01: state->wdy = -1; break; -+ } -+ -+ return 0; -+} -+ - static int M_netmouse(Gpm_Event *state, unsigned char *data) - { - /* Avoid this beasts if you can. They connect to normal PS/2 port, -@@ -2096,14 +2162,14 @@ - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -- "", M_ps2, I_imps2, STD_FLG, -+ "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, -- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, -+ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 deleted file mode 100644 index dad4faaa..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/004_priv_elevation_000 +++ /dev/null @@ -1,47 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpm-root.y gpm-1.19.5/src/gpm-root.y ---- gpm-1.19.5.orig/src/gpm-root.y Sat Sep 15 17:17:19 2001 -+++ gpm-1.19.5/src/gpm-root.y Thu Oct 4 23:34:39 2001 -@@ -445,14 +445,19 @@ - } - - /*====================================================================*/ --void f__fix(struct passwd *pass) -+static int f__fix(struct passwd *pass) - { -- setgid(pass->pw_gid); -- initgroups(pass->pw_name, pass->pw_gid); -- setuid(pass->pw_uid); -+ /* CPhipps 2000/02/14 - -+ * Flag failure to drop priviledges */ -+ if (setgid(pass->pw_gid) || initgroups(pass->pw_name, pass->pw_gid) -+ || setuid(pass->pw_uid)) -+ return -1; -+ /* We don't mind if these fail */ - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -+ /* Paranoia */ -+ return (chdir(pass->pw_dir) && chdir("/")); - } - - /*---------------------------------------------------------------------*/ -@@ -541,14 +546,16 @@ - return 1; - - case 0: -+ /* CPhipps 2000/02/14 - we _must_ keep root priviledges as -+ * far as the f__fix call, otherwise that won't be able to -+ * drop groups. */ - pass=getpwuid(uid); - if (!pass) exit(1); -- f__fix(pass); /* setgid(), setuid(), setenv(), ... */ -- close(0); close(1); close(2); -+ if (f__fix(pass)) exit(1); /* Abort if not dropped completely */ -+ for (i=0;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/005_types_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/005_types_000 deleted file mode 100644 index 543ca086..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/005_types_000 +++ /dev/null @@ -1,255 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:35:38 2001 -@@ -8,6 +8,10 @@ - * - * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup - * (usage): typo (s/an unexistent/a non-existent/) -+ * (cmdline): modified handling of -t command line argument, so it -+ * can be used by anyone regardless of whether or not a -+ * copy of gpm is already running. -+ * (usage): update for new -t option "types". - * - * 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 -@@ -177,6 +181,7 @@ - " -S [commands] enable special commands (see man page)\n" - " -t mouse-type sets mouse type (default '%s')\n" - " Use a non-existent type (e.g. \"help\") to get a list\n" -+ " or \"types\" to get a list of just the mnemonics.\n" - " -T test: read mouse, no clients\n" - " -v print version and exit\n" - " -e output messages to stderr instead of syslog\n" -@@ -368,7 +373,21 @@ - if (optarg) opt_special=optarg; - else opt_special=""; - break; -- case 't': opt_type=optarg; break; -+ case 't': -+ opt_type=optarg; -+ for (m_type=mice; m_type->fun; m_type++) -+ if (!strcmp(opt_type,m_type->name) -+ || !strcasecmp(opt_type,m_type->synonyms)) -+ break; -+ -+ if (!(m_type->fun)) { -+ /* not found */ -+ if (strcmp(opt_type,"types")==0) -+ exit(M_listTypes()); -+ else -+ exit(M_listMice()); -+ } -+ break; - case 'T': opt_test++; break; - case 'v': printf(GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); exit(0); - case 'V': -@@ -421,7 +440,7 @@ - /* look for the mouse type */ - m_type = find_mouse_by_name(opt_type); - if (!m_type) /* not found */ -- exit(M_listTypes()); -+ exit(M_listMice()); - } /*for*/ - - if (opt_repeater) { -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:35:50 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:35:45 2001 -@@ -6,6 +6,12 @@ - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001 Nico Schottelius - * -+ * Tue, 5 Jan 1999 23:44:58 +0000, modified by James Troup : -+ * Improved (?) descriptions of mouse types. -+ * (M_listMice): function used by -t help, reworked version of old -+ * M_listTypes. -+ * (M_listTypes): function used by -t types; lists only mnemonics. -+ * - * 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 -@@ -50,6 +56,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2113,10 +2120,14 @@ - */ - - Gpm_Type mice[]={ -- {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", -+ {"mman", "The MouseMan protocol used by new Logitech mice.", -+ /* The \"MouseMan\" and similar devices (3/4 bytes per packet). */ - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, -- {"ms", "The original ms protocol, with a middle-button extension.", -+ {"ms", "For Microsoft mice (2 or 3 buttons). Some old 2 button mice\n" -+ " send some spurious packets, which can be misunderstood as\n" -+ " middle-button events. If this is happens to you, use the\n" -+ " 'bare' mouse type.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"ms+", "Like 'ms', but allows dragging with the middle button.", -@@ -2125,25 +2136,29 @@ - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", -+ {"bare", "For some 2 button Microsoft mice. Same as 'ms' except that\n" -+ " gpm will not attempt to simulate a third button.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", -+ {"msc", "For most 3 button serial mice.", -+ /* Mouse-Systems-Compatible (5bytes). Most 3-button mice. */ - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, -- {"sun", "'msc' protocol, but only 3 bytes per packet.", -+ {"sun", "For Sparc mice.", -+ /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, -- {"logi", "Used in some Logitech devices (only serial).", -+ {"logi", "For old serial Logitech mice.", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, -- {"bm", "Micro$oft busmice and compatible devices.", -+ {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -- {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", -+ {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" -+ " pins).", - "PS/2", M_ps2, I_empty, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", -@@ -2155,60 +2170,65 @@ - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8|PARENB|PARODD, - {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -- {"logim", "Turn logitech into Mouse-Systems-Compatible.", -+ {"logim","For turning on the MouseSystems compatible mode (3 buttons)\n" -+ " of some Logitech mice.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, -- {"pnp", "Plug and pray. New mice may not run with '-t ms'.", -+ {"pnp", "For the new 'plug and play' mice produced by Microsoft.\n" -+ " Try it if '-t ms' does not work.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, -- {"imps2","Microsoft Intellimouse (ps2) - autodetect 2/3 buttons,wheel unused", -+ {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" -+ " connector with 6 pins), 3 buttons (wheel is repeated).", -+ - "", M_imps2, I_imps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", -+ {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, -- {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", -+ {"netmouse","For the \"Genius NetMouse\". This one has two normal buttons plus\n" -+ " 'up'/'down' buttons.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -- {"cal", "Calcomp UltraSlate", -+ {"cal", "For a Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, -- {"calr", "Calcomp UltraSlate - relative mode", -+ {"calr", "For a Calcomp UltraSlate in relative mode.", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, -- {"twid", "Twidddler keyboard", -+ {"twid", "For the \"Twidddler\" keyboard.", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, -- {"syn", "The \"Synaptics\" serial TouchPad.", -+ {"syn", "For the \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, -- {"synps2", "The \"Synaptics\" PS/2 TouchPad", -+ {"synps2", "For the \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, -- {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", -+ {"brw", "For the Fellowes Browser - 4 buttons (and a wheel) (dual protocol?).", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, - - #ifdef HAVE_LINUX_JOYSTICK_H -- {"js", "Joystick mouse emulation", -+ {"js", "For \"Joystick\" mouse emulation.", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, - #endif - -- {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", -+ {"summa", "For a Summa/Genius tablet in absolute mode (906,1212B,EasyPainter...).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, -- {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", -+ {"mtouch", "For MicroTouch touch-screens (only button-1 events right now).", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, - -- {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", -+ {"acecad", "For Acecad tablet in absolute mode (Sumagrapics MM-Series mode).", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, - -@@ -2224,18 +2244,37 @@ - /*------------------------------------------------------------------------*/ - /* and the help */ - --int M_listTypes(void) -+int M_listMice(void) - { - Gpm_Type *type; - - printf("\n" GPM_NAME " " GPM_RELEASE ", " GPM_DATE "\n"); - printf("Available mouse types are:\n\n"); -- printf("r name synonym description\n\n"); -- for (type=mice; type->fun; type++) -- printf("%c %-8s %s\n Synonyms: %s\n", type->repeat_fun ?'*':' ', -- type->name, type->desc, type->synonyms); -+ printf("name (synonym) description\n\n"); -+ for (type=mice; type->fun; type++) { -+ char buffer[30]; -+ if (type->synonyms[0]=='\0') -+ sprintf(buffer,"%s",type->name); -+ else -+ sprintf(buffer,"%s (%s)",type->name,type->synonyms); -+ printf("%-18s - %s\n",buffer, type->desc); -+ } - - putchar('\n'); -+ -+ return 1; /* to exit() */ -+} -+ -+int M_listTypes(void) -+{ -+ Gpm_Type *type; -+ -+ /* Only print the mouse mnemonics so that it is easy to parse */ -+ for (type=mice; type->fun; type++) { -+ printf("%s\n",type->name); -+ if (type->synonyms[0]!='\0') -+ printf("%s\n", type->synonyms); -+ } - - return 1; /* to exit() */ - } diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/006_version_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/006_version_000 deleted file mode 100644 index cf5c6473..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/006_version_000 +++ /dev/null @@ -1,16 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/configure.in gpm-1.19.5/configure.in ---- gpm-1.19.5.orig/configure.in Thu Sep 20 17:27:21 2001 -+++ gpm-1.19.5/configure.in Thu Oct 4 23:36:45 2001 -@@ -13,9 +13,9 @@ - - dnl These are chosen so that we can switch to the libtool scheme - dnl transparently. --abi=19 --abi_age=18 --abi_rev=0 -+abi=20 -+abi_age=19 -+abi_rev=5 - - abi_lev=`expr $abi - $abi_age` - abi_full=$abi_lev.$abi_age.$abi_rev diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 deleted file mode 100644 index 29a93f00..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/007_doc_fix_000 +++ /dev/null @@ -1,24 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Wed Sep 19 16:22:22 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:37:34 2001 -@@ -403,7 +403,7 @@ - Set the responsiveness. A higher - responsiveness is used for a faster cursor motion. - --@item -R @var{name} -+@item -R@var{name} - Causes @code{gpm} to act as a repeater: any mouse data received while - in graphic mode will be produced on the fifo @file{/dev/gpmdata} - in protocol @var{name}. In principle, you can use the same -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/gpn.c gpm-1.19.5/src/gpn.c ---- gpm-1.19.5.orig/src/gpn.c Thu Oct 4 23:37:40 2001 -+++ gpm-1.19.5/src/gpn.c Thu Oct 4 23:37:34 2001 -@@ -173,7 +173,7 @@ - " -p draw the pointer while striking a selection\n" - " -q quit after changing mouse behaviour\n" - " -r number sets the responsiveness (default %i)\n" -- " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" -+ " -Rmouse-type enter repeater mode. X should read /dev/gpmdata\n" - " like it was a mouse-type device. Default is MouseSystems.\n" - " You can also specify \"raw\" to relay the raw device data.\n" - " -F Force always in repeat mode..\n" diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 deleted file mode 100644 index 2efb7227..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/008_ps2_init_000 +++ /dev/null @@ -1,234 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/doc/doc.gpm gpm-1.19.5/doc/doc.gpm ---- gpm-1.19.5.orig/doc/doc.gpm Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/doc/doc.gpm Thu Oct 4 23:38:08 2001 -@@ -421,6 +421,8 @@ - - @item -s @var{number} - Set the sample rate for the mouse device. -+ This currently only does anything for the ps2, imps2, and logi -+ protocols. - - @item -S @var{commands} - Enable special-command processing, and optionally specify custom -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/defines.h gpm-1.19.5/src/headers/defines.h ---- gpm-1.19.5.orig/src/headers/defines.h Wed Sep 19 08:56:43 2001 -+++ gpm-1.19.5/src/headers/defines.h Thu Oct 4 23:38:08 2001 -@@ -54,6 +54,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/headers/gpmInt.h gpm-1.19.5/src/headers/gpmInt.h ---- gpm-1.19.5.orig/src/headers/gpmInt.h Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/headers/gpmInt.h Thu Oct 4 23:38:08 2001 -@@ -78,6 +78,7 @@ - #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ - #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ - #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -+#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ - #define GPM_AUX_RESET 0xFF /* Reset aux device */ - #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:13 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:08 2001 -@@ -1719,82 +1719,112 @@ - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ --static int write_to_mouse(int fd, unsigned char *data, size_t len) -+static int write_ps2(int fd, unsigned char cmd0, unsigned char cmd1, -+ size_t num, unsigned long int sleep) - { -- int i; -- int error = 0; -- for (i = 0; i < len; i++) { -- unsigned char c; -- write(fd, &data[i], 1); -- read(fd, &c, 1); -- if (c != GPM_AUX_ACK) { -+ int i, error = 0, rcnt; -+ unsigned char cmd[2], ret[512]; -+ -+ cmd[0] = cmd0; cmd[1] = cmd0; -+ -+ write(fd, cmd, num); -+ if (sleep == -1) -+ usleep(50000); -+ else -+ usleep(sleep); -+ -+ rcnt = read(fd, ret, sizeof(ret)); -+ if (rcnt != num) -+ error++; -+ -+ for (i = 0; i < rcnt; i++) { -+ if (ret[i] != GPM_AUX_ACK) - error++; -- } - } -- -- /* flush any left-over input */ -- usleep (30000); -- tcflush (fd, TCIFLUSH); - return(error); - } - -- - /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - /* Autodetect: Steve Bennett */ --static Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type) -+static Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, -+ int argc, char **argv) - { -- int i; -- int id; -- static unsigned char basic_init[] = { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; -- static unsigned char imps2_init[] = { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, 80, }; -- static unsigned char ps2_init[] = { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_RES, 3, }; -- -- /* Do a basic init in case the mouse is confused */ -- write_to_mouse(fd, basic_init, sizeof (basic_init)); -- -- /* Now try again and make sure we have a PS/2 mouse */ -- if (write_to_mouse(fd, basic_init, sizeof (basic_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed init"); -- return(NULL); -- } -+ int i, id, error = 0, rate; - -- /* Try to switch to 3 button mode */ -- if (write_to_mouse(fd, imps2_init, sizeof (imps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ /* Flush any existing input. */ -+ tcflush (fd, TCIFLUSH); -+ -+ if (write_ps2 (fd, GPM_AUX_DEFAULTS, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init"); - return(NULL); - } - -- /* Read the mouse id */ -- id = read_mouse_id(fd); -- if (id == GPM_AUX_ID_ERROR) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed to read id, assuming standard PS/2"); -- id = GPM_AUX_ID_PS2; -+ // Magic to enable the IMPS/2 protocol. -+ if (!strcmp(type->name, "imps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ } else if (!strcmp(type->name, "exps2")) { -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log (LOG_ERR, "exps2: PS/2 mouse failed (3 button) init"); -+ return (NULL); -+ } - } - -- /* And do the real initialisation */ -- if (write_to_mouse(fd, ps2_init, sizeof (ps2_init)) != 0) { -- gpm_debug_log(LOG_ERR, "imps2: PS/2 mouse failed setup, continuing..."); -+ if (write_ps2 (fd, GPM_AUX_SET_SCALE11, '\0', 1, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set 1:1 scale."); -+ return (NULL); - } - -- if (id == GPM_AUX_ID_IMPS2) { -- /* Really an intellipoint, so initialise 3 button mode (4 byte packets) */ -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected intellimouse PS/2"); -- -- return type; -+ if (opt_sample > 0) { -+ if (opt_sample >= 200) rate = 200; -+ else if (opt_sample >= 100) rate = 100; -+ else if (opt_sample >= 80) rate = 80; -+ else if (opt_sample >= 60) rate = 60; -+ else if (opt_sample >= 40) rate = 40; -+ else rate = 20; -+ } else { -+ rate = 100; - } -- if (id != GPM_AUX_ID_PS2) { -- gpm_debug_log(LOG_ERR, "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2", id); -- } -- else { -- gpm_debug_log(LOG_NOTICE, "imps2: Auto-detected standard PS/2"); -+ -+ if (write_ps2 (fd, GPM_AUX_SET_SAMPLE, rate, 2, -1)) { -+ gpm_debug_log(LOG_ERR, "PS/2 mouse failed init: Unable to set rate."); -+ return (NULL); - } -- for (type=mice; type->fun; type++) { -- if (strcmp(type->name, "ps2") == 0) { -- return(type); -- } -+ -+ write_ps2 (fd, GPM_AUX_SET_STREAM, '\0', 1, 1); -+ return type; -+ -+ /* FIXME: We need to decide how to handle this. */ -+#if 0 -+ /* Read the mouse id */ -+ id = read_mouse_id(fd); -+ -+ switch (id) { -+ case GPM_AUX_ID_ERROR: -+ gpm_debug_log (LOG_ERR, "Unable to read PS/2 mouse ID: Using selected protocol.\n"); -+ return type; -+ case GPM_AUX_ID_PS2: -+ gpm_debug_log(LOG_NOTICE, "PS/2 protocol mouse."); -+ return get_mouse_type("ps2"); -+ case GPM_AUX_ID_IMPS2: -+ gpm_debug_log(LOG_NOTICE, "IMPS/2 protocol mouse."); -+ return get_mouse_type("imps2"); -+ case GPM_AUX_ID_EXPS2: -+ gpm_debug_log(LOG_NOTICE, "EXPS/2 protocol mouse."); -+ return get_mouse_type("exps2"); -+ default: -+ gpm_debug_log (LOG_ERR, "Unknown mouse ID, using selected protocol."); -+ return type; - } -- /* ps2 was not found!!! */ -- return(NULL); -+#endif - } - - /* -@@ -2159,8 +2189,8 @@ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", -- "PS/2", M_ps2, I_empty, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ "PS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, -@@ -2180,12 +2210,11 @@ - {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, - {"imps2","For the Microsoft IntelliMouse on a PS/2 port (round\n" - " connector with 6 pins), 3 buttons (wheel is repeated).", -- -- "", M_imps2, I_imps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "", M_imps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", -- "ExplorerPS/2", M_ps2, I_exps2, STD_FLG, -- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, -+ {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"ms3", "For the Microsoft IntelliMouse (serial), 3 buttons (wheel is repeated).", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 deleted file mode 100644 index 301a524a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/009_sun_repeat_000 +++ /dev/null @@ -1,29 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:38:59 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:38:53 2001 -@@ -449,6 +449,16 @@ - return 0; - } - -+static int R_sun(Gpm_Event *state, int fd) -+{ -+ signed char buffer[3]; -+ -+ buffer[0]= (state->buttons ^ 0x07) | 0x80; -+ buffer[1]= state->dx; -+ buffer[2]= -(state->dy); -+ return write(fd,buffer,3); -+} -+ - static int M_msc(Gpm_Event *state, unsigned char *data) - { - state->buttons= (~data[0]) & 0x07; -@@ -2177,7 +2187,7 @@ - {"sun", "For Sparc mice.", - /* 'msc' protocol, but only 3 bytes per packet. */ - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, -- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, -+ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, R_sun}, - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 b/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 deleted file mode 100644 index 6cab98b5..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/patches/todo/zephian-hull-1.19.5/010_fups2_fuimps2_000 +++ /dev/null @@ -1,54 +0,0 @@ -diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h -x *.elc gpm-1.19.5.orig/src/mice.c gpm-1.19.5/src/mice.c ---- gpm-1.19.5.orig/src/mice.c Thu Oct 4 23:40:48 2001 -+++ gpm-1.19.5/src/mice.c Thu Oct 4 23:40:34 2001 -@@ -1837,6 +1837,29 @@ - #endif - } - -+/* PS/2 Init */ -+static Gpm_Type *I_fuimps2(int fd, unsigned short flags, -+ struct Gpm_Type *type, int argc, char **argv) -+{ -+ // cmd is used by the write_ps2* macros. -+ unsigned char cmd[15]; -+ int tmp, error = 0; -+ -+ if (check_no_argv(argc, argv)) return NULL; -+ -+ // Magic to enable the IMPS/2 protocol. -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 200, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 100, 2, -1); -+ error += write_ps2 (fd, GPM_AUX_SET_SAMPLE, 80, 2, -1); -+ if (error) { -+ gpm_debug_log(LOG_ERR, "fuimps2: PS/2 mouse failed (3 button) init"); -+ return(NULL); -+ } -+ -+ return type; -+} -+ -+ - /* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. -@@ -2197,6 +2220,9 @@ - {"bm", "For some busmice, including Microsoft and Logitech busmice.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, -+ {"fups2","For BROKEN PS/2 mice (round with 6 metal pins).", -+ "PS/2", M_ps2, I_empty, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 3, 1, 0, 0, 0}, - {"ps2", "For most busmice connected to a PS/2 port (round with 6 metal\n" - " pins).", - "PS/2", M_ps2, I_ps2, STD_FLG, -@@ -2222,6 +2248,10 @@ - " connector with 6 pins), 3 buttons (wheel is repeated).", - "", M_imps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, -+ {"fuimps2","For BROKEN wheel mice on a PS/2 port\n" -+ "(round connector with 6 pins), 3 buttons (wheel is repeated).", -+ "", M_imps2, I_fuimps2, STD_FLG, -+ {0xc0, 0xc0, 0x00, 0x00}, 4, 1, 0, 0, 0}, - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_ps2, I_ps2, STD_FLG, - {0x08, 0x08, 0x00, 0x00}, 4, 1, 0, 0, 0}, diff --git a/software/gpm/browse_source/gpm-1.99.7/scripts/build-from-git-and-run.sh b/software/gpm/browse_source/gpm-1.99.7/scripts/build-from-git-and-run.sh deleted file mode 100644 index 0bfe08c9..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/scripts/build-from-git-and-run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# I am lazy -- Nico -# 20080213 -# Copying: GPLv3 - -ich="${0##*/}" -hier="${0%/*}" - - -"${hier}/../build-from-git.sh" && sudo ../src/gpm - diff --git a/software/gpm/browse_source/gpm-1.99.7/scripts/generate_drivers_header.sh b/software/gpm/browse_source/gpm-1.99.7/scripts/generate_drivers_header.sh deleted file mode 100644 index 34eafd4f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/scripts/generate_drivers_header.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-gpm2008 at schottelius.org) -# -# This file is part of gpm. -# -# gpm 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. -# -# gpm 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 gpm. If not, see . -# - -cd "$1" - -cat << eof -/* - * Warning: This file is autogenerated by $0. - * - * DO NOT EDIT IT, ALL CHANGES WILL BE LOST IN ANY CASE. - * - */ - -#ifndef __GPM_DRIVER_H -#define __GPM_DRIVER_H - -eof - -( - grep -h "^int M_" drivers/*/m.c - #grep -h "^Gpm_Type" drivers/*/i.c - # they have line breaks :-( - cat drivers/*/i.c | \ - awk 'BEGIN { RS="{"; } - /Gpm_Type[ ][ ]*\*I_/ { - idx=index($0,"Gpm_Type *I_"); - fn=substr($0, idx); - gsub(/\n/, " ", fn); - print fn - }' - grep -h "^int R_" drivers/*/r.c -) | sed -e '/^$/d' -e 's/$/;/' -e 's/ */ /g' - -echo "#endif" diff --git a/software/gpm/browse_source/gpm-1.99.7/scripts/generate_drivers_makefile.sh b/software/gpm/browse_source/gpm-1.99.7/scripts/generate_drivers_makefile.sh deleted file mode 100644 index b65acefb..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/scripts/generate_drivers_makefile.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-gpm2008 at schottelius.org) -# -# This file is part of gpm. -# -# gpm 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. -# -# gpm 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 gpm. If not, see . -# - -dir="$1" - -cat << eof -# -# Warning: This file is autogenerated by $0. -# -# DO NOT EDIT IT, ALL CHANGES WILL BE LOST IN ANY CASE. -# -# - -GDRIVERS = \\ -eof - -( - cd $dir - ls drivers/*/*.c -) | sed 's/$/ \\/' - -# append an empty line -echo "" diff --git a/software/gpm/browse_source/gpm-1.99.7/scripts/git-archiv-tarbz2.sh b/software/gpm/browse_source/gpm-1.99.7/scripts/git-archiv-tarbz2.sh deleted file mode 100644 index b467b45c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/scripts/git-archiv-tarbz2.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-git-dev at schottelius.org) -# -# -# This file 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 3 of the License, or -# (at your option) any later version. -# -# This file 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 ccollect. If not, see . -# -# Written on: 20080314 -# - -version="$1" -me=${0##*/} - -if [ ! "$version" ]; then - echo "${me}: Version" - exit 1 -fi - -if [ ! -d .git ]; then - echo "There is no .git in here." - exit 2 -fi - -pwd=$(pwd) -name=${pwd##*/} - -git archive --format=tar --prefix=${name}-${version}/ HEAD | \ - tee ../${name}-${version}.tar | bzip2 -9 > ../${name}-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.7/scripts/gpm.release b/software/gpm/browse_source/gpm-1.99.7/scripts/gpm.release deleted file mode 100644 index 963e0c6d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/scripts/gpm.release +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -# only release if I tell it to release -[ "$1" = "now" ] || exit 23 - -#if [ $# -ne 2 ]; then -# echo "This is a maintainer-only script to release cinit" -# echo $(basename $0): source-dir version -# exit 1 -#fi - -DDIR="$(cd $(dirname $0)/../../; pwd -P)" -DIR="$(cd $(dirname $0)/../; pwd -P)" -RDIR="$(basename "$DIR")" - -VERSION="$(awk -F= '/^release=/ { print $2 }' configure.in )" -#VERSION="$(cd "$DIR"; pwd -P | sed 's;.*/gpm-;;')" -#VERSION_CONF="$(head -n1 $(dirname $0)/../../conf/version | sed 's/^"\(.*\)"$/\1/')" -#VERSION_CHANGES="$(head -n1 "$(dirname $0)/../../CHANGES" | sed 's/cinit-\(.*\):$/\1/')" - -echo -n "=> Version: $VERSION; ok?" -read ok -#echo "=> Version directory: $VERSION" -#echo "=> Version conf/version: $VERSION_CONF" -#echo "=> Version CHANGES: $VERSION_CHANGES" - -#if [ "$VERSION" = "$VERSION_CONF" -a "$VERSION" = "$VERSION_CHANGES" ]; then -# echo "=> Version confirmed." -#fi - -#DIR=$1 -#VERSION=$2 -TAR_NAME="gpm-${VERSION}.tar.bz2" -OUT_NAME="$DDIR/$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "$VERSION in $DIR to $DDIR with $RDIR?" -echo "Copying to ${D_HOST}:${D_DIR}" -echo -n "=> Continue? " -read yes - -if [ ! -d "$DIR" ]; then - echo "$DIR is not a directory" - exit 1 -fi - -#( cd "$DIR" && make dist ) || exit 1 - -echo "Creating bzip2 compressed tar" -tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$OUT_NAME -C $D_SOURCE" -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -ssh "$D_HOST" "cd \"$D_SOURCE\" && rm -f \"$LINK\" && ln -s \"$RDIR\" \"$LINK\"" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.7/scripts/gpm2.release b/software/gpm/browse_source/gpm-1.99.7/scripts/gpm2.release deleted file mode 100644 index c675a0e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/scripts/gpm2.release +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# Build release tar -# Date: Sat Oct 15 21:38:29 CEST 2005 -# Last Changed: ls -l - -if [ $# -ne 1 ]; then - echo "This is a maintainer-only script to release cinit" - echo $(basename $0): version - exit 1 -fi - -if [ ! -d .git ]; then - echo "Missing .git" - exit 1 -fi - -set -e -version_1="$1" -version_conf="$(awk -F= '/^release=/ { print $2 }' configure.in)" - -hier=${0%/*} - -echo "=> Version you want: $version_1" -echo "=> Version conf: $version_conf" - -if [ "$version_1" = "$version_conf" ]; then - echo "=> Version confirmed." -else - echo "That is not ok" - exit 1 -fi - -TAR_NAME="gpm-${version_1}.tar.bz2" -OUT_NAME="../$TAR_NAME" -D_HOST=home.schottelius.org -D_BASE=www/org/schottelius/unix/www/gpm -D_DIR=${D_BASE}/archives/ -D_SOURCE=${D_BASE}/browse_source/ -LINK=current - -echo "Release version $version_1 and copy to ${D_HOST}?" -echo -n "=> Continue? " -read yes - -echo "Creating bzip2 compressed tar" -#tar cj -X "$DIR/.exclude" -C "$DDIR" -f "$OUT_NAME" "$RDIR" -"${hier}/git-archiv-tarbz2.sh" "${version_1}" - -chmod 0644 "$OUT_NAME" -echo "Transfering to $D_HOST" -scp "$OUT_NAME" "$D_HOST:$D_DIR" - -echo "Extracting to $D_SOURCE" -ssh "$D_HOST" "tar xfj $D_DIR/$TAR_NAME -C $D_SOURCE" - -echo "Correcting paranoid permissions" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type f -exec chmod 0644 {} \\;" -ssh "$D_HOST" "find \"$D_SOURCE/$RDIR\" -type d -exec chmod 0755 {} \\;" -echo "Please do not forget to update the website..." diff --git a/software/gpm/browse_source/gpm-1.99.7/scripts/release-tar.sh b/software/gpm/browse_source/gpm-1.99.7/scripts/release-tar.sh deleted file mode 100644 index 8cce41b0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/scripts/release-tar.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Nico Schottelius -# 20080313 - -version=$1 -hier=${0##*/} - -echo $hier - -[23:11] denkbrett:gpm% sha512sum gpm-1.20.3pre4.tar.bz2 > gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512suM -[23:12] denkbrett:gpm% chmod 0644 gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum -[23:12] denkbrett:gpm% scp gpm-1.20.3pre4.tar.bz2 gpm-1.20.3pre4.tar.bz2.sha512sum home.schottelius.org:www/org/schottelius/unix/www/gpm/archives - - -[ "$version" ] || exit 3 - -git archive --format=tar --prefix=gpm-${version}/ HEAD | \ - tee ../gpm-${version}.tar | bzip2 -9 > ../gpm-${version}.tar.bz2 diff --git a/software/gpm/browse_source/gpm-1.99.7/scripts/report_success.sh b/software/gpm/browse_source/gpm-1.99.7/scripts/report_success.sh deleted file mode 100644 index ab66ae70..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/scripts/report_success.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# 2008 Nico Schottelius (nico-ccollect at schottelius.org) -# -# This file is part of ccollect. -# -# ccollect 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 3 of the License, or -# (at your option) any later version. -# -# ccollect 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 ccollect. If not, see . -# -# Sends feedback -# -# Adapted for gpm -# - -software="gpm" -author="Nico Schottelius" -subject="==> success: $software" -to="nico-gpm-success" -host="schottelius.org" -fullto="${to}@${host}" - -info="$(awk -F= '/^release=/ { print $2 }' configure.in; uname -s -v -r -m)" - - -echo "Reporting success for $software to ${author}" -echo "-----------------" -echo -n "Your name (leave free for anonymous): " -read name -echo -n "Your email (leave free for anonymous): " -read email -echo -n "Your normal gpm parameters (-m -t -o ...): " -read params -echo -n "Comment (leave free for no comment): " -read comment - -echo "" -echo "The following information will be send to ${author}:" -echo "" - -cat << eof -Name: $name (will be used to contact you and kept secret) -E-Mail: $email (will be used to contact you and kept secret) -Comment: $comment -Info: $info -Parameters: $params - -eof - -echo -n "Is it ok to send out that mail (press enter to send or ctrl-c to abort)? " -read yes - -cat << eof | mail -s "$subject" "$fullto" -Name: $name -E-Mail: $email -Comment: $comment -Info: $info -Parameters: $params -eof - -echo "Send. Thank you for your feedback." diff --git a/software/gpm/browse_source/gpm-1.99.7/src/Makefile.in b/software/gpm/browse_source/gpm-1.99.7/src/Makefile.in deleted file mode 100644 index cc8fd77b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/Makefile.in +++ /dev/null @@ -1,217 +0,0 @@ -# -*-makefile-*- (gpm/src) -# -# Copyright 1994,1997 rubini@linux.it -# Copyright 1997 dickey@clark.net -# Copyright (C) 1998 Ian Zimmerman -# Copyright (C) 2001-2008 Nico Schottelius -# - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -builddir = @builddir@ -top_builddir = .. - -## INCLUDES --include Makefile.drivers.generated -include $(top_builddir)/Makefile.include - - -## SOURCE FILES - -GSRC = mice.c \ - daemon/add_mouse.c daemon/init_mice.c daemon/reset_mice.c \ - daemon/build_argv.c daemon/disable_paste.c daemon/do_client.c \ - daemon/do_selection.c daemon/get_console_size.c daemon/get_data.c \ - daemon/getmousedata.c daemon/gpm.c daemon/gpm-killed.c \ - daemon/main.c daemon/old_main.c \ - daemon/open_console.c daemon/check_kill.c daemon/gpm_exited.c \ - daemon/processspecial.c daemon/processconn.c daemon/processmouse.c \ - daemon/processrequest.c daemon/selection_copy.c daemon/selection_paste.c\ - daemon/cmdline.c daemon/loadlut.c daemon/find_mouse_by_name.c \ - daemon/usage.c daemon/check_uniqueness.c \ - gpm2/become_daemon.c \ - daemon/startup.c daemon/wait_text.c report.c - -# mouse-test and gpm -GCOMMON = generic/check_no_argv.c generic/parse_argv.c \ - generic/limit_delta.c generic/option_modem_lines.c \ - generic/setspeed.c generic/read_mouse_id.c \ - generic/m_listtypes.c generic/write_to_mouse.c \ - generic/isodigit.c generic/getsym.c \ - tools.c - -GSRC += $(GDRIVERS) -GSRC += $(GCOMMON) - -GOBJ = $(GSRC:.c=.o) - -LSRC = lib/liblow.c lib/libhigh.c lib/libxtra.c lib/report-lib.c tools.c - -LOBJ = $(LSRC:.c=.o) @CURSES_OBJS@ - -PICS = $(LOBJ:.o=.lo) - -HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h - -PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c \ - prog/display-buttons.c prog/display-coords.c prog/get-versions.c - -POBJ = $(PSRC:.c=.o) prog/gpm-root.o - -PROG = $(POBJ:.o=) - -SRCS = $(GSRC) $(LSRC) $(PSRC) -SRCSP= $(SRCS:.c=.P) lib/libcurses.P -OBJECTS = $(GOBJ) $(filter-out @CURSES_OBJS@,$(LOBJ)) $(POBJ) - -DEFS = @DEFS@ - -STRIP = -s - -### REAL TARGETS -all: gpm lib/libgpm.so.@abi_lev@ lib/libgpm.a $(PROG) - -### BUILD PROCESS - -# allow CFLAGS to be overriden from make command line -# ideally one would never have to write this rule again, but the GNU -# makefile standards are at cross-purposes: CFLAGS is reserved for -# user-overridable flags, but it's also all the implicit rule looks at. - -#Make sure that our output-dir exists. autotools would have done this -#for us for SUBDIRS, but we do not use them here (why, btw?) -$(OBJECTS) @CURSES_OBJS@: %.o: $(srcdir)/%.c - @@MKDIR_P@ $(@D) - $(CC) -MD @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - @cp $*.d $*.P; \ - sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ - -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ - #rm -f $*.d - -$(PICS): %.lo: $(srcdir)/%.c - @@MKDIR_P@ $(@D) - $(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $< - -# the prog rules are not very clean... -prog/%.o: $(srcdir)/prog/%.c - @@MKDIR_P@ $(@D) - $(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $< - -prog/%: prog/%.o - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) - -gpm: $(GOBJ) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm - - -# Do it all! -all: gpm lib/libgpm.so.@abi_lev@ lib/libgpm.a $(PROG) - -$(OBJECTS): headers/drivers.h - -headers/drivers.h: $(addprefix $(srcdir)/,$(GDRIVERS)) $(top_srcdir)/scripts/generate_drivers_header.sh - @@MKDIR_P@ $(@D) - $(top_srcdir)/scripts/generate_drivers_header.sh $(srcdir) > $@ - -#-include $(SRCSP) - -Makefile.drivers.generated: $(top_srcdir)/scripts/generate_drivers_makefile.sh - @@MKDIR_P@ $(@D) - $(top_srcdir)/scripts/generate_drivers_makefile.sh $(srcdir) > $@ - -### INSTALL -check: all -installdirs: - -install: check - $(INSTALL_PROGRAM) gpm $(sbindir)/gpm - $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a - $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h - # POSIX requires the range of a for loop be nonempty and Bash - # 2.x goes along; unfortunately that means an additional - # headache in cases like this - if test "x@SHLIB@" != "x" ; then \ - $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ; \ - cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ ; \ - echo "WARNING: We installed a lib, you should now call ldconfig" ; \ - echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ; \ - echo "Or to update everything just type ldconfig" ; \ - fi -# The unversioned files seems to be not needed -> correct me, if I am wrong. -# && $(LN_S) -f libgpm.so.@abi_lev@ libgpm.so ; \ - - # prog/ - for i in $(PROG); do \ - $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ - done - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install - -# Note: this leaves around /usr/lib/libgpm.so.1 and /usr/lib/libgpm.so.1.nn -# This is probably the right thing, because programs may be linked to it -uninstall: - rm -f $(bindir)/mev $(bindir)/gpm-root $(bindir)/disable-paste \ - $(sbindir)/gpm $(libdir)/libgpm.a $(libdir)/libgpm.so $(includedir)/gpm.h - for i in $(PROG); do \ - rm -f $(bindir)/$$i ;\ - done - -# Configure & unconfigure - -Makefile: Makefile.in - $(top_builddir)/config.status Makefile - -# Subdirectory prog/ -prog/gpm-root.c: $(srcdir)/prog/gpm-root.y - $(YACC) $(YFLAGS) $< && mv y.tab.c prog/gpm-root.c - -# gpm-root needs an own rule, because gpm-root.c is not in $(srcdir) -prog/gpm-root: prog/gpm-root.c lib/libgpm.so.@abi_lev@ - $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so.@abi_lev@ - -prog/mouse-test: prog/mouse-test.o mice.o prog/open_console.o \ - $(GCOMMON:.c=.o) $(GDRIVERS:.c=.o) - $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm - -$(PROG): lib/libgpm.so.@abi_lev@ - -# Subdirectory lib/ -lib/libgpm.a: $(LOBJ) - $(AR) rc lib/libgpm.a $(LOBJ) - $(RANLIB) lib/libgpm.a - -lib/libgpm.so.@abi_full@: $(PICS) - $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ - @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) -lib/libgpm.so.@abi_lev@: lib/libgpm.so.@abi_full@ - $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so.@abi_lev@ -# unneeded, isn't it? -#lib/libgpm.so: lib/libgpm.so.@abi_full@ -# $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so - -clean: - rm -f gpm lib/libgpm.a lib/libgpm.so lib/libgpm.so.@abi_full@ \ - $(GOBJ) \ - $(LOBJ) \ - $(PICS) \ - $(POBJ) \ - $(PROG) \ - $(RDEPS) \ - $(SRCSP) \ - gpm2/* \ - core *~ prog/gpm-root.c Makefile.drivers.generated prog/open_console.o \ - headers/config.h.in~ - find . -name \*.d -exec rm {} \; - -distclean: clean - rm -f headers/config.h headers/drivers.h Makefile - -allclean: clean - rm -f headers/config.h.in - -### GPM2 integration -$(srcdir)/gpm2/become_daemon.c: $(top_srcdir)/gpm2/daemon/become_daemon.c - @@MKDIR_P@ $(@D) - cp $^ $@ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/add_mouse.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/add_mouse.c deleted file mode 100644 index 94f697cc..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/add_mouse.c +++ /dev/null @@ -1,160 +0,0 @@ - -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: add this to the list of mice. initialization follows later */ - -/* RETURN: - */ - -/* COMMENT: does error handling and exiting itself */ -void add_mouse(int type, char *value) -{ - struct micetab *tmp = option.micelist; - - /* - * PREAMBLE for all work: - */ - /* - * -m /dev/misc/psaux -t ps2 [ -o options ] - */ - - switch (type) { - - /*---------------------------------------------------------------------*/ - - /********************** -m mousedevice *********************************/ - - /*---------------------------------------------------------------------*/ - - case GPM_ADD_DEVICE: - - /* - * first invocation - */ - if(option.micelist == NULL) { - gpm_report(GPM_PR_DEBUG, "adding mouse device: %s", value); - option.micelist = (struct micetab *) malloc(sizeof(struct micetab)); - if(!option.micelist) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - option.micelist->next = NULL; - option.micelist->device = value; - option.micelist->protocol = NULL; - option.micelist->options = NULL; - return; - } - - /* - * find actual mouse - */ - while(tmp->device != NULL && tmp->protocol != NULL - && tmp->next != NULL) - tmp = tmp->next; - - gpm_report(GPM_PR_DEBUG, "finished searching"); - - /* - * found end of micelist, add new mouse - */ - if(tmp->next == NULL && tmp->protocol != NULL) { - gpm_report(GPM_PR_DEBUG, "next mouse making"); - tmp->next = (struct micetab *) malloc(sizeof(struct micetab)); - if(!tmp) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - tmp->next = NULL; - tmp->device = value; - tmp->protocol = NULL; - tmp->options = NULL; - return; - } else - gpm_report(GPM_PR_OOPS, GPM_MESS_FIRST_DEV); - - // } else if(tmp->device != NULL && tmp->protocol == NULL) - // gpm_report(GPM_PR_OOPS,GPM_MESS_FIRST_DEV); /* -m -m */ - - break; - - /*---------------------------------------------------------------------*/ - - /************************* -t type / protocol **************************/ - - /*---------------------------------------------------------------------*/ - - case GPM_ADD_TYPE: - if(option.micelist == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_FIRST_DEV); - - /* - * skip to next mouse, where either device or protocol is missing - */ - while(tmp->device != NULL && tmp->protocol != NULL - && tmp->next != NULL) - tmp = tmp->next; - - /* - * check whether device (-m) is there, if so, write protocol - */ - if(tmp->device == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG, "adding mouse type: %s", value); - tmp->protocol = value; - option.no_mice++; /* finally we got our mouse */ - } - - break; - - /*---------------------------------------------------------------------*/ - - /*************************** -o options ********************************/ - - /*---------------------------------------------------------------------*/ - - case GPM_ADD_OPTIONS: - if(option.micelist == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_FIRST_DEV); - - /* - * look for the last mouse - */ - tmp = option.micelist; - while(tmp->next != NULL) - tmp = tmp->next; - - /* - * if -m or -t are missing exit - */ - if(tmp->device == NULL || tmp->protocol == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_FIRST_DEV); - else { - gpm_report(GPM_PR_DEBUG, "adding mouse options: %s", value); - tmp->options = value; - } - break; - } -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/build_argv.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/build_argv.c deleted file mode 100644 index bae74fa5..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/build_argv.c +++ /dev/null @@ -1,69 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* calloc */ - -#include "message.h" /* messaging in gpm */ - -/* build_argv is used for mouse initialization routines */ -char **build_argv(char *argv0, char *str, int *argcptr, char sep) -{ - int argc = 1; - - char **argv; - - char *s; - - /* - * argv0 is never NULL, but the extra string may well be - */ - if(str) - for(s = str; sep && (s = strchr(s, sep)); argc++) - s++; - - argv = calloc(argc + 2, sizeof(char **)); - if(!argv) - gpm_report(GPM_PR_OOPS, GPM_MESS_ALLOC_FAILED); - argv[0] = argv0; - - if(!str) { - *argcptr = argc; /* 1 */ - return argv; - } - /* - * else, add arguments - */ - s = argv[1] = strdup(str); - argc = 2; /* first to fill */ - - /* - * ok, now split: the first one is in place, and s is the whole string - */ - for(; sep && (s = strchr(s, sep)); argc++) { - *s = '\0'; - s++; - argv[argc] = s; - } - *argcptr = argc; - return argv; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/check_kill.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/check_kill.c deleted file mode 100644 index 1eb17b6a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/check_kill.c +++ /dev/null @@ -1,69 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* unlink */ -#include /* exit */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:55:51 PDT 1998 Added this as replacement for the - unwanted functionality in check_uniqueness. */ - -void check_kill(void) -{ - int old_pid; - - FILE *fp = fopen(GPM_NODE_PID, "r"); - - /* - * if we cannot find the old pid file, leave - */ - if(fp == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_PID); - - /* - * else read the pid - */ - if(fscanf(fp, "%d", &old_pid) != 1) - gpm_report(GPM_PR_OOPS, GPM_MESS_READ_PROB, GPM_NODE_PID); - fclose(fp); - - gpm_report(GPM_PR_DEBUG, GPM_MESS_KILLING, old_pid); - - /* - * first check if we run - */ - if(kill(old_pid, 0) == -1) { - gpm_report(GPM_PR_INFO, GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } - /* - * then kill us (not directly, but the other instance ... ) - */ - if(kill(old_pid, SIGTERM) == -1) - gpm_report(GPM_PR_OOPS, GPM_MESS_CANT_KILL, old_pid); - - gpm_report(GPM_PR_DEBUG, GPM_MESS_KILLED, old_pid); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/check_uniqueness.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/check_uniqueness.c deleted file mode 100644 index de08c9be..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/check_uniqueness.c +++ /dev/null @@ -1,57 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* kill */ -#include /* kill, getpid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* itz Sat Sep 12 10:30:05 PDT 1998 this function used to mix two - completely different things; opening a socket to a running daemon - and checking that a running daemon existed. Ugly. */ - -/* rewritten mostly on 20th of February 2002 - nico */ -void check_uniqueness(void) -{ - FILE *fp = 0; - - int old_pid = -1; - - if((fp = fopen(GPM_NODE_PID, "r")) != NULL) { - fscanf(fp, "%d", &old_pid); - if(kill(old_pid, 0) == -1) { - gpm_report(GPM_PR_INFO, GPM_MESS_STALE_PID, GPM_NODE_PID); - unlink(GPM_NODE_PID); - } else /* we are really running, exit asap! */ - gpm_report(GPM_PR_OOPS, GPM_MESS_ALREADY_RUN, old_pid); - } - /* - * now try to sign ourself - */ - if((fp = fopen(GPM_NODE_PID, "w")) != NULL) { - fprintf(fp, "%d\n", getpid()); - fclose(fp); - } else { - gpm_report(GPM_PR_OOPS, GPM_MESS_NOTWRITE, GPM_NODE_PID); - } -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/cmdline.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/cmdline.c deleted file mode 100644 index 67a12501..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/cmdline.c +++ /dev/null @@ -1,154 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* atoi */ -#include /* getopt */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/***************************************************************************** - * Check the command line and / or set the appropriate variables - * Can't believe it, today cmdline() really does what the name tries to say - *****************************************************************************/ -void cmdline(int argc, char **argv) -{ - extern struct options option; - - char options[] = "a:A::b:B:c:d:Dg:hi:kl:m:Mo:pr:R::s:S:t:Tuv23"; - - int opt; - - /* - * initialize for the dual mouse - */ - mouse_table[2] = mouse_table[1] = mouse_table[0]; /* copy defaults */ - which_mouse = mouse_table + 1; /* use the first */ - - while((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - case 'a': - (which_mouse->opt_accel) = atoi(optarg); - break; - case 'A': - opt_aged++; - if(optarg) - opt_age_limit = atoi(optarg); - break; - case 'b': - (which_mouse->opt_baud) = atoi(optarg); - break; - case 'B': - (which_mouse->opt_sequence) = optarg; - break; - case 'c': - (which_mouse->opt_calib) = optarg; - break; - case 'd': - (which_mouse->opt_delta) = atoi(optarg); - break; - case 'D': - option.run_status = GPM_RUN_DEBUG; - break; - case 'g': - (which_mouse->opt_glidepoint_tap) = atoi(optarg); - break; - case 'h': - exit(usage(NULL)); - case 'i': - (which_mouse->opt_time) = atoi(optarg); - break; - case 'k': - check_kill(); - break; - case 'l': - opt_lut = optarg; - break; - case 'm': - add_mouse(GPM_ADD_DEVICE, optarg); - (which_mouse->opt_dev) = optarg; - break; /* GO AWAY! */ - case 'M': - opt_double++; - option.repeater++; - if(option.repeater_type == 0) - option.repeater_type = "msc"; - which_mouse = mouse_table + 2; - break; - case 'o': - add_mouse(GPM_ADD_OPTIONS, optarg); - gpm_report(GPM_PR_DEBUG, "options: %s", optarg); - (which_mouse->opt_options) = optarg; - break; /* GO AWAY */ - case 'p': - opt_ptrdrag = 0; - break; - case 'r': - /* - * being called responsiveness, I must take the inverse - */ - (which_mouse->opt_scale) = atoi(optarg); - if(!(which_mouse->opt_scale) || (which_mouse->opt_scale) > 100) - (which_mouse->opt_scale) = 100; /* the maximum */ - else - (which_mouse->opt_scale) = 100 / (which_mouse->opt_scale); - break; - case 'R': - option.repeater++; - if(optarg) - option.repeater_type = optarg; - else - option.repeater_type = "msc"; - break; - case 's': - (which_mouse->opt_sample) = atoi(optarg); - break; - case 'S': - if(optarg) - opt_special = optarg; - else - opt_special = ""; - break; - case 't': - add_mouse(GPM_ADD_TYPE, optarg); - (which_mouse->opt_type) = optarg; - break; /* GO AWAY */ - case 'u': - option.autodetect = 1; - break; - case 'T': - opt_test++; - break; - case 'v': - printf(GPM_MESS_VERSION "\n"); - exit(0); - case '2': - (which_mouse->opt_three) = -1; - break; - case '3': - (which_mouse->opt_three) = 1; - break; - default: - exit(usage("commandline")); - } - } -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/disable_paste.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/disable_paste.c deleted file mode 100644 index 7c918204..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/disable_paste.c +++ /dev/null @@ -1,30 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void disable_paste(int vc) -{ - opt_aged++; - gpm_report(GPM_PR_INFO, GPM_MESS_DISABLE_PASTE, vc); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/do_client.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/do_client.c deleted file mode 100644 index e4539bab..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/do_client.c +++ /dev/null @@ -1,75 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ - -/* returns 0 if the event has not been processed, and 1 if it has */ -int do_client(Gpm_Cinfo * cinfo, Gpm_Event * event) -{ - Gpm_Connect info = cinfo->data; - - int fd = cinfo->fd; - - /* - * value to return if event is not used - */ - int res = !(info.defaultMask & event->type); - - /* - * instead of returning 0, scan the stack of clients - */ - if((info.minMod & event->modifiers) < info.minMod) - goto scan; - if((info.maxMod & event->modifiers) < event->modifiers) - goto scan; - - /* - * if not managed, use default mask - */ - if(!(info.eventMask & GPM_BARE_EVENTS(event->type))) { - if(res) - return res; - else - goto scan; - } - - /* - * WARNING - *//* - * This can generate a SIGPIPE... I'd better catch it - */ - MAGIC_P((write(fd, &magic, sizeof(int)))); - write(fd, event, sizeof(Gpm_Event)); - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - - scan: - if(cinfo->next != 0) - return do_client(cinfo->next, event); /* try the next */ - return 0; /* no next, not used */ -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/do_selection.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/do_selection.c deleted file mode 100644 index 36e7f957..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/do_selection.c +++ /dev/null @@ -1,96 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------*/ -int do_selection(Gpm_Event * event) -{ /* returns 0, always */ - static int x1 = 1, y1 = 1, x2, y2; - -#define UNPOINTER() 0 - - x2 = event->x; - y2 = event->y; - switch (GPM_BARE_EVENTS(event->type)) { - case GPM_MOVE: - if(x2 < 1) - x2++; - else if(x2 > maxx) - x2--; - if(y2 < 1) - y2++; - else if(y2 > maxy) - y2--; - selection_copy(x2, y2, x2, y2, 3); /* just highlight pointer */ - return 0; - - case GPM_DRAG: - if(event->buttons == GPM_B_LEFT) { - if(event->margin) /* fix margins */ - switch (event->margin) { - case GPM_TOP: - x2 = 1; - y2++; - break; - case GPM_BOT: - x2 = maxx; - y2--; - break; - case GPM_RGT: - x2--; - break; - case GPM_LFT: - y2 <= y1 ? x2++ : (x2 = maxx, y2--); - break; - } - selection_copy(x1, y1, x2, y2, event->clicks); - if(event->clicks >= opt_ptrdrag && !event->margin) /* pointer */ - selection_copy(x2, y2, x2, y2, 3); - } /* if */ - return 0; - - case GPM_DOWN: - switch (event->buttons) { - case GPM_B_LEFT: - x1 = x2; - y1 = y2; - selection_copy(x1, y1, x2, y2, event->clicks); /* start - * selection */ - return 0; - - case GPM_B_MIDDLE: - selection_paste(); - return 0; - - case GPM_B_RIGHT: - if((which_mouse->opt_three) == 1) - selection_copy(x1, y1, x2, y2, event->clicks); - else - selection_paste(); - return 0; - } - } /* switch above */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/find_mouse_by_name.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/find_mouse_by_name.c deleted file mode 100644 index 27f8a5c0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/find_mouse_by_name.c +++ /dev/null @@ -1,58 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isspace */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/***************************************************************************** - * the function returns a valid type pointer or NULL if not found - *****************************************************************************/ -struct Gpm_Type *find_mouse_by_name(char *name) -{ - Gpm_Type *type; - - char *s; - - int len = strlen(name); - - for(type = mice; type->fun; type++) { - if(!strcasecmp(name, type->name)) - break; - /* - * otherwise, look in the synonym list - */ - for(s = type->synonyms; s; s = strchr(s, ' ')) { - while(*s && isspace(*s)) - s++; /* skip spaces */ - if(!strncasecmp(name, s, len) && !isprint(*(s + len))) - break; /* found */ - } - if(s) - break; /* found a synonym */ - } - if(!type->fun) - return NULL; - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/get_console_size.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/get_console_size.c deleted file mode 100644 index e770ce3a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/get_console_size.c +++ /dev/null @@ -1,75 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -void get_console_size(Gpm_Event * ePtr) -{ - int i, prevmaxx, prevmaxy; - - struct mouse_features *which_mouse; /* local */ - - /* - * before asking the new console size, save the previous values - */ - prevmaxx = maxx; - prevmaxy = maxy; - - i = open_console(O_RDONLY); - ioctl(i, TIOCGWINSZ, &win); - close(i); - if(!win.ws_col || !win.ws_row) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_ZERO_SCREEN_DIM); - win.ws_col = 80; - win.ws_row = 25; - } - maxx = win.ws_col; - maxy = win.ws_row; - gpm_report(GPM_PR_DEBUG, GPM_MESS_SCREEN_SIZE, maxx, maxy); - - if(!prevmaxx) { /* first invocation, place the pointer in the - * middle */ - statusX = ePtr->x = maxx / 2; - statusY = ePtr->y = maxy / 2; - } else { /* keep the pointer in the same position where - * it was */ - statusX = ePtr->x = ePtr->x * maxx / prevmaxx; - statusY = ePtr->y = ePtr->y * maxy / prevmaxy; - } - - for(i = 1; i <= 1 + opt_double; i++) { - which_mouse = mouse_table + i; /* used to access options */ - /* - * the following operation is based on the observation that 80x50 - * has square cells. (An author-centric observation ;-) - */ - (which_mouse->opt_scaley) = - (which_mouse->opt_scale) * 50 * maxx / 80 / maxy; - gpm_report(GPM_PR_DEBUG, GPM_MESS_X_Y_VAL, (which_mouse->opt_scale), - (which_mouse->opt_scaley)); - } -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/get_data.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/get_data.c deleted file mode 100644 index 591f4e40..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/get_data.c +++ /dev/null @@ -1,53 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -/*-------------------------------------------------------------------* - * This was inline, and incurred in a compiler bug (2.7.0) - *-------------------------------------------------------------------*/ -int get_data(Gpm_Connect * where, int whence) -{ - static int i; - -#ifdef GPM_USE_MAGIC - while((i = read(whence, &check, sizeof(int))) == 4 && check != GPM_MAGIC) - gpm_report(GPM_PR_INFO, GPM_MESS_NO_MAGIC); - - if(!i) - return 0; - if(check != GPM_MAGIC) { - gpm_report(GPM_PR_INFO, GPM_MESS_NOTHING_MORE); - return -1; - } -#endif - - if((i = read(whence, where, sizeof(Gpm_Connect))) != sizeof(Gpm_Connect)) { - return i ? -1 : 0; - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/getmousedata.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/getmousedata.c deleted file mode 100644 index 93c78804..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/getmousedata.c +++ /dev/null @@ -1,100 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* guess what */ -#include /* read */ -#include /* exit */ -#include /* strerror */ -#include /* KD* */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ -#include "mice.h" /* GPM MAGIC */ - -/*------------------------------------------------------------------- - * fetch the actual device data from the mouse device, dependent on - * what Gpm_Type is being passed. - *-------------------------------------------------------------------*/ -unsigned char *getMouseData(int fd, Gpm_Type * type, int kd_mode) -{ - static unsigned char data[32]; /* quite a big margin :) */ - - unsigned char *edata = data + type->packetlen; - - int howmany = type->howmany; - - int i, j; - -/*....................................... read and identify one byte */ - - if(read(fd, data, howmany) != howmany) { - if(opt_test) - exit(0); - gpm_report(GPM_PR_ERR, GPM_MESS_READ_FIRST, strerror(errno)); - return NULL; - } - - if(kd_mode != KD_TEXT && fifofd != -1 && opt_rawrep) - write(fifofd, data, howmany); - - if((data[0] & ((which_mouse->m_type)->proto)[0]) != - ((which_mouse->m_type)->proto)[1]) { - if((which_mouse->m_type)->getextra == 1) { - data[1] = GPM_EXTRA_MAGIC_1; - data[2] = GPM_EXTRA_MAGIC_2; - gpm_report(GPM_PR_DEBUG, GPM_EXTRA_DATA, data[0]); - return data; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_PROT_ERR); - return NULL; - } - -/*....................................... read the rest */ - - /* - * well, this seems to work almost right with ps2 mice. However, I've never - * tried ps2 with the original selection package, which called usleep() - */ - - if((i = (which_mouse->m_type)->packetlen - howmany)) /* still to get */ - do { - j = read(fd, edata - i, i); /* edata is pointer just after data */ - if(kd_mode != KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) - write(fifofd, edata - i, j); - i -= j; - } while(i && j); - - if(i) { - gpm_report(GPM_PR_ERR, GPM_MESS_READ_REST, strerror(errno)); - return NULL; - } - - if((data[1] & ((which_mouse->m_type)->proto)[2]) != - ((which_mouse->m_type)->proto)[3]) { - gpm_report(GPM_PR_INFO, GPM_MESS_SKIP_DATA); - return NULL; - } - gpm_report(GPM_PR_DEBUG, GPM_MESS_DATA_4, data[0], data[1], data[2], - data[3]); - return data; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm-killed.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm-killed.c deleted file mode 100644 index e7ae6540..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm-killed.c +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* SIG* */ -#include /* exit() */ -#include /* getpid() */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void gpm_killed(int signo) -{ - if(signo == SIGWINCH) { - gpm_report(GPM_PR_WARN, GPM_MESS_RESIZING, option.progname, getpid()); - opt_resize++; - return; - } - if(signo == SIGUSR1) { - gpm_report(GPM_PR_WARN, GPM_MESS_KILLED_BY, option.progname, getpid(), - option.progname); - } - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm.c deleted file mode 100644 index cae67970..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm.c +++ /dev/null @@ -1,123 +0,0 @@ - -/* - * general purpose mouse support - * - * Copyright (C) 1993 Andreq Haylett - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#include -#include -#include /* strerror(); ?!? */ -#include -#include /* select(); */ -#include /* SIGPIPE */ -#include /* time() */ -#include -#include /* O_RDONLY */ -#include /* wait() */ -#include /* mkdir() */ -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ - -#include /* VT_GETSTATE */ -#include /* for serial console check */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "gpmInt.h" /* old daemon header */ -#include "message.h" - -#include "daemon.h" /* clean daemon header */ - -/* global variables that are in daemon.h */ -struct options option; /* one should be enough for us */ - -Gpm_Type *repeated_type = 0; - -/* FIXME: BRAINDEAD..ok not really, but got to leave anyway... */ - -/* argc and argv for mice initialization */ -int mouse_argc[3]; /* 0 for default (unused) and two mice */ - -char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -int opt_aged = 0; - -int statusX, statusY, statusB; /* to return info */ - -/* - * all the values duplicated for dual-mouse operation are - * now in this structure (see gpmInt.h) - * mouse_table[0] is single mouse, mouse_table[1] and mouse_table[2] - * are copied data from mouse_table[0] for dual mouse operation. - */ - -struct mouse_features mouse_table[3] = { - { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - (char *) NULL /* extra */ , - -1, - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, 0 /* scaley */ , - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, - DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (Gpm_Type *) NULL} -}; - -struct mouse_features *which_mouse; - -/* These are only the 'global' options */ - -char *opt_lut = DEF_LUT; - -int opt_test = DEF_TEST; - -int opt_ptrdrag = DEF_PTRDRAG; - -int opt_double = 0; - -char *opt_special = NULL; /* special commands, like reboot or such */ - -int opt_rawrep = 0; - -struct winsize win; - -int maxx, maxy; - -int fifofd = -1; - -int eventFlag = 0; - -Gpm_Cinfo *cinfo[MAX_VC + 1]; - -time_t last_selection_time; - -time_t opt_age_limit = 0; - -int opt_resize = 0; /* not really an option */ - -int statusC = 0; /* clicks */ - -void get_console_size(Gpm_Event * ePtr); - -/* in daemon.h */ -fd_set selSet, readySet, connSet; diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm_exited.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm_exited.c deleted file mode 100644 index 9c0b8efc..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/gpm_exited.c +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* unlink,geteuid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* what todo atexit */ -void gpm_exited(void) -{ - gpm_report(GPM_PR_DEBUG, GPM_MESS_REMOVE_FILES, GPM_NODE_PID, GPM_NODE_CTL); - unlink(GPM_NODE_PID); - unlink(GPM_NODE_CTL); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/init_mice.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/init_mice.c deleted file mode 100644 index c41361d9..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/init_mice.c +++ /dev/null @@ -1,52 +0,0 @@ - -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: mice initialization. currently print mice. */ - -/* RETURN: 0 - failed to init one or more devices - 1 - init was fine */ - -/* COMMENT: does error handling and exiting itself */ -int init_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - while(tmp != NULL) { /* there are still mice to init */ - gpm_report(GPM_PR_DEBUG, "initialize %s with proto %s", tmp->device, - tmp->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG, "and options %s", tmp->options); - } - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG, "finished initialization"); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/loadlut.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/loadlut.c deleted file mode 100644 index b2406394..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/loadlut.c +++ /dev/null @@ -1,90 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* datatypes */ -#include /* open */ -#include /* malloc */ -#include /* str* */ -#include /* errno.h */ -#include /* getuid */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* GPM_SYS_CONSOLE */ - -int loadlut(char *charset) -{ - int i, c, fd; - - unsigned char this, next; - - static uint32_t long_array[9] = { - 0x05050505, /* ugly, but preserves alignment */ - 0x00000000, /* control chars */ - 0x00000000, /* digits */ - 0x00000000, /* uppercase and '_' */ - 0x00000000, /* lowercase */ - 0x00000000, /* Latin-1 control */ - 0x00000000, /* Latin-1 misc */ - 0x00000000, /* Latin-1 uppercase */ - 0x00000000 /* Latin-1 lowercase */ - }; - -#define inwordLut (long_array+1) - - for(i = 0; charset[i];) { - i += getsym((unsigned char *) charset + i, &this); - if(charset[i] == '-' && charset[i + 1] != '\0') - i += getsym((unsigned char *) charset + i + 1, &next) + 1; - else - next = this; - for(c = this; c <= next; c++) - inwordLut[c >> 5] |= 1 << (c & 0x1F); - } - - if((fd = open(option.consolename, O_WRONLY)) < 0) { - /* - * try /dev/console, if /dev/tty0 failed -- is that really senseful ??? - */ - free(option.consolename); /* allocated by main */ - if((option.consolename = malloc(strlen(GPM_SYS_CONSOLE) + 1)) == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - - /* - * FIXME: remove hardcoded device names - */ - strcpy(option.consolename, GPM_SYS_CONSOLE); - - if((fd = open(option.consolename, O_WRONLY)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN_CON); - } - if(ioctl(fd, TIOCLINUX, &long_array) < 0) { /* fd <0 is checked */ - if(errno == EPERM && getuid()) - gpm_report(GPM_PR_WARN, GPM_MESS_ROOT); /* why do we still - * continue? */ - else if(errno == EINVAL) - gpm_report(GPM_PR_OOPS, GPM_MESS_CSELECT); - } - close(fd); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/main.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/main.c deleted file mode 100644 index 2c2b6446..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/main.c +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * general purpose mouse support for Linux - * - * *main.c* - * - * Copyright (c) 2002 Nico Schottelius - * - * small main routine - * - * isn't that a nice clean function ? - * - * 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. - ********/ - -#include "daemon.h" - -int main(int argc, char **argv) -{ - startup(argc, argv); /* setup configurations */ - old_main(); /* LATER: exit(daemon()); */ - return 0; /* if we didn't exit before, just give back - * success */ -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/old_main.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/old_main.c deleted file mode 100644 index 2e2e7909..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/old_main.c +++ /dev/null @@ -1,321 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* UNIX */ -#include /* SOCKET */ -#include /* open */ -#include /* guess again */ -#include /* guess again */ -#include /* unlink */ -#include /* chmod */ - -#include /* linux hd* */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* daemon internals */ - -#ifndef max -# define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -int realposx = -1; - -int realposy = -1; - -int old_main() -{ - int ctlfd, newfd; - - struct sockaddr_un ctladdr; - - int i, len, kd_mode, fd; - - struct timeval timeout; - - int maxfd = -1; - - int pending; - - Gpm_Event event; - - for(i = 1; i <= 1 + opt_double; i++) { - which_mouse = mouse_table + i; /* used to access options */ - - if(!(which_mouse->opt_dev)) - gpm_report(GPM_PR_OOPS, GPM_MESS_NEED_MDEV); - - if(!strcmp((which_mouse->opt_dev), "-")) - fd = 0; /* use stdin */ - else if((fd = open((which_mouse->opt_dev), O_RDWR | O_NDELAY)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, (which_mouse->opt_dev)); - - /* - * and then reset the flag - */ - fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NDELAY); - - /* - * create argc and argv for this device - */ - mouse_argv[i] = - build_argv((which_mouse->opt_type), (which_mouse->opt_options), - &mouse_argc[i], ','); - - /* - * init the device, and use the return value as new mouse type - */ - if((which_mouse->m_type)->init) - (which_mouse->m_type) = - ((which_mouse->m_type)->init) (fd, (which_mouse->m_type)->flags, - (which_mouse->m_type), mouse_argc[i], - mouse_argv[i]); - if(!(which_mouse->m_type)) - gpm_report(GPM_PR_OOPS, GPM_MESS_MOUSE_INIT); - - which_mouse->fd = fd; - maxfd = max(fd, maxfd); - } - -/*....................................... catch interesting signals */ - - signal(SIGTERM, gpm_killed); - signal(SIGINT, gpm_killed); - signal(SIGUSR1, gpm_killed); /* usr1 is used by a new gpm killing the old */ - signal(SIGWINCH, gpm_killed); /* winch can be sent if console is - * resized */ - -/*....................................... create your nodes */ - - /* - * control node - */ - - if((ctlfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - gpm_report(GPM_PR_OOPS, GPM_MESS_SOCKET_PROB); - memset((char *) &ctladdr, 0, sizeof(ctladdr)); - ctladdr.sun_family = AF_UNIX; - strcpy(ctladdr.sun_path, GPM_NODE_CTL); - unlink(GPM_NODE_CTL); - - len = sizeof(ctladdr.sun_family) + strlen(GPM_NODE_CTL); - if(bind(ctlfd, (struct sockaddr *) (&ctladdr), len) == -1) - gpm_report(GPM_PR_OOPS, GPM_MESS_BIND_PROB, ctladdr.sun_path); - maxfd = max(maxfd, ctlfd); - - /* - * needs to be 0777, so all users can _try_ to access gpm - */ - chmod(GPM_NODE_CTL, 0777); - - get_console_size(&event); /* get screen dimensions */ - -/*....................................... wait for mouse and connections */ - - listen(ctlfd, 5); /* Queue up calls */ - -#define NULL_SET ((fd_set *)NULL) -#define resetTimeout() (timeout.tv_sec=SELECT_TIME,timeout.tv_usec=0) - - FD_ZERO(&connSet); - FD_SET(ctlfd, &connSet); - - if(opt_double) - FD_SET(mouse_table[2].fd, &connSet); - - readySet = connSet; - FD_SET(mouse_table[1].fd, &readySet); - - signal(SIGPIPE, SIG_IGN); /* WARN */ - -/*--------------------------------------- main loop begins here */ - - while(1) { - selSet = readySet; - resetTimeout(); - if(opt_test) - timeout.tv_sec = 0; - - if(eventFlag) { /* an event left over by clustering */ - pending = 1; - FD_ZERO(&selSet); - FD_SET(mouse_table[eventFlag].fd, &selSet); - } else - while((pending = - select(maxfd + 1, &selSet, NULL_SET, NULL_SET, - &timeout)) == 0) { - selSet = readySet; - resetTimeout(); - } /* go on */ - - if(opt_resize) { /* did the console resize? */ - get_console_size(&event); - opt_resize--; - signal(SIGWINCH, gpm_killed); /* reinstall handler */ - - /* - * and notify clients - */ - for(i = 0; i < MAX_VC + 1; i++) { - Gpm_Cinfo *ci; - - for(ci = cinfo[i]; ci; ci = ci->next) - kill(ci->data.pid, SIGWINCH); - } - } - - if(pending < 0) { - if(errno == EBADF) - gpm_report(GPM_PR_OOPS, GPM_MESS_SELECT_PROB); - gpm_report(GPM_PR_ERR, GPM_MESS_SELECT_STRING, strerror(errno)); - selSet = readySet; - resetTimeout(); - continue; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_SELECT_TIMES, pending); - -/*....................................... manage graphic mode */ - - /* - * Be sure to be in text mode. This used to be before select, - * but actually it only matters if you have events. - */ - { - int fd = open_console(O_RDONLY); - - if(ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_KDGETMODE); - close(fd); - if(kd_mode != KD_TEXT && !option.repeater) { - wait_text(&mouse_table[1].fd); - maxfd = max(maxfd, mouse_table[1].fd); - readySet = connSet; - FD_SET(mouse_table[1].fd, &readySet); - continue; /* reselect */ - } - } - -/*....................................... got mouse, process event */ - -/* - * Well, actually, run a loop to maintain inlining of functions without - * lenghtening the file. This is not too clean a code, but it works.... - */ - - for(i = 1; i <= 1 + opt_double; i++) { - which_mouse = mouse_table + i; /* used to access options */ - if(FD_ISSET(which_mouse->fd, &selSet)) { - FD_CLR(which_mouse->fd, &selSet); - pending--; - if(processMouse(which_mouse->fd, &event, kd_mode)) - - /* - * pass it to the client, if any or to the default handler, if - * any or to the selection handler - */ - if(cinfo[event.vc]) - if(!do_client(cinfo[event.vc], &event)) - if(cinfo[0]) - if(!do_client(cinfo[0], &event)) - do_selection(&event); - - /* - * Same idea as above, just here for documentation (cinfo[event.vc] - * && do_client(cinfo[event.vc], &event)) || (cinfo[0] && - * do_client(cinfo[0], &event)) || do_selection(&event); - */ - } - } - - /* - * ..................... got connection, process it - */ - - if(pending && FD_ISSET(ctlfd, &selSet)) { - FD_CLR(ctlfd, &selSet); - pending--; - newfd = processConn(ctlfd); - if(newfd >= 0) { - FD_SET(newfd, &connSet); - FD_SET(newfd, &readySet); - maxfd = max(maxfd, newfd); - } - } - - /* - * ........................ got request - */ - - /* - * itz 10-22-96 check _all_ clients, not just those on top! - */ - for(i = 0; pending && (i <= MAX_VC); i++) { - Gpm_Cinfo *ci; - - for(ci = cinfo[i]; pending && ci; ci = ci->next) { - if(FD_ISSET(ci->fd, &selSet)) { - FD_CLR(ci->fd, &selSet); - pending--; - /* - * itz Sat Sep 12 21:10:22 PDT 1998 - */ - /* - * this code is clearly incorrect; the next highest descriptor - * after the one we're closing is not necessarily being used. - * Fortunately, it doesn't hurt simply to leave this out. - */ - -#ifdef NOTDEF - if((processRequest(ci, i) == -1) && maxfd == ci->fd) - maxfd--; -#else - (void) processRequest(ci, i); -#endif - } - } - } - - /* - * .................. look for a spare fd - */ - - /* - * itz 10-22-96 this shouldn't happen now! - */ - for(i = 0; pending && i <= maxfd; i++) { - if(FD_ISSET(i, &selSet)) { - FD_CLR(i, &selSet); - pending--; - gpm_report(GPM_PR_WARN, GPM_MESS_STRANGE_DATA, i); - } - } - - /* - * ................... all done. - */ - - if(pending) - gpm_report(GPM_PR_OOPS, GPM_MESS_SELECT_PROB); - } /* while(1) */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/open_console.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/open_console.c deleted file mode 100644 index a71effba..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/open_console.c +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open and co. */ -#include /* stat() */ -#include /* ioctl() */ - -/* Linux specific (to be outsourced in gpm2 */ -#include /* for serial console check */ -#include /* for serial console check */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - - int maj; - - int twelve = 12; - -// struct serial_struct si; - struct stat sb; - - fd = open(option.consolename, mode); - if(fd != -1) { - fstat(fd, &sb); - maj = major(sb.st_rdev); - if(maj != 4 && (maj < 136 || maj > 143)) { - if(ioctl(fd, TIOCLINUX, &twelve) < 0) { - /* - * FIXME: si.line is not initialized, but used! - */ - // if (si.line > 0) { - // gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_SERIALCON); - // } - } - } - } else { - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN_CON); - } - - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/processconn.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/processconn.c deleted file mode 100644 index f9096f9a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/processconn.c +++ /dev/null @@ -1,182 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* accept */ -#include /* malloc */ -#include /* close */ -#include /* unix socket */ -#include /* stat */ -#include /* str* */ -#include /* errno.h */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int processConn(int fd) -{ /* returns newfd or -1 */ - Gpm_Cinfo *info; - - Gpm_Connect *request; - - Gpm_Cinfo *next; - - int vc, newfd; - - socklen_t len; - - struct sockaddr_un addr; /* reuse this each time */ - - struct stat statbuf; - - uid_t uid; - - char *tty = NULL; - -/*....................................... Accept */ - - memset((char *) &addr, 0, sizeof(addr)); - addr.sun_family = AF_UNIX; - - len = sizeof(addr); - if((newfd = accept(fd, (struct sockaddr *) &addr, &len)) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_ACCEPT_FAILED, strerror(errno)); - return -1; - } - - gpm_report(GPM_PR_DEBUG, GPM_MESS_CONECT_AT, newfd); - - info = malloc(sizeof(Gpm_Cinfo)); - if(!info) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - request = &(info->data); - - if(get_data(request, newfd) == -1) { - free(info); - close(newfd); - return -1; - } - - if((vc = request->vc) > MAX_VC) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC); - free(info); - close(newfd); - return -1; - } -#ifndef SO_PEERCRED - if(stat(addr.sun_path, &statbuf) == -1 || !S_ISSOCK(statbuf.st_mode)) { - gpm_report(GPM_PR_ERR, GPM_MESS_ADDRES_NSOCKET, addr.sun_path); - free(info); /* itz 10-12-95 verify client's right */ - close(newfd); - return -1; /* to read requested tty */ - } - - unlink(addr.sun_path); /* delete socket */ - - staletime = time(0) - 30; - if(statbuf.st_atime < staletime - || statbuf.st_ctime < staletime || statbuf.st_mtime < staletime) { - gpm_report(GPM_PR_ERR, GPM_MESS_SOCKET_OLD); - free(info); - close(newfd); - return -1; /* socket is ancient */ - } - - uid = statbuf.st_uid; /* owner of socket */ -#else - { - struct ucred sucred; - - socklen_t credlen = sizeof(struct ucred); - - if(getsockopt(newfd, SOL_SOCKET, SO_PEERCRED, &sucred, &credlen) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_GETSOCKOPT, strerror(errno)); - free(info); - close(newfd); - return -1; - } - uid = sucred.uid; - gpm_report(GPM_PR_DEBUG, GPM_MESS_PEER_SCK_UID, uid); - } -#endif - if(uid != 0) { - if((tty = - malloc(strlen(option.consolename) + Gpm_cnt_digits(vc) + - sizeof(char))) == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - - strncpy(tty, option.consolename, strlen(option.consolename) - 1); - sprintf(&tty[strlen(option.consolename) - 1], "%d", vc); - - if(stat(tty, &statbuf) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_STAT_FAILS, tty); - free(info); - free(tty); - close(newfd); - return -1; - } - if(uid != statbuf.st_uid) { - gpm_report(GPM_PR_WARN, GPM_MESS_FAILED_CONNECT, uid, tty); /* SUSPECT! - */ - free(info); - free(tty); - close(newfd); - return -1; - } - free(tty); /* at least here it's not needed anymore */ - } - - /* - * register the connection information in the right place - */ - info->next = next = cinfo[vc]; - info->fd = newfd; - cinfo[vc] = info; - gpm_report(GPM_PR_DEBUG, GPM_MESS_LONG_STATUS, - request->pid, request->vc, request->eventMask, - request->defaultMask, request->minMod, request->maxMod); - - /* - * if the client gets motions, give it the current position - */ - if(request->eventMask & GPM_MOVE) { - // Gpm_Event event={0, 0, vc, 0, 0, statusX, statusY, GPM_MOVE, 0, 0}; - - Gpm_Event event; - - event.buttons = 0; - event.modifiers = 0; - event.vc = vc; - event.dx = 0; - event.dy = 0; - event.x = statusX; - event.y = statusY; - event.type = GPM_MOVE; - event.clicks = 0; - event.margin = 0; - event.wdx = 0; - event.wdy = 0; - - do_client(info, &event); - } - - return newfd; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/processmouse.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/processmouse.c deleted file mode 100644 index 721e34f4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/processmouse.c +++ /dev/null @@ -1,449 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * call getMouseData to get hardware device data, call mouse device's fun() - * to retrieve the hardware independent event data, then optionally repeat - * the data via repeat_fun() to the repeater device - * - ********/ - -#include /* stat */ -#include /* KD */ -#include /* vt */ -#include /* open */ -#include /* close */ -#include /* time */ -#include /* gettimeofday */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000 + \ - (t2.tv_usec-t1.tv_usec)/1000) - -int processMouse(int fd, Gpm_Event * event, int kd_mode) -{ - unsigned char *data; - - static int fine_dx, fine_dy, i, j, m, newB = 0, /* old buttons and Type - * to chain events */ - oldB = 0, oldT = 0; - - static Gpm_Event nEvent; - - static struct vt_stat stat; - static struct timeval tv1 = { 0, 0 }, tv2; /* tv1==0: first click is - * single */ - static struct timeval timeout = { 0, 0 }; - fd_set fdSet; - - int tempx, tempy; - - static int oldx, oldy; - - oldT = event->type; - - if(eventFlag) { - eventFlag = 0; - - if((which_mouse->m_type)->absolute) { /* a pen or other absolute - * device */ - event->x = nEvent.x; - event->y = nEvent.y; - } - event->dx = nEvent.dx; - event->dy = nEvent.dy; - event->buttons = nEvent.buttons; - } else { - event->dx = event->dy = 0; - event->wdx = event->wdy = 0; - nEvent.modifiers = 0; /* some mice set them */ - i = 0; - - FD_ZERO(&fdSet); - FD_SET(fd, &fdSet); - - /* - * use uncalibrated values as base values - */ - if((which_mouse->opt_calib != NULL) && (which_mouse->m_type->absolute)) { - nEvent.x = oldx; - nEvent.y = oldy; - } - - do { /* cluster loop */ - if(((data = getMouseData(fd, (which_mouse->m_type), kd_mode)) == NULL) - || ((*((which_mouse->m_type)->fun)) (&nEvent, data) == -1)) { - - if(!i) { - return 0; - } else { - break; - } - } - - event->modifiers = nEvent.modifiers; /* propagate modifiers */ - - /* - * propagate buttons - */ - nEvent.buttons = ((which_mouse->opt_sequence)[nEvent.buttons & 7] & 7) | (nEvent.buttons & ~7); /* change - * the - * order - */ - oldB = newB; - newB = nEvent.buttons; - - if(!i) - event->buttons = nEvent.buttons; - - if(oldB != newB) { - eventFlag = (i != 0) * (which_mouse - mouse_table); /* 1 or 2 */ - break; - } - - /* - * propagate movement - */ - if(!((which_mouse->m_type)->absolute)) { /* mouse */ - if(abs(nEvent.dx) + abs(nEvent.dy) > (which_mouse->opt_delta)) - nEvent.dx *= (which_mouse->opt_accel), nEvent.dy *= - (which_mouse->opt_accel); - - /* - * increment the reported dx,dy - */ - event->dx += nEvent.dx; - event->dy += nEvent.dy; - } else { /* a pen */ - /* - * get dx,dy to check if there has been movement - */ - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - - /* - * propagate wheel - */ - event->wdx += nEvent.wdx; - event->wdy += nEvent.wdy; - - select(fd + 1, &fdSet, (fd_set *) NULL, (fd_set *) NULL, &timeout /* zero - */ ); - - } while(i++ < (which_mouse->opt_cluster) && nEvent.buttons == oldB - && FD_ISSET(fd, &fdSet)); - - /* - * apply calibration - */ - if((which_mouse->opt_calib != NULL) && (which_mouse->m_type->absolute)) { - - /* - * save uncalibrated values for use next time around - */ - oldx = nEvent.x; - oldy = nEvent.y; - - /* - * do calculations in a larger variable - */ - tempx = nEvent.x; - tempy = nEvent.y; - tempx -= which_mouse->opt_dminx; - tempx *= (which_mouse->opt_omaxx - which_mouse->opt_ominx); - tempx /= (which_mouse->opt_dmaxx - which_mouse->opt_dminx); - tempx += which_mouse->opt_ominx; - - tempy -= which_mouse->opt_dminy; - tempy *= (which_mouse->opt_omaxy - which_mouse->opt_ominy); - tempy /= (which_mouse->opt_dmaxy - which_mouse->opt_dminy); - tempy += which_mouse->opt_ominy; - - nEvent.x = tempx; - nEvent.y = tempy; - - event->dx = (nEvent.x) - (event->x); - event->dy = (nEvent.y) - (event->y); - } - } /* if(eventFlag) */ - -/*....................................... update the button number */ - - if((event->buttons & GPM_B_MIDDLE) && !(which_mouse->opt_three)) - (which_mouse->opt_three)++; - -/*....................................... we're a repeater, aren't we? */ - - if(kd_mode != KD_TEXT) { - if(fifofd != -1 && !opt_rawrep) { - if((which_mouse->m_type)->absolute) { /* hof Wed Feb 3 21:43:28 MET - * 1999 */ - /* - * prepare the values from a absolute device for repeater mode - */ - static struct timeval rept1, rept2; - - gettimeofday(&rept2, (struct timezone *) NULL); - if(((rept2.tv_sec - rept1.tv_sec) - * 1000 + (rept2.tv_usec - rept1.tv_usec) / 1000) > 250) { - event->dx = 0; - event->dy = 0; - } - rept1 = rept2; - - /* - * if the values are calibrated, this is not necessary - */ - if(which_mouse->opt_calib == NULL) - event->dy = event->dy * ((win.ws_col / win.ws_row) + 1); - - event->x = nEvent.x; - event->y = nEvent.y; - } - - /* - * not all relative repeaters can handle big changes, so repackage - * into several smaller updates - */ - if(!repeated_type->absolute) { - int remx, remy; - - remx = event->dx; - remy = event->dy; - - do { - if(remx < 0) { - if(remx >= -127) { - event->dx = remx; - remx = 0; - } else { - event->dx = -127; - remx += 127; - } - } - if(remx > 0) { - if(remx <= 127) { - event->dx = remx; - remx = 0; - } else { - event->dx = 127; - remx -= 127; - } - } - if(remy < 0) { - if(remy >= -127) { - event->dy = remy; - remy = 0; - } else { - event->dy = -127; - remy += 127; - } - } - if(remy > 0) { - if(remy <= 127) { - event->dy = remy; - remy = 0; - } else { - event->dy = 127; - remy -= 127; - } - } - repeated_type->repeat_fun(event, fifofd); - } while((remx != 0) || (remy != 0)); - } else - repeated_type->repeat_fun(event, fifofd); /* itz Jan 11 1999 */ - } - return 0; /* no events nor information for clients */ - } - - /* - * first if of these three - */ - /* - * ....................................... no, we arent a repeater, go on - */ - /* - * use fine delta values now, if delta is the information - */ - if(!((which_mouse->m_type))->absolute) { - fine_dx += event->dx; - fine_dy += event->dy; - event->dx = fine_dx / (which_mouse->opt_scale); - event->dy = fine_dy / (which_mouse->opt_scaley); - fine_dx %= (which_mouse->opt_scale); - fine_dy %= (which_mouse->opt_scaley); - } - - /* - * up and down, up and down, ... who does a do..while(0) loop ??? and then - * makes a break into it... argh ! - */ - - /* - * rodney 13/mar/2008 wheel movement similar to mouse movement must also be - * excluded from time (click) processing - */ - if(!event->dx && !event->dy - && !event->wdx && !event->wdy && (event->buttons == oldB)) - do { /* so to break */ - static long awaketime; - - /* - * Ret information also if never happens, but enough time has elapsed. - * Note: return 1 will segfault due to missing event->vc; FIXME! - */ - if(time(NULL) <= awaketime) - return 0; - awaketime = time(NULL) + 1; - break; - } while(0); - -/*....................................... fill missing fields */ - - event->x += event->dx, event->y += event->dy; - statusB = event->buttons; - - i = open_console(O_RDONLY); - /* - * modifiers - */ - j = event->modifiers; /* save them */ - event->modifiers = 6; /* code for the ioctl */ - if(ioctl(i, TIOCLINUX, &(event->modifiers)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_GET_SHIFT_STATE); - event->modifiers |= j; /* add mouse-specific bits */ - - /* - * status - */ - j = stat.v_active; - if(ioctl(i, VT_GETSTATE, &stat) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_GET_CONSOLE_STAT); - - /* - * if we changed console, request the current console size, - * as different consoles can be of different size - */ - if(stat.v_active != j) - get_console_size(event); - close(i); - - event->vc = stat.v_active; - - if(oldB == event->buttons) - event->type = (event->buttons ? GPM_DRAG : GPM_MOVE); - else - event->type = (event->buttons > oldB ? GPM_DOWN : GPM_UP); - - switch (event->type) { /* now provide the cooked bits */ - case GPM_DOWN: - GET_TIME(tv2); - - /* - * check first click - */ - if(tv1.tv_sec && (DIF_TIME(tv1, tv2) < (which_mouse->opt_time))) { - statusC++; - statusC %= 3; /* 0, 1 or 2 */ - } else - statusC = 0; - event->type |= (GPM_SINGLE << statusC); - break; - - case GPM_UP: - GET_TIME(tv1); - event->buttons ^= oldB; /* for button-up, tell which one */ - event->type |= (oldT & GPM_MFLAG); - event->type |= (GPM_SINGLE << statusC); - break; - - case GPM_DRAG: - event->type |= GPM_MFLAG; - event->type |= (GPM_SINGLE << statusC); - break; - - case GPM_MOVE: - statusC = 0; - default: - break; - } - event->clicks = statusC; - -/* UGLY - FIXME! */ - -/* The current policy is to force the following behaviour: - * - At buttons up, must fit inside the screen, though flags are set. - * - At button down, allow going outside by one single step - */ - - /* - * selection used 1-based coordinates, so do I - */ - - /* - * 1.05: only one margin is current. Y takes priority over X. - * The i variable is how much margin is allowed. "m" is which one is there. - */ - - m = 0; - i = ((event->type & (GPM_DRAG | GPM_UP)) != 0); /* i is boolean */ - - if(event->y > win.ws_row) { - event->y = win.ws_row + 1 - !i; - i = 0; - m = GPM_BOT; - } else if(event->y <= 0) { - event->y = 1 - i; - i = 0; - m = GPM_TOP; - } - - if(event->x > win.ws_col) { - event->x = win.ws_col + 1 - !i; - if(!m) - m = GPM_RGT; - } else if(event->x <= 0) { - event->x = 1 - i; - if(!m) - m = GPM_LFT; - } - - event->margin = m; - - gpm_report(GPM_PR_DEBUG, - "dx: %3i dy: %3i x: %3i y: %3i butt: %i vc: %i clicks: %i", - event->dx, event->dy, event->x, event->y, event->buttons, - event->vc, event->clicks); - - /* - * update the global state - */ - statusX = event->x; - statusY = event->y; - - if(opt_special && event->type & GPM_DOWN) - return processSpecial(event); - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/processrequest.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/processrequest.c deleted file mode 100644 index e19b5ede..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/processrequest.c +++ /dev/null @@ -1,133 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* close */ -#include /* open */ -#include /* free */ -#include /* vt */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int processRequest(Gpm_Cinfo * ci, int vc) -{ - int i; - - Gpm_Cinfo *cinfoPtr; - - Gpm_Cinfo *next; - - Gpm_Connect conn; - - static Gpm_Event event; - - static struct vt_stat stat; - - gpm_report(GPM_PR_INFO, GPM_MESS_CON_REQUEST, ci->fd, vc); - - if(vc > MAX_VC) - return -1; - - /* - * itz 10-22-96 this shouldn't happen now - */ - if(vc == -1) - gpm_report(GPM_PR_OOPS, GPM_MESS_UNKNOWN_FD); - - i = get_data(&conn, ci->fd); - - if(!i) { /* no data */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_CLOSE); - close(ci->fd); - FD_CLR(ci->fd, &connSet); - FD_CLR(ci->fd, &readySet); - if(cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; - cinfo[vc] = cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; - } - /* - * somewhere inside the stack, have to walk it - */ - cinfoPtr = cinfo[vc]; - while(cinfoPtr && cinfoPtr->next) { - if(cinfoPtr->next->fd == ci->fd) { - next = cinfoPtr->next; - cinfoPtr->next = next->next; - free(next); - break; - } - cinfoPtr = cinfoPtr->next; - } - return -1; - } - /* - * not data - */ - if(i == -1) - return -1; /* too few bytes */ - - if(conn.pid != 0) { - ci->data = conn; - return 0; - } - - /* - * Aha, request for information (so-called snapshot) - */ - switch (conn.vc) { - case GPM_REQ_SNAPSHOT: - i = open_console(O_RDONLY); - ioctl(i, VT_GETSTATE, &stat); - event.modifiers = 6; /* code for the ioctl */ - if(ioctl(i, TIOCLINUX, &(event.modifiers)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_GET_SHIFT_STATE); - close(i); - event.vc = stat.v_active; - event.x = statusX; - event.y = statusY; - event.dx = maxx; - event.dy = maxy; - event.buttons = statusB; - event.clicks = statusC; - /* - * fall through - */ - /* - * missing break or do you want this ??? - */ - - case GPM_REQ_BUTTONS: - event.type = ((which_mouse->opt_three) == 1 ? 3 : 2); /* buttons */ - write(ci->fd, &event, sizeof(Gpm_Event)); - break; - - case GPM_REQ_NOPASTE: - disable_paste(vc); - break; - } - - return 0; -} - -/*-------------------------------------------------------------------*/ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/processspecial.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/processspecial.c deleted file mode 100644 index 4c3f348a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/processspecial.c +++ /dev/null @@ -1,191 +0,0 @@ - -/* - * special commands support for gpm - * - * Copyright 1996 Alessandro Rubini - * Copyright 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius - * - * Based on an idea by KARSTEN@piobelix.physik.uni-karlsruhe.de - * (Karsten Ballueder) - * - * 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. - ********/ - -/* This file is compiled conditionally, see the Makefile */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpmInt.h" -#include "daemon.h" /* daemon internals */ - -/* - * This function is only called at button press, to avoid unnecessary - * overhead due to function call at every mouse event - */ - -static int special_status = 0; /* turns on when active */ - -static int did_parse = 0; - - /* - * The actions are described by these strings. The default is: - * left: kill -2 init - * middle: shutdown -h now - * right: shutdown -r now - * - * such a default can be overridden by the argument of the "-S" command. - * This arg is a colon-separated list of commands. An empty command - * is used to make gpm kill init - */ - -static char *commandL = NULL; /* kill init */ - -static char *commandM = "shutdown -h now"; - -static char *commandR = "shutdown -r now"; - -/* - * The return value is 0 if the event has been eaten, - * 1 if the event is passed on - */ -int processSpecial(Gpm_Event * event) -{ - char *command = NULL; - - int i; - - FILE *consolef; - - if((event->type & GPM_TRIPLE) - && (event->buttons == (GPM_B_LEFT | GPM_B_RIGHT))) /* trigger */ - special_status = time(NULL); - - if(!special_status) /* not triggered: return */ - return 1; - - /* - * devfs change - */ - consolef = fopen(option.consolename, "w"); - if(!consolef) - consolef = stderr; - if(event->type & GPM_TRIPLE) { /* just triggered: make noise and - * return */ - if(!did_parse) { - did_parse++; - if(opt_special && opt_special[0]) { /* not empty */ - commandL = opt_special; - commandM = strchr(opt_special, ':'); - if(commandM) { - *commandM = '\0'; - commandM++; - commandR = strchr(commandM, ':'); - if(commandR) { - *commandR = '\0'; - commandR++; - } - } - } - } - fprintf(consolef, "\n%s: release all the mouse buttons and press " - "one of them\n\twithin three seconds in order to invoke " - "a special command\a\a\a\n", option.progname); -#ifdef DEBUG - fprintf(consolef, - "gpm special: the commands are \"%s\", \"%s\", \"%s\"\n", - commandL, commandM, commandR); -#endif - if(consolef != stderr) - fclose(consolef); - return 0; /* eaten */ - } - - if(time(NULL) > special_status + 3) { - fprintf(consolef, "\n%s: timeout: no special command taken\n", - option.progname); - if(consolef != stderr) - fclose(consolef); - special_status = 0; - return 0; /* eaten -- don't paste or such on this event */ - } - special_status = 0; /* run now, prevent running next time */ -#ifdef DEBUG - fprintf(consolef, "going to run: buttons is %i\n", event->buttons); -#endif - switch (event->buttons) { - case GPM_B_LEFT: - command = commandL; - break; - case GPM_B_MIDDLE: - command = commandM; - break; - case GPM_B_RIGHT: - command = commandR; - break; - default: - fprintf(consolef, "\n%s: more than one button: " - "special command discarded\n", option.progname); - if(consolef != stderr) - fclose(consolef); - return 0; /* eaten */ - } - fprintf(consolef, "\n%s: executing ", option.progname); - - if(!command || !command[0]) { - fprintf(consolef, "hard reboot (by signalling init)\n"); - if(consolef != stderr) - fclose(consolef); - kill(1, 2); /* kill init: shutdown now */ - return 0; - } - - fprintf(consolef, "\"%s\"\n", command); - if(consolef != stderr) - fclose(consolef); - - switch (fork()) { - case -1: /* error */ - fprintf(stderr, "%s: fork(): %s\n", option.progname, strerror(errno)); - return 0; /* Hmmm.... error */ - - case 0: /* child */ - close(0); - close(1); - close(2); - open(GPM_NULL_DEV, O_RDONLY); /* stdin */ - open(option.consolename, O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - - if(open_max == -1) - open_max = 1024; - for(i = 3; i < open_max; i++) - close(i); - execl("/bin/sh", "sh", "-c", command, (char *) NULL); - exit(1); /* shouldn't happen */ - - default: /* parent */ - return 0; - } -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/reset_mice.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/reset_mice.c deleted file mode 100644 index 05692a85..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/reset_mice.c +++ /dev/null @@ -1,60 +0,0 @@ - -/* - * general purpose mouse support for Linux - * - * *several tools only needed by the server* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * - * 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. - ********/ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" - -#include /* malloc() */ - -/* DESCR: when leaving, we should reset mice to their normal state */ - -/* RETURN: 0 - failed to reset one or more devices - 1 - reset was fine */ - -/* COMMENT: does error handling and exiting itself */ -int reset_mice(struct micetab *micelist) -{ - struct micetab *tmp = micelist; - - struct micetab *end = tmp; - - while(tmp != NULL) { /* FIXME! I never get NULL, as free()d before */ - end = tmp; - while(tmp->next != NULL) { /* set end to the last mouse */ - end = tmp; - tmp = tmp->next; - } - - gpm_report(GPM_PR_DEBUG, "reset: %s with proto %s", end->device, - end->protocol); - if(tmp->options != NULL) { - gpm_report(GPM_PR_DEBUG, "and options %s", end->options); - } - free(end); /* be clean() */ - tmp = micelist; /* reset to the first mice again */ - } - - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/selection_copy.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/selection_copy.c deleted file mode 100644 index 8b2275c6..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/selection_copy.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* open */ -#include /* close */ -#include /* time */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void selection_copy(int x1, int y1, int x2, int y2, int mode) -{ - -/* - * The approach in "selection" causes a bus error when run under SunOS 4.1 - * due to alignment problems... - */ - unsigned char buf[6 * sizeof(short)]; - - unsigned short *arg = (unsigned short *) buf + 1; - - int fd; - - buf[sizeof(short) - 1] = 2; /* set selection */ - - arg[0] = (unsigned short) x1; - arg[1] = (unsigned short) y1; - arg[2] = (unsigned short) x2; - arg[3] = (unsigned short) y2; - arg[4] = (unsigned short) mode; - - if((fd = open_console(O_WRONLY)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN_CON); - /* - * FIXME: should be replaced with string constant (message.h) - */ - gpm_report(GPM_PR_DEBUG, "ctl %i, mode %i", (int) *buf, arg[4]); - if(ioctl(fd, TIOCLINUX, buf + sizeof(short) - 1) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_TIOCLINUX); - close(fd); - - if(mode < 3) { - opt_aged = 0; - last_selection_time = time(0); - } -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/selection_paste.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/selection_paste.c deleted file mode 100644 index 89cf7b31..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/selection_paste.c +++ /dev/null @@ -1,50 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* time */ -#include /* open */ -#include /* close */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -void selection_paste(void) -{ - char c = 3; - - int fd; - - if(!opt_aged && (0 != opt_age_limit) && - (last_selection_time + opt_age_limit < time(0))) { - opt_aged = 1; - } - - if(opt_aged) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_SKIP_PASTE); - return; - } - - fd = open_console(O_WRONLY); - if(ioctl(fd, TIOCLINUX, &c) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_TIOCLINUX); - close(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/startup.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/startup.c deleted file mode 100644 index e43fc31f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/startup.c +++ /dev/null @@ -1,199 +0,0 @@ - -/* - * general purpose mouse support for Linux - * - * *Startup and Daemon functions* - * - * Copyright (c) 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#include /* atexit() */ -#include /* strlen() */ -#include /* errno */ -#include /* unlink,geteuid */ -#include /* geteuid, mknod */ -#include /* mknod */ -#include /* mknod */ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" -#include "gpm2-import.h" - -void startup(int argc, char **argv) -{ - int i, opt; - - FILE *calib_file; - - static struct { - char *in; - char *out; - } seq[] = { - { - "123", "01234567"}, { - "132", "02134657"}, { - "213", "01452367"}, /* warning: these must be readable as - * integers... */ - { - "231", "02461357"}, { - "312", "04152637"}, { - "321", "04261537"}, { - NULL, NULL} - }; - - /* - * log to debug, who we are - */ - gpm_report(GPM_PR_DEBUG, GPM_MESS_VERSION); - - /* - * basic settings - */ - option.run_status = GPM_RUN_STARTUP; /* 10,9,8,... let's go */ - option.autodetect = 0; /* no mouse autodection */ - option.progname = argv[0]; /* who we are */ - option.consolename = Gpm_get_console(); /* get consolename */ - - /* - * basic2: are not necessary for oops()ing, if not root - */ - option.no_mice = 0; /* counts -m + -t */ - option.micelist = NULL; /* no mice found yet */ - option.repeater = 0; /* repeat data */ - option.repeater_type = NULL; /* type of */ - - cmdline(argc, argv); /* parse command line */ - - if(geteuid() != 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_ROOT); /* root or exit */ - - /* - * Planned for gpm-1.30, but only with devfs - */ - /* - * if(option.autodetect) autodetect(); - */ - - /****************** OLD CODE from gpn.c ***********************/ - - openlog(option.progname, LOG_PID, - option.run_status != GPM_RUN_DEBUG ? LOG_DAEMON : LOG_USER); - loadlut(opt_lut); - - if(option.repeater) { - if(mkfifo(GPM_NODE_FIFO, 0666) && errno != EEXIST) - gpm_report(GPM_PR_OOPS, GPM_MESS_CREATE_FIFO, GPM_NODE_FIFO); - if((fifofd = open(GPM_NODE_FIFO, O_RDWR | O_NONBLOCK)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, GPM_NODE_FIFO); - } - - /* - * duplicate initialization - */ - for(i = 1; i <= 1 + opt_double; i++) { - which_mouse = mouse_table + i; /* used to access options */ - if((which_mouse->opt_accel) < 1) - exit(usage("acceleration")); - if((which_mouse->opt_delta) < 2) - exit(usage("delta")); - if(strlen((which_mouse->opt_sequence)) != 3 - || atoi((which_mouse->opt_sequence)) < 100) - exit(usage("sequence")); - if((which_mouse->opt_glidepoint_tap) > 3) - exit(usage("glidepoint tap button")); - if((which_mouse->opt_glidepoint_tap)) - (which_mouse->opt_glidepoint_tap) = - GPM_B_LEFT >> ((which_mouse->opt_glidepoint_tap) - 1); - - /* - * choose the sequence - */ - for(opt = 0; - seq[opt].in && strcmp(seq[opt].in, (which_mouse->opt_sequence)); - opt++) ; - if(!seq[opt].in) - exit(usage("button sequence")); - (which_mouse->opt_sequence) = strdup(seq[opt].out); /* I can - * rewrite on - * it */ - - /* - * look for the mouse type - */ - (which_mouse->m_type) = find_mouse_by_name((which_mouse->opt_type)); - if(!(which_mouse->m_type)) /* not found */ - exit(M_listTypes()); - if(which_mouse->opt_calib != NULL) { - calib_file = fopen(which_mouse->opt_calib, "r"); - if(calib_file) { - if(fscanf(calib_file, "%i %i %i %i %i %i %i %i", - &which_mouse->opt_dminx, &which_mouse->opt_dmaxx, - &which_mouse->opt_dminy, &which_mouse->opt_dmaxy, - &which_mouse->opt_ominx, &which_mouse->opt_omaxx, - &which_mouse->opt_ominy, &which_mouse->opt_omaxy) != 8) - which_mouse->opt_calib = NULL; - if((which_mouse->opt_dminx >= which_mouse->opt_dmaxx) || - (which_mouse->opt_dminy >= which_mouse->opt_dmaxy) || - (which_mouse->opt_ominx >= which_mouse->opt_omaxx) || - (which_mouse->opt_ominy >= which_mouse->opt_omaxy)) - which_mouse->opt_calib = NULL; - } - fclose(calib_file); - } - } - - /* - * Check repeater status - */ - if(option.repeater) { - if(strcmp(option.repeater_type, "raw") == 0) - opt_rawrep = 1; - else { - /* - * look for the type - */ - repeated_type = find_mouse_by_name(option.repeater_type); - - if(!repeated_type) - exit(M_listTypes()); /* not found */ - - if(!(repeated_type->repeat_fun)) /* unsupported translation */ - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_REPEAT, option.repeater_type); - } - } - - if(option.run_status == GPM_RUN_STARTUP) { /* else is debugging */ - if(!become_daemon()) { - gpm_report(GPM_PR_OOPS, GPM_MESS_FORK_FAILED); - } - } - option.run_status = GPM_RUN_DAEMON; - - /* - * damon init: check whether we run or not, display message - */ - check_uniqueness(); - gpm_report(GPM_PR_INFO, GPM_MESS_STARTED); - - // return mouse_table[1].fd; /* the second is handled in the main() */ - - /****************** OLD CODE from gpn.c END ***********************/ - - init_mice(option.micelist); /* reads option.micelist */ - atexit(gpm_exited); /* call gpm_exited at the end */ -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/usage.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/usage.c deleted file mode 100644 index 32296998..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/usage.c +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int usage(char *whofailed) -{ - if(whofailed) { - gpm_report(GPM_PR_ERR, GPM_MESS_SPEC_ERR, whofailed, option.progname); - return 1; - } - printf(GPM_MESS_USAGE, option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, - DEF_DELTA, DEF_TIME, DEF_LUT, DEF_SCALE, DEF_SAMPLE, DEF_TYPE); - return 1; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/daemon/wait_text.c b/software/gpm/browse_source/gpm-1.99.7/src/daemon/wait_text.c deleted file mode 100644 index 730d6405..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/daemon/wait_text.c +++ /dev/null @@ -1,57 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* sleep() */ -#include /* open */ -#include /* KDGETMODE */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ -#include "gpmInt.h" /* evil old headers */ - -int wait_text(int *fdptr) -{ - int fd; - - int kd_mode; - - close(*fdptr); - do { - sleep(2); - fd = open_console(O_RDONLY); - if(ioctl(fd, KDGETMODE, &kd_mode) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_IOCTL_KDGETMODE); - close(fd); - } while(kd_mode != KD_TEXT); - - /* - * reopen, reinit (the function is only used if we have one mouse device) - */ - if((*fdptr = open((which_mouse->opt_dev), O_RDWR)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, (which_mouse->opt_dev)); - if((which_mouse->m_type)->init) - (which_mouse->m_type) = - ((which_mouse->m_type)->init) (*fdptr, (which_mouse->m_type)->flags, - (which_mouse->m_type), mouse_argc[1], - mouse_argv[1]); - return (1); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/README b/software/gpm/browse_source/gpm-1.99.7/src/drivers/README deleted file mode 100644 index 957c5b56..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/README +++ /dev/null @@ -1,32 +0,0 @@ -Write definiton of I_*, M_* and R_* in one line (needed by ./scripts/generate_drivers_header.sh). - - -This could be the home of the new driver structure in gpm2. - -Some ideas: - -- clean seperation: one directory per driver -- shared objects: make each driver being a shared object -- and put those objects into libexec? -- and make etc/gpm2/enabled_drivers a list of drivers to be enabled -- each driver has the following functions: - * int gpm2_dr__detect(struct gpm2_dr_info *): detect whether a supported mouse is connected - returns: - -1: cannot detect mice - 0: no mouse detected - 1: mouse detected - * int gpm2_dr__init(struct gpm2_dr_info *): init mouse - returns: - 0: mouse init failed - 1: mouse init success - * gpm2_dr__handle(struct gpm2_dr_info *): the main function that handles the mouse - --> perhaps need to pass info from gpm2_dr__init to gpm2_dr__handle - -- gpm2 passes a structure to all functions: - struct gpm2_dr_info { - char *dev; - char *opts; - } - -- gpm2 creates a fork for each mouse connected -- gpm2 forks die on sigterm (normally issued by gpm2) diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/bare/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/bare/m.c deleted file mode 100644 index fb771ca0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/bare/m.c +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_bare(Gpm_Event * state, unsigned char *data) -{ - /* - * a bare ms protocol - */ - state->buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/bm/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/bm/m.c deleted file mode 100644 index b578d50c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/bm/m.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_bm(Gpm_Event * state, unsigned char *data) -{ /* equal to sun */ - state->buttons = (~data[0]) & 0x07; - state->dx = (signed char) data[1]; - state->dy = -(signed char) data[2]; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/brw/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/brw/m.c deleted file mode 100644 index 20e6da15..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/brw/m.c +++ /dev/null @@ -1,52 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "mice.h" /* Gpm_type */ -#include "message.h" /* messaging */ - -/* M_brw is a variant of m$ 'Intellimouse' the middle button is different */ -int M_brw(Gpm_Event * state, unsigned char *data) -{ - state->buttons = ((data[0] & 0x20) >> 3) /* left */ - |((data[3] & 0x20) >> 4) /* middle */ - |((data[0] & 0x10) >> 4); /* right */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - if(((data[0] & 0xC0) != 0x40) || - ((data[1] & 0xC0) != 0x00) || - ((data[2] & 0xC0) != 0x00) || ((data[3] & 0xC0) != 0x00)) { - gpm_report(GPM_PR_DEBUG, GPM_MESS_SKIP_DATAP, data[0], data[1], data[2], - data[3]); - return -1; - } - /* - * wheel (dz) is (data[3] & 0x0f) - */ - /* - * where is the side button? I can sort of detect it at 9600 baud - */ - /* - * Note this mouse is very noisy - */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus/i.c deleted file mode 100644 index 110a3cbd..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus/i.c +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice stuff */ -#include "daemon.h" /* which_mouse */ -#include "drivers.h" /* I_serial */ - -Gpm_Type *I_calus(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - if(check_no_argv(argc, argv)) - return NULL; - - if((which_mouse->opt_baud) == 1200) - (which_mouse->opt_baud) = 9600; /* default to 9600 */ - return I_serial(fd, flags, type, argc, argv); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus/m.c deleted file mode 100644 index 5bb95582..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus/m.c +++ /dev/null @@ -1,68 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* win */ -#include "mice.h" /* realposy */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -int M_calus(Gpm_Event * state, unsigned char *data) -{ - int x, y; - - x = ((data[1] & 0x3F) << 7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F) << 7) | (data[5] & 0x7F); - - state->buttons = GPM_B_LEFT * ((data[0] >> 2) & 1) - + GPM_B_MIDDLE * ((data[0] >> 3) & 1) - + GPM_B_RIGHT * ((data[0] >> 4) & 1); - - state->dx = 0; - state->dy = 0; - - state->x = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? win.ws_col + 1 - : (long) (x - CAL_X_MIN) * (long) (win.ws_col - 1) / CAL_X_SIZE + 2; - - state->y = y < CAL_Y_MIN ? win.ws_row + 1 - : y > CAL_Y_MAX ? 0 - : (long) (CAL_Y_MAX - y) * (long) win.ws_row / CAL_Y_SIZE + 1; - - realposx = x < CAL_X_MIN ? 0 - : x > CAL_X_MAX ? 16384 - : (long) (x - CAL_X_MIN) * (long) (16382) / CAL_X_SIZE + 2; - - realposy = y < CAL_Y_MIN ? 16384 - : y > CAL_Y_MAX ? 0 - : (long) (CAL_Y_MAX - y) * (long) 16383 / CAL_Y_SIZE + 1; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus_rel/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus_rel/m.c deleted file mode 100644 index fea82a70..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/calus_rel/m.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* abs */ - -/* Calcomp UltraSlate tablet (John Anderson) - * modeled after Wacom and NCR drivers (thanks, guys) - * Note: I don't know how to get the tablet size from the tablet yet, so - * these defines will have to do for now. - */ - -#define CAL_LIMIT_BRK 255 - -#define CAL_X_MIN 0x40 -#define CAL_X_MAX 0x1340 -#define CAL_X_SIZE (CAL_X_MAX - CAL_X_MIN) - -#define CAL_Y_MIN 0x40 -#define CAL_Y_MAX 0xF40 -#define CAL_Y_SIZE (CAL_Y_MAX - CAL_Y_MIN) - -int M_calus_rel(Gpm_Event * state, unsigned char *data) -{ - static int ox = -1, oy; - - int x, y; - - x = ((data[1] & 0x3F) << 7) | (data[2] & 0x7F); - y = ((data[4] & 0x1F) << 7) | (data[5] & 0x7F); - - if(ox == -1 || abs(x - ox) > CAL_LIMIT_BRK || abs(y - oy) > CAL_LIMIT_BRK) { - ox = x; - oy = y; - } - - state->buttons = GPM_B_LEFT * ((data[0] >> 2) & 1) - + GPM_B_MIDDLE * ((data[0] >> 3) & 1) - + GPM_B_RIGHT * ((data[0] >> 4) & 1); - - state->dx = (x - ox) / 5; - state->dy = (oy - y) / 5; - ox = x; - oy = y; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/empty/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/empty/i.c deleted file mode 100644 index 48e5b021..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/empty/i.c +++ /dev/null @@ -1,38 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ - -Gpm_Type *I_empty(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - /* - * FIXME: remove unecessary init, but make gcc happy: warning: unused - * parameter ‘fd’ - */ - fd = 0; - flags = 0; - if(check_no_argv(argc, argv)) - return NULL; - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/etouch.h b/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/etouch.h deleted file mode 100644 index da4a235c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/etouch.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_DRV_ETOUCH -#define _GPM_DRV_ETOUCH - -extern int elo_click_ontouch; - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/i.c deleted file mode 100644 index b2c9e1b1..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/i.c +++ /dev/null @@ -1,104 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ - -#include "types.h" /* Gpm_type */ -#include "etouch.h" /* etouch specs */ -#include "message.h" /* reporting */ -#include "mice.h" /* parse_argv */ -#include "daemon.h" /* options */ - -extern int gunze_calib[4]; /* FIXME: do not depend on other drivers! */ - -/* simple initialization for the elo touchscreen */ -Gpm_Type *I_etouch(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - struct termios tty; - - FILE *f; - - char s[80]; - - int i, calibok = 0; - - flags = 0; /* FIXME: unused */ - - /* - * Calibration config file (copied from I_gunze, below :) - */ -#define ELO_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* - * accept a few options - */ - static argv_helper optioninfo[] = { - {"clickontouch", ARGV_BOOL, u: {iptr: &elo_click_ontouch}, value:!0}, - {"", ARGV_END, u: {iptr: &elo_click_ontouch}, value:0} - }; - parse_argv(optioninfo, argc, argv); - - /* - * Set speed to 9600bps (copied from I_summa, above :) - */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* - * retrieve calibration, if not existent, use defaults (uncalib) - */ - f = fopen(ELO_CALIBRATION_FILE, "r"); - if(f) { - fgets(s, 80, f); /* discard the comment */ - if(fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib + 1, - gunze_calib + 2, gunze_calib + 3) == 4) - calibok = 1; - /* - * Hmm... check - */ - for(i = 0; i < 4; i++) - if((gunze_calib[i] & 0xfff) != gunze_calib[i]) - calibok = 0; - if(gunze_calib[0] == gunze_calib[2]) - calibok = 0; - if(gunze_calib[1] == gunze_calib[3]) - calibok = 0; - fclose(f); - } - if(!calibok) { - gpm_report(GPM_PR_ERR, GPM_MESS_ELO_CALIBRATE, option.progname, - ELO_CALIBRATION_FILE); - /* - * "%s: etouch: calibration file %s absent or invalid, using defaults" - */ - gunze_calib[0] = gunze_calib[1] = 0x010; /* 1/16 */ - gunze_calib[2] = gunze_calib[3] = 0xff0; /* 15/16 */ - } - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/m.c deleted file mode 100644 index 95d1a598..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/etouch/m.c +++ /dev/null @@ -1,136 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "etouch.h" /* etouch specs */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse */ - -int elo_click_ontouch = 0; /* the bigger the smoother */ - -extern int gunze_calib[4]; /* FIXME: do not depend on other drivers! */ - -int M_etouch(Gpm_Event * state, unsigned char *data) -{ /* - * This is a simple decoder for the EloTouch touch screen devices. - * ELO format SmartSet UTsXXYYZZc 9600,N,8,1 - * c=checksum = 0xAA+'T'+'U'+s+X+X+Y+Y+Z+Z (XXmax=YYmax=0x0FFF=4095) - * s=status bit 0=init touch 1=stream touch 2=release - */ -#define ELO_CLICK_ONTOUCH /* ifdef then ButtonPress on first Touch else - * first Move then Touch */ - int x, y; - - static int avgx = -1, avgy; /* average over time, for smooth feeling */ - - static int upx, upy; /* keep track of last finger-up place */ - - static struct timeval uptv, tv; /* time of last up, and down events */ - -#define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -#define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if(data[2] & 0x04) { /* FINGER UP - Release */ - upx = avgx; /* ignore this x, y */ - upy = avgy; /* store Finger UP possition */ - GET_TIME(uptv); /* set time for the next finger-down */ - tv.tv_sec = 0; /* NO DRAG */ - avgx = -1; /* FINGER IS UP */ - state->buttons = 0; - return 0; - } - - /* - * NOW WE HAVe FINGER DOWN - */ - x = data[3] | (data[4] << 8); - x &= 0xfff; - y = data[5] | (data[6] << 8); - x &= 0xfff; - x = REALPOS_MAX * (x - gunze_calib[0]) / (gunze_calib[2] - gunze_calib[0]); - y = REALPOS_MAX * (y - gunze_calib[1]) / (gunze_calib[3] - gunze_calib[1]); - if(x < 0) - x = 0; - if(x > REALPOS_MAX) - x = REALPOS_MAX; - if(y < 0) - y = 0; - if(y > REALPOS_MAX) - y = REALPOS_MAX; - - if(avgx < 0) { /* INITIAL TOUCH, FINGER WAS UP */ - GET_TIME(tv); - state->buttons = 0; - if(DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { /* if Initial - * Touch - * immediate - * after finger - * * UP then - * start DRAG */ - x = upx; - y = upy; /* A:start DRAG at finger-UP position */ - if(elo_click_ontouch == 0) - state->buttons = GPM_B_LEFT; - } else { /* 1:MOVE to Initial Touch position */ - upx = x; - upy = y; /* store position of Initial Touch into upx, - * upy */ - if(elo_click_ontouch == 0) - tv.tv_sec = 0; /* no DRAG */ - } - realposx = avgx = x; - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; - state->y = REAL_TO_YCELL(realposy); - return 0; - } - - /* - * endof INITIAL TOUCH - */ - state->buttons = 0; /* Motion event */ - if(tv.tv_sec) { /* draging or elo_click_ontouch */ - state->buttons = GPM_B_LEFT; - if(elo_click_ontouch) { - x = avgx = upx; /* 2:BUTTON PRESS at Initial Touch position */ - y = avgy = upy; - tv.tv_sec = 0; /* so next time 3:MOVE again until Finger UP */ - } /* else B:continue DRAG to current possition */ - } - - realposx = avgx = (9 * avgx + x) / 10; - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9 * avgy + y) / 10; - state->y = REAL_TO_YCELL(realposy); - return 0; - -#undef REAL_TO_XCELL -#undef REAL_TO_YCELL -#undef GET_TIME -#undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/evabs/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/evabs/m.c deleted file mode 100644 index 2b7e22dc..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/evabs/m.c +++ /dev/null @@ -1,60 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -#include /* FIXME: Linux specific: thisevent */ -#include /* memcpy */ - -#ifdef HAVE_LINUX_INPUT_H -int M_evabs(Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - - (void) memcpy(&thisevent, data, sizeof(struct input_event)); - if(thisevent.type == EV_ABS) { - if(thisevent.code == ABS_X) - state->x = thisevent.value; - else if(thisevent.code == ABS_Y) - state->y = thisevent.value; - } else if(thisevent.type == EV_KEY) { - switch (thisevent.code) { - case BTN_LEFT: - state->buttons ^= GPM_B_LEFT; - break; - case BTN_MIDDLE: - state->buttons ^= GPM_B_MIDDLE; - break; - case BTN_RIGHT: - state->buttons ^= GPM_B_RIGHT; - break; - case BTN_SIDE: - state->buttons ^= GPM_B_MIDDLE; - break; - case BTN_TOUCH: - state->buttons ^= GPM_B_LEFT; - break; - } - } - return 0; -} -#endif /* HAVE_LINUX_INPUT_H */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/evdev/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/evdev/m.c deleted file mode 100644 index 1852ab69..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/evdev/m.c +++ /dev/null @@ -1,59 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* FIXME: Linux specific: thisevent */ -#include /* memcpy */ - -#include "types.h" /* Gpm_type */ - -#ifdef HAVE_LINUX_INPUT_H - -int M_evdev(Gpm_Event * state, unsigned char *data) -{ - struct input_event thisevent; - - (void) memcpy(&thisevent, data, sizeof(struct input_event)); - if(thisevent.type == EV_REL) { - if(thisevent.code == REL_X) - state->dx = (signed char) thisevent.value; - else if(thisevent.code == REL_Y) - state->dy = (signed char) thisevent.value; - } else if(thisevent.type == EV_KEY) { - switch (thisevent.code) { - case BTN_LEFT: - state->buttons ^= GPM_B_LEFT; - break; - case BTN_MIDDLE: - state->buttons ^= GPM_B_MIDDLE; - break; - case BTN_RIGHT: - state->buttons ^= GPM_B_RIGHT; - break; - case BTN_SIDE: - state->buttons ^= GPM_B_MIDDLE; - break; - } - } - return 0; -} - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/exps2/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/exps2/i.c deleted file mode 100644 index 74d8bbdf..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/exps2/i.c +++ /dev/null @@ -1,49 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* tcflush */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -/* - * This works with Dexxa Optical Mouse, but because in X same initstring - * is named ExplorerPS/2 so I named it in the same way. - */ -Gpm_Type *I_exps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - static unsigned char s1[] = { 243, 200, 243, 200, 243, 80, }; - - flags = 0; /* FIXME: 1.99.13 */ - - if(check_no_argv(argc, argv)) - return NULL; - - write(fd, s1, sizeof(s1)); - usleep(30000); - tcflush(fd, TCIFLUSH); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/geni/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/geni/m.c deleted file mode 100644 index 51b1327f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/geni/m.c +++ /dev/null @@ -1,44 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -#include "daemon.h" /* daemon internals */ - -/* 'Genitizer' (kw@dtek.chalmers.se 11/12/97) */ -int M_geni(Gpm_Event * state, unsigned char *data) -{ - /* - * this is a little confusing. If we use the stylus, we have three buttons - * (tip, lower, upper), and if we use the puck we have four buttons. (And - * the protocol is a little mangled if several of the buttons on the puck - * are pressed simultaneously. I don't use the puck, hence I try to decode - * three buttons only. tip = left, lower = middle, upper = right - */ - state->buttons = - (data[0] & 0x01) << 2 | (data[0] & 0x02) | (data[0] & 0x04) >> 2; - - state->dx = ((data[1] & 0x3f)) * ((data[0] & 0x10) ? 1 : -1); - state->dy = ((data[2] & 0x3f)) * ((data[0] & 0x8) ? -1 : 1); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/gunze/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/gunze/i.c deleted file mode 100644 index 44718bbb..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/gunze/i.c +++ /dev/null @@ -1,117 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include "types.h" /* Gpm_type */ -#include "mice.h" /* ‘parse_argv’ */ -#include "daemon.h" /* ‘which_mouse’ */ -#include "message.h" /* gpm_report */ - -/* from m.c */ -extern int gunze_avg; - -extern int gunze_calib[4]; - -extern int gunze_debounce; - -/* simple initialization for the gunze touchscreen */ -Gpm_Type *I_gunze(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - struct termios tty; - - FILE *f; - - char s[80]; - - int i, calibok = 0; - - flags = 0; /* FIXME: 1.99.13 */ - -#define GUNZE_CALIBRATION_FILE SYSCONFDIR "/gpm-calibration" - /* - * accept a few options - */ - static argv_helper optioninfo[] = { - {"smooth", ARGV_INT, u: {iptr:&gunze_avg}}, - {"debounce", ARGV_INT, u: {iptr:&gunze_debounce}}, - /* - * FIXME: add corner tapping - */ - {"", ARGV_END, u: {iptr:&gunze_avg}} - }; - parse_argv(optioninfo, argc, argv); - - /* - * check that the baud rate is valid - */ - if((which_mouse->opt_baud) == DEF_BAUD) - (which_mouse->opt_baud) = 19200; /* force 19200 as default */ - if((which_mouse->opt_baud) != 9600 && (which_mouse->opt_baud) != 19200) { - gpm_report(GPM_PR_ERR, GPM_MESS_GUNZE_WRONG_BAUD, option.progname, - argv[0]); - (which_mouse->opt_baud) = 19200; - } - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = - ((which_mouse->opt_baud) == - 9600 ? B9600 : B19200) | CS8 | CREAD | CLOCAL | HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* - * FIXME: try to find some information about the device - */ - - /* - * retrieve calibration, if not existent, use defaults (uncalib) - */ - f = fopen(GUNZE_CALIBRATION_FILE, "r"); - if(f) { - fgets(s, 80, f); /* discard the comment */ - if(fscanf(f, "%d %d %d %d", gunze_calib, gunze_calib + 1, - gunze_calib + 2, gunze_calib + 3) == 4) - calibok = 1; - /* - * Hmm... check - */ - for(i = 0; i < 4; i++) - if(gunze_calib[i] & ~1023) - calibok = 0; - if(gunze_calib[0] == gunze_calib[2]) - calibok = 0; - if(gunze_calib[1] == gunze_calib[3]) - calibok = 0; - fclose(f); - } - if(!calibok) { - gpm_report(GPM_PR_ERR, GPM_MESS_GUNZE_CALIBRATE, option.progname); - gunze_calib[0] = gunze_calib[1] = 128; /* 1/8 */ - gunze_calib[2] = gunze_calib[3] = 896; /* 7/8 */ - } - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/gunze/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/gunze/m.c deleted file mode 100644 index bdd4174d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/gunze/m.c +++ /dev/null @@ -1,160 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "message.h" /* gpm_report */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse */ - -int gunze_avg = 9; /* the bigger the smoother */ - -int gunze_calib[4]; /* x0,y0 x1,y1 (measured at 1/8 and 7/8) */ - -int gunze_debounce = 100; /* milliseconds: ignore shorter taps */ - -int M_gunze(Gpm_Event * state, unsigned char *data) -{ - /* - * This generates button-1 events, by now. - * Check README.gunze for additional information. - */ - int x, y; - - static int avgx, avgy; /* average over time, for smooth feeling */ - - static int upx, upy; /* keep track of last finger-up place */ - - static int released = 0, dragging = 0; - - static struct timeval uptv, tv; /* time of last up, and down events */ - - int timediff; - -#define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -#define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if(data[0] == 'R') { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - state->buttons = 0; - released = 1; - return 0; - } - - if(sscanf((char *) data + 1, "%d, %d", &x, &y) != 2) { - gpm_report(GPM_PR_INFO, GPM_MESS_GUNZE_INV_PACK, data); - return 10; /* eat one byte only, leave ten of them */ - } - /* - * First of all, calibrate decoded data; - * the four numbers are 1/8X 1/8Y, 7/8X, 7/8Y - */ - x = 128 + 768 * (x - gunze_calib[0]) / (gunze_calib[2] - gunze_calib[0]); - y = 128 + 768 * (y - gunze_calib[1]) / (gunze_calib[3] - gunze_calib[1]); - - /* - * range is 0-1023, rescale it upwards (0-REALPOS_MAX) - */ - x = x * REALPOS_MAX / 1023; - y = REALPOS_MAX - y * REALPOS_MAX / 1023; - - if(x < 0) - x = 0; - if(x > REALPOS_MAX) - x = REALPOS_MAX; - if(y < 0) - y = 0; - if(y > REALPOS_MAX) - y = REALPOS_MAX; - - /* - * there are some issues wrt press events: since the device needs a - * non-negligible pressure to detect stuff, it sometimes reports - * quick up-down sequences, that actually are just the result of a - * little bouncing of the finger. Therefore, we should discard any - * release-press pair. This can be accomplished at press time. - */ - - if(released) { /* press event -- or just bounce */ - GET_TIME(tv); - timediff = DIF_TIME(uptv, tv); - released = 0; - if(timediff > gunze_debounce && timediff < (which_mouse->opt_time)) { - /* - * count as button press placed at finger-up pixel - */ - dragging = 1; - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; - state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx-upy become offsets to use for this drag */ - upy = (upy - y); - return 0; - } - if(timediff <= gunze_debounce) { - /* - * just a bounce, invalidate offset, leave dragging alone - */ - upx = upy = 0; - } else { - /* - * else, count as a new motion event, reset avg - */ - dragging = 0; - realposx = avgx = x; - realposy = avgy = y; - } - } - - state->buttons = 0; - if(dragging) { /* a drag event: use position relative to press - */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (gunze_avg * avgx + x) / (gunze_avg + 1); - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (gunze_avg * avgy + y) / (gunze_avg + 1); - state->y = REAL_TO_YCELL(realposy); - - return 0; - -#undef REAL_TO_XCELL -#undef REAL_TO_YCELL -#undef GET_TIME -#undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/header.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/header.c deleted file mode 100644 index 2d18f2bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/header.c +++ /dev/null @@ -1,23 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/i.c deleted file mode 100644 index f823e33e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/i.c +++ /dev/null @@ -1,109 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include -#include /* NULL */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* GPM_AUX_ENABLE_DEV */ -#include "message.h" /* messaging */ -#include "daemon.h" /* mice */ - -/* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ - -/* Autodetect: Steve Bennett */ -Gpm_Type *I_imps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - int id; - static unsigned char basic_init[] = - { GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100 }; - static unsigned char imps2_init[] = - { GPM_AUX_SET_SAMPLE, 200, GPM_AUX_SET_SAMPLE, 100, GPM_AUX_SET_SAMPLE, - 80, - }; - static unsigned char ps2_init[] = - { GPM_AUX_SET_SCALE11, GPM_AUX_ENABLE_DEV, GPM_AUX_SET_SAMPLE, 100, - GPM_AUX_SET_RES, 3, - }; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - /* - * Do a basic init in case the mouse is confused - */ - write_to_mouse(fd, basic_init, sizeof(basic_init)); - - /* - * Now try again and make sure we have a PS/2 mouse - */ - if(write_to_mouse(fd, basic_init, sizeof(basic_init)) != 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_IMPS2_INIT); - return (NULL); - } - - /* - * Try to switch to 3 button mode - */ - if(write_to_mouse(fd, imps2_init, sizeof(imps2_init)) != 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_IMPS2_FAILED); - return (NULL); - } - - /* - * Read the mouse id - */ - id = read_mouse_id(fd); - if(id == GPM_AUX_ID_ERROR) { - gpm_report(GPM_PR_ERR, GPM_MESS_IMPS2_MID_FAIL); - id = GPM_AUX_ID_PS2; - } - - /* - * And do the real initialisation - */ - if(write_to_mouse(fd, ps2_init, sizeof(ps2_init)) != 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_IMPS2_SETUP_FAIL); - } - - if(id == GPM_AUX_ID_IMPS2) { - /* - * Really an intellipoint, so initialise 3 button mode (4 byte packets) - */ - gpm_report(GPM_PR_INFO, GPM_MESS_IMPS2_AUTO); - return type; - } - if(id != GPM_AUX_ID_PS2) { - gpm_report(GPM_PR_ERR, GPM_MESS_IMPS2_BAD_ID, id); - } else - gpm_report(GPM_PR_INFO, GPM_MESS_IMPS2_PS2); - - for(type = mice; type->fun; type++) - if(strcmp(type->name, "ps2") == 0) - return (type); - - /* - * ps2 was not found!!! - */ - return (NULL); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/m.c deleted file mode 100644 index 47500ce5..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/m.c +++ /dev/null @@ -1,88 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ - -int M_imps2(Gpm_Event * state, unsigned char *data) -{ - - static int tap_active = 0; /* there exist glidepoint ps2 mice */ - - state->wdx = state->wdy = 0; /* Clear them.. */ - state->dx = state->dy = state->wdx = state->wdy = 0; - - state->buttons = ((data[0] & 1) << 2) /* left */ - |((data[0] & 6) >> 1); /* middle and right */ - - if(data[0] == 0 && (which_mouse->opt_glidepoint_tap)) // by default - // this is - // false - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if(tap_active) { - if(data[0] == 8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* - * Standard movement.. - */ - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - state->dy = (data[0] & 0x20) ? -(data[2] - 256) : -data[2]; - - /* - * The wheels.. - */ - unsigned char wheel = data[3] & 0x0f; - - if(wheel > 0) { - // use the event type GPM_MOVE rather than GPM_DOWN for wheel movement - // to avoid single/double/triple click processing: - switch (wheel) { - /* - * rodney 13/mar/2008 The use of GPM_B_UP / GPM_B_DOWN is very - * unclear; only mouse type ms3 uses these For this mouse, we only - * support the relative movement i.e. no button is set (same as - * mouse movement), wdy changes +/- according to wheel movement (+ - * for rolling away from user) wdx (horizontal scroll) is for a - * second wheel. They do exist! - */ - case 0x0f: - state->wdy = +1; - break; - case 0x01: - state->wdy = -1; - break; - case 0x0e: - state->wdx = +1; - break; - case 0x02: - state->wdx = -1; - break; - } - } - - return 0; - -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/r.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/r.c deleted file mode 100644 index 80084771..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/imps2/r.c +++ /dev/null @@ -1,55 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - -int R_imps2(Gpm_Event * state, int fd) -{ - signed char buffer[4]; - - int dx, dy; - - dx = limit_delta(state->dx, -256, 255); - dy = limit_delta(state->dy, -256, 255); - - buffer[0] = 8 | - (state->buttons & GPM_B_LEFT ? 1 : 0) | - (state->buttons & GPM_B_MIDDLE ? 4 : 0) | - (state->buttons & GPM_B_RIGHT ? 2 : 0) | - (dx < 0 ? 0x10 : 0) | (dy > 0 ? 0x20 : 0); - buffer[1] = dx & 0xFF; - buffer[2] = (-dy) & 0xFF; - if(state->wdy > 0) - buffer[3] = 0xff; - if(state->wdy < 0) - buffer[3] = 0x01; - if(state->wdx > 0) - buffer[3] = 0xfe; - if(state->wdx < 0) - buffer[3] = 0x02; - - return write(fd, buffer, 4); - -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/js/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/js/m.c deleted file mode 100644 index d3356293..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/js/m.c +++ /dev/null @@ -1,90 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ - -#ifdef HAVE_LINUX_JOYSTICK_H - -/* Joystick mouse emulation (David Given) */ -int M_js(Gpm_Event * state, unsigned char *data) -{ - struct JS_DATA_TYPE *jdata = (void *) data; - - static int centerx = 0; - - static int centery = 0; - - static int oldbuttons = 0; - - static int count = 0; - - int dx; - - int dy; - - count++; - if(count < 200) { - state->buttons = oldbuttons; - state->dx = 0; - state->dy = 0; - return 0; - } - count = 0; - - if(centerx == 0) { - centerx = jdata->x; - centery = jdata->y; - } - - state->buttons = ((jdata->buttons & 1) * GPM_B_LEFT) | - ((jdata->buttons & 2) * GPM_B_RIGHT); - oldbuttons = state->buttons; - - dx = (jdata->x - centerx) >> 6; - dy = (jdata->y - centery) >> 6; - - if(dx > 0) - state->dx = dx * dx; - else - state->dx = -(dx * dx); - state->dx >>= 2; - - if(dy > 0) - state->dy = dy * dy; - else - state->dy = -(dy * dy); - state->dy >>= 2; - - /* - * Prevent pointer drift. (PC joysticks are notoriously inaccurate.) - */ - - if((state->dx >= -1) && (state->dx <= 1)) - state->dx = 0; - if((state->dy >= -1) && (state->dy <= 1)) - state->dy = 0; - - return 0; -} -#endif /* have joystick.h */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/logi/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/logi/i.c deleted file mode 100644 index ca5d1580..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/logi/i.c +++ /dev/null @@ -1,100 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* fstat */ -#include /* termios */ -#include /* usleep, write */ -#include /* FIXME: Linux specific: MAJOR */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ -#include "daemon.h" /* which_mouse */ - -struct { - int sample; - char code[2]; -} sampletab[] = { - { - 0, "O"}, { - 15, "J"}, { - 27, "K"}, { - 42, "L"}, { - 60, "R"}, { - 85, "M"}, { - 125, "Q"}, { -1E9, "N"},}; - -Gpm_Type *I_logi(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - int i; - - struct stat buf; - - int busmouse; - - if(check_no_argv(argc, argv)) - return NULL; - - /* - * is this a serial- or a bus- mouse? - */ - if(fstat(fd, &buf) == -1) - gpm_report(GPM_PR_OOPS, GPM_MESS_FSTAT); - i = MAJOR(buf.st_rdev); - - /* - * I don't know why this is herein, but I remove it. I don't think a - * hardcoded ttyname in a C file is senseful. I think if the device exists - * must be clear before. Not here. - */ - - /********* if (stat("/dev/ttyS0",&buf)==-1) gpm_oops("stat()"); *****/ - busmouse = (i != (int) MAJOR(buf.st_rdev)); - - /* - * fix the howmany field, so that serial mice have 1, while busmice have 3 - */ - type->howmany = busmouse ? 3 : 1; - - /* - * change from any available speed to the chosen one - */ - for(i = 9600; i >= 1200; i /= 2) - setspeed(fd, i, (which_mouse->opt_baud), 1 /* write */ , flags); - - /* - * this stuff is peculiar of logitech mice, also for the serial ones - */ - write(fd, "S", 1); - setspeed(fd, (which_mouse->opt_baud), (which_mouse->opt_baud), 1 /* write - */ , - CS8 | PARENB | PARODD | CREAD | CLOCAL | HUPCL); - - /* - * configure the sample rate - */ - for(i = 0; (which_mouse->opt_sample) <= sampletab[i].sample; i++) ; - write(fd, sampletab[i].code, 1); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/logi/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/logi/m.c deleted file mode 100644 index 8b1c8e10..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/logi/m.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_logi(Gpm_Event * state, unsigned char *data) -{ /* equal to mm */ - state->buttons = data[0] & 0x07; - state->dx = (data[0] & 0x10) ? data[1] : -data[1]; - state->dy = (data[0] & 0x08) ? -data[2] : data[2]; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/logimsc/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/logimsc/m.c deleted file mode 100644 index 92077933..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/logimsc/m.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_logimsc(Gpm_Event * state, unsigned char *data) -{ /* same as msc */ - state->buttons = (~data[0]) & 0x07; - state->dx = (signed char) (data[1]) + (signed char) (data[3]); - state->dy = -((signed char) (data[2]) + (signed char) (data[4])); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/mm/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/mm/m.c deleted file mode 100644 index f88b9065..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/mm/m.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_mm(Gpm_Event * state, unsigned char *data) -{ - state->buttons = data[0] & 0x07; - state->dx = (data[0] & 0x10) ? data[1] : -data[1]; - state->dy = (data[0] & 0x08) ? -data[2] : data[2]; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/mman/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/mman/m.c deleted file mode 100644 index 408c5a03..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/mman/m.c +++ /dev/null @@ -1,89 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice */ -#include "daemon.h" /* which_mouse */ - -int M_mman(Gpm_Event * state, unsigned char *data) -{ - /* - * the damned MouseMan has 3/4 bytes packets. The extra byte - * is only there if the middle button is active. - * I get the extra byte as a packet with magic numbers in it. - * and then switch to 4-byte mode. - */ - static unsigned char prev = 0; - - static Gpm_Type *mytype = mice; /* it is the first */ - - unsigned char b = (*data >> 4); - - if(data[1] == GPM_EXTRA_MAGIC_1 && data[2] == GPM_EXTRA_MAGIC_2) { - /* - * got unexpected fourth byte - */ - if(b > 0x3) - return -1; /* just a sanity check */ - // if ((b=(*data>>4)) > 0x3) return -1; /* just a sanity check */ - state->dx = state->dy = 0; - - mytype->packetlen = 4; - mytype->getextra = 0; - } else { - /* - * got 3/4, as expected - */ - - /* - * motion is independent of packetlen... - */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - prev = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - if(mytype->packetlen == 4) - b = data[3] >> 4; - } - - if(mytype->packetlen == 4) { - if(b == 0) { - mytype->packetlen = 3; - mytype->getextra = 1; - } else { - if(b & 0x2) - prev |= GPM_B_MIDDLE; - if(b & 0x1) - prev |= (which_mouse->opt_glidepoint_tap); - } - } - state->buttons = prev; - - /* - * This "chord-middle" behaviour was reported by David A. van Leeuwen - */ - if(((prev ^ state->buttons) & GPM_B_BOTH) == GPM_B_BOTH) - state->buttons = state->buttons ? GPM_B_MIDDLE : 0; - prev = state->buttons; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms/m.c deleted file mode 100644 index 5bd6061e..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms/m.c +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int M_ms(Gpm_Event * state, unsigned char *data) -{ - /* - * some devices report a change of middle-button state by - * repeating the current button state (patch by Mark Lord) - */ - static unsigned char prev = 0; - - if(data[0] == 0x40 && !(prev | data[1] | data[2])) - state->buttons = GPM_B_MIDDLE; /* third button on MS compatible mouse */ - else - state->buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - prev = state->buttons; - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms3/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms3/m.c deleted file mode 100644 index 0647e43b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms3/m.c +++ /dev/null @@ -1,54 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -/* m$ 'Intellimouse' (steveb 20/7/97) */ -int M_ms3(Gpm_Event * state, unsigned char *data) -{ - state->wdx = state->wdy = 0; - state->buttons = ((data[0] & 0x20) >> 3) /* left */ - |((data[3] & 0x10) >> 3) /* middle */ - |((data[0] & 0x10) >> 4) /* right */ - |(((data[3] & 0x0f) == 0x0f) * GPM_B_UP) /* wheel up */ - |(((data[3] & 0x0f) == 0x01) * GPM_B_DOWN); /* wheel down */ - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - switch (data[3] & 0x0f) { - case 0x0e: - state->wdx = +1; - break; - case 0x02: - state->wdx = -1; - break; - case 0x0f: - state->wdy = +1; - break; - case 0x01: - state->wdy = -1; - break; - } - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms3/r.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms3/r.c deleted file mode 100644 index efd11d1f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms3/r.c +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int R_ms3(Gpm_Event * state, int fd) -{ - - int dx, dy; - char buf[4] = { 0, 0, 0, 0 }; - - buf[0] |= 0x40; - - if(state->buttons & GPM_B_LEFT) - buf[0] |= 0x20; - if(state->buttons & GPM_B_MIDDLE) - buf[3] |= 0x10; - if(state->buttons & GPM_B_RIGHT) - buf[0] |= 0x10; - if(state->buttons & GPM_B_UP) - buf[3] |= 0x0f; - if(state->buttons & GPM_B_DOWN) - buf[3] |= 0x01; - - dx = limit_delta(state->dx, -128, 127); - buf[1] = dx & ~0xC0; - buf[0] |= (dx & 0xC0) >> 6; - - dy = limit_delta(state->dy, -128, 127); - buf[2] = dy & ~0xC0; - buf[0] |= (dy & 0xC0) >> 4; - - /* - * wheel - */ - if(state->wdy > 0) - buf[3] |= 0x0f; - else if(state->wdy < 0) - buf[3] |= 0x01; - - return write(fd, buf, 4); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms_plus/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms_plus/m.c deleted file mode 100644 index 1aa714f4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms_plus/m.c +++ /dev/null @@ -1,48 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* daemon internals */ - -int M_ms_plus(Gpm_Event * state, unsigned char *data) -{ - static unsigned char prev = 0; - - state->buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* - * Allow motion *and* button change (Michael Plass) - */ - - if((state->dx == 0) && (state->dy == 0) - && (state->buttons == (prev & ~GPM_B_MIDDLE))) - state->buttons = prev ^ GPM_B_MIDDLE; /* no move or change: toggle - * middle */ - else - state->buttons |= prev & GPM_B_MIDDLE; /* change: preserve middle */ - - prev = state->buttons; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms_plus_lr/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms_plus_lr/m.c deleted file mode 100644 index a1a28177..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ms_plus_lr/m.c +++ /dev/null @@ -1,59 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_ms_plus_lr(Gpm_Event * state, unsigned char *data) -{ - /* - * Same as M_ms_plus but with an addition by Edmund GRIMLEY EVANS - */ - static unsigned char prev = 0; - - state->buttons = ((data[0] & 0x20) >> 3) | ((data[0] & 0x10) >> 4); - state->dx = (signed char) (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - state->dy = (signed char) (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - - /* - * Allow motion *and* button change (Michael Plass) - */ - - if((state->dx == 0) && (state->dy == 0) - && (state->buttons == (prev & ~GPM_B_MIDDLE))) - state->buttons = prev ^ GPM_B_MIDDLE; /* no move or change: toggle - * middle */ - else - state->buttons |= prev & GPM_B_MIDDLE; /* change: preserve middle */ - - /* - * Allow the user to reset state of middle button by pressing the other two - * buttons at once (Edmund GRIMLEY EVANS) - */ - - if(!((~state->buttons) & (GPM_B_LEFT | GPM_B_RIGHT)) && - ((~prev) & (GPM_B_LEFT | GPM_B_RIGHT))) - state->buttons &= ~GPM_B_MIDDLE; - - prev = state->buttons; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/msc/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/msc/m.c deleted file mode 100644 index bb420586..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/msc/m.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_msc(Gpm_Event * state, unsigned char *data) -{ - state->buttons = (~data[0]) & 0x07; - state->dx = (signed char) (data[1]) + (signed char) (data[3]); - state->dy = -((signed char) (data[2]) + (signed char) (data[4])); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/msc/r.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/msc/r.c deleted file mode 100644 index e9dc5611..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/msc/r.c +++ /dev/null @@ -1,44 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - -int R_msc(Gpm_Event * state, int fd) -{ - signed char buffer[5]; - - int dx, dy; - - /* - * sluggish... - */ - buffer[0] = (state->buttons ^ 0x07) | 0x80; - dx = limit_delta(state->dx, -256, 254); - buffer[3] = state->dx - (buffer[1] = state->dx / 2); /* Markus */ - dy = limit_delta(state->dy, -256, 254); - buffer[4] = -state->dy - (buffer[2] = -state->dy / 2); - return write(fd, buffer, 5); - -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/mtouch/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/mtouch/i.c deleted file mode 100644 index 89703396..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/mtouch/i.c +++ /dev/null @@ -1,57 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* NULL */ - -#include /* usleep, write */ -#include /* termios */ - -#include "types.h" /* Gpm_type */ - -Gpm_Type *I_mtouch(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - struct termios tty; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - /* - * Set speed to 9600bps (copied from I_summa, above :) - */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* - * Turn it to "format tablet" and "mode stream" - */ - write(fd, "\001MS\r\n\001FT\r\n", 10); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/mtouch/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/mtouch/m.c deleted file mode 100644 index 43d3e2e0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/mtouch/m.c +++ /dev/null @@ -1,113 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* gettimeofday */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* mice */ -#include "daemon.h" /* which_mouse */ - -int M_mtouch(Gpm_Event * state, unsigned char *data) -{ - /* - * This is a simple decoder for the MicroTouch touch screen - * devices. It uses the "tablet" format and only generates button-1 - * events. Check README.microtouch for additional information. - */ - int x, y; - - static int avgx = -1, avgy; /* average over time, for smooth feeling */ - - static int upx, upy; /* keep track of last finger-up place */ - - static struct timeval uptv, tv; /* time of last up, and down events */ - -#define REAL_TO_XCELL(x) (x * win.ws_col / 0x3FFF) -#define REAL_TO_YCELL(y) (y * win.ws_row / 0x3FFF) - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if(!(data[0] & 0x40)) { - /* - * finger-up event: this is usually offset a few pixels, - * so ignore this x and y values. And invalidate avg. - */ - upx = avgx; - upy = avgy; - GET_TIME(uptv); /* ready for the next finger-down */ - tv.tv_sec = 0; - state->buttons = 0; - avgx = -1; /* invalidate avg */ - return 0; - } - - x = data[1] | (data[2] << 7); - y = 0x3FFF - (data[3] | (data[4] << 7)); - - if(avgx < 0) { /* press event */ - GET_TIME(tv); - if(DIF_TIME(uptv, tv) < (which_mouse->opt_time)) { - /* - * count as button press placed at finger-up pixel - */ - state->buttons = GPM_B_LEFT; - realposx = avgx = upx; - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = upy; - state->y = REAL_TO_YCELL(realposy); - upx = (upx - x); /* upx and upy become offsets to use for this - * drag */ - upy = (upy - y); - return 0; - } - /* - * else, count as a new motion event - */ - tv.tv_sec = 0; /* invalidate */ - realposx = avgx = x; - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = y; - state->y = REAL_TO_YCELL(realposy); - } - - state->buttons = 0; - if(tv.tv_sec) { /* a drag event: use position relative to press - */ - x += upx; - y += upy; - state->buttons = GPM_B_LEFT; - } - - realposx = avgx = (9 * avgx + x) / 10; - state->x = REAL_TO_XCELL(realposx); - realposy = avgy = (9 * avgy + y) / 10; - state->y = REAL_TO_YCELL(realposy); - - return 0; - -#undef REAL_TO_XCELL -#undef REAL_TO_YCELL -#undef GET_TIME -#undef DIF_TIME -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ncr/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ncr/m.c deleted file mode 100644 index 1fcdaa34..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ncr/m.c +++ /dev/null @@ -1,76 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* win */ - -/* ncr pen support (Marc Meis) */ - -#define NCR_LEFT_X 40 -#define NCR_RIGHT_X 2000 - -#define NCR_BOTTOM_Y 25 -#define NCR_TOP_Y 1490 - -#define NCR_DELTA_X (NCR_RIGHT_X - NCR_LEFT_X) -#define NCR_DELTA_Y (NCR_TOP_Y - NCR_BOTTOM_Y) - -int M_ncr(Gpm_Event * state, unsigned char *data) -{ - int x, y; - - state->buttons = (data[0] & 1) * GPM_B_LEFT + !!(data[0] & 2) * GPM_B_RIGHT; - - state->dx = (signed char) data[1]; /* currently unused */ - state->dy = (signed char) data[2]; - - x = ((int) data[3] << 8) + (int) data[4]; - y = ((int) data[5] << 8) + (int) data[6]; - - /* - * these formulaes may look curious, but this is the way it works!!! - */ - - state->x = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? win.ws_col + 1 - : (long) (x - NCR_LEFT_X) * (long) (win.ws_col - 1) / NCR_DELTA_X + 2; - - state->y = y < NCR_BOTTOM_Y - ? win.ws_row + 1 - : y > NCR_TOP_Y - ? 0 : (long) (NCR_TOP_Y - y) * (long) win.ws_row / NCR_DELTA_Y + 1; - - realposx = x < NCR_LEFT_X - ? 0 - : x > NCR_RIGHT_X - ? 16384 : (long) (x - NCR_LEFT_X) * (long) (16382) / NCR_DELTA_X + 2; - - realposy = y < NCR_BOTTOM_Y - ? 16384 - : y > NCR_TOP_Y - ? 0 : (long) (NCR_TOP_Y - y) * (long) 16383 / NCR_DELTA_Y + 1; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/netmouse/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/netmouse/i.c deleted file mode 100644 index 40d9d7f3..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/netmouse/i.c +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ - -Gpm_Type *I_netmouse(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - unsigned char magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 }; - int i; - - flags = 0; /* FIXME: 1.99.13 */ - - if(check_no_argv(argc, argv)) - return NULL; - for(i = 0; i < 6; i++) { - unsigned char c = 0; - - write(fd, magic + i, 1); - read(fd, &c, 1); - if(c != 0xfa) { - gpm_report(GPM_PR_ERR, GPM_MESS_NETM_NO_ACK, c); - return NULL; - } - } - { - unsigned char rep[3] = { 0, 0, 0 }; - read(fd, rep, 1); - read(fd, rep + 1, 1); - read(fd, rep + 2, 1); - if(rep[0] || (rep[1] != 0x33) || (rep[2] != 0x55)) { - gpm_report(GPM_PR_ERR, GPM_MESS_NETM_INV_MAGIC, rep[0], rep[1], - rep[2]); - return NULL; - } - } - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/netmouse/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/netmouse/m.c deleted file mode 100644 index 08b92cd9..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/netmouse/m.c +++ /dev/null @@ -1,57 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_netmouse(Gpm_Event * state, unsigned char *data) -{ - /* - * Avoid these beasts if you can. They connect to normal PS/2 port, but - * their protocol is one byte longer... So if you have notebook (like me) - * with internal PS/2 mouse, it will not work together. They have four - * buttons, but two middle buttons can not be pressed simultaneously, and - * two middle buttons do not send 'up' events (however, they autorepeat...) - * - * * Still, you might want to run this mouse in plain PS/2 mode - where it - * behaves correctly except that middle 2 buttons do nothing. - * - * * Protocol is 3 bytes like normal PS/2 4th byte: 0xff button 'down', 0x01 - * button 'up' [this is so braindamaged that it *must* be some kind of - * compatibility glue...] - * - * * Pavel Machek - */ - - state->buttons = - !!(data[0] & 1) * GPM_B_LEFT + - !!(data[0] & 2) * GPM_B_RIGHT + !!(data[3]) * GPM_B_MIDDLE; - - if(data[1] != 0) - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy = -((data[0] & 0x20) ? data[2] - 256 : data[2]); - else - state->dy = 0; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/pnp/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/pnp/i.c deleted file mode 100644 index f9625589..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/pnp/i.c +++ /dev/null @@ -1,60 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* option_modem_lines */ - -Gpm_Type *I_pnp(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - struct termios tty; - - /* - * accept "-o dtr", "-o rts" and "-o both" - */ - if(option_modem_lines(fd, argc, argv)) - return NULL; - - /* - * Just put the device to 1200 baud. Thanks to Francois Chastrette - * for his great help and debugging with his own pnp device. - */ - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = flags | B1200; - tcsetattr(fd, TCSAFLUSH, &tty); /* set parameters */ - - /* - * Don't read the silly initialization string. I don't want to see - * the vendor name: it is only propaganda, with no information. - */ - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/i.c deleted file mode 100644 index ec121ec7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/i.c +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* termios */ - -#include "types.h" /* Gpm_type */ - -/* standard ps2 */ -Gpm_Type *I_ps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - static unsigned char s[] = { 246, 230, 244, 243, 100, 232, 3, }; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - write(fd, s, sizeof(s)); - usleep(30000); - tcflush(fd, TCIFLUSH); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/m.c deleted file mode 100644 index 79da05a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/m.c +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ - -int M_ps2(Gpm_Event * state, unsigned char *data) -{ - static int tap_active = 0; /* there exist glidepoint ps2 mice */ - - state->buttons = - !!(data[0] & 1) * GPM_B_LEFT + - !!(data[0] & 2) * GPM_B_RIGHT + !!(data[0] & 4) * GPM_B_MIDDLE; - - if(data[0] == 0 && (which_mouse->opt_glidepoint_tap)) /* by default * - * this is * - * false */ - state->buttons = tap_active = (which_mouse->opt_glidepoint_tap); - else if(tap_active) { - if(data[0] == 8) - state->buttons = tap_active = 0; - else - state->buttons = tap_active; - } - - /* - * Some PS/2 mice send reports with negative bit set in data[0] and zero for - * movement. I think this is a bug in the mouse, but working around it only - * causes artifacts when the actual report is -256; they'll be treated as - * zero. This should be rare if the mouse sampling rate is set to a - * reasonable value; the default of 100 Hz is plenty. (Stephen Tell) - */ - if(data[1] != 0) - state->dx = (data[0] & 0x10) ? data[1] - 256 : data[1]; - else - state->dx = 0; - if(data[2] != 0) - state->dy = -((data[0] & 0x20) ? data[2] - 256 : data[2]); - else - state->dy = 0; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/r.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/r.c deleted file mode 100644 index 1181673c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/ps2/r.c +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* limit_delta */ - -/* ps2 */ -int R_ps2(Gpm_Event * state, int fd) -{ - signed char buffer[3]; - - buffer[0] = ((state->buttons & GPM_B_LEFT) > 0) * 1 + - ((state->buttons & GPM_B_RIGHT) > 0) * 2 + - ((state->buttons & GPM_B_MIDDLE) > 0) * 4; - buffer[0] |= 8 + ((state->dx < 0) ? 0x10 : 0) + ((state->dy > 0) ? 0x20 : 0); - buffer[1] = limit_delta(state->dx, -128, 127); - buffer[2] = limit_delta(-state->dy, -128, 127); - return write(fd, buffer, 3); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/serial/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/serial/i.c deleted file mode 100644 index f2269d24..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/serial/i.c +++ /dev/null @@ -1,127 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* select */ -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "message.h" /* gpm_report */ -#include "drivers.h" /* other drivers */ -#include "daemon.h" /* which_mouse */ -#include "synaptics.h" /* synaptics support */ - -Gpm_Type *I_serial(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - int i; - - unsigned char c; - - fd_set set; - struct timeval timeout = { 0, 0 }; /* used when not debugging */ - - /* - * accept "-o dtr", "-o rts" and "-o both" - */ - if(option_modem_lines(fd, argc, argv)) - return NULL; - -#ifndef DEBUG - /* - * flush any pending input (thanks, Miguel) - */ - FD_ZERO(&set); - for(i = 0; /* always */ ; i++) { - FD_SET(fd, &set); - switch (select(fd + 1, &set, (fd_set *) NULL, (fd_set *) NULL, &timeout /* zero - */ )) { - case 1: - if(read(fd, &c, 1) == 0) - break; - case -1: - continue; - } - break; - } - - if(type->fun == M_logimsc) - write(fd, "QU", 2); - -# if 0 /* Did this ever work? -- I don't know, but - * should we not remove it, if it doesn't work - * ??? -- Nico */ - if(type->fun == M_ms && i == 2 && c == 0x33) { /* Aha.. a mouseman... */ - gpm_report(GPM_PR_INFO, GPM_MESS_MMAN_DETECTED); - return mice; /* it is the first */ - } -# endif -#endif - - /* - * Non mman: change from any available speed to the chosen one - */ - for(i = 9600; i >= 1200; i /= 2) - setspeed(fd, i, (which_mouse->opt_baud), (type->fun != M_mman) /* write - */ , flags); - - /* - * reset the MouseMan/TrackMan to use the 3/4 byte protocol - * (Stephen Lee, sl14@crux1.cit.cornell.edu) - * Changed after 1.14; why not having "I_mman" now? - */ - if(type->fun == M_mman) { - setspeed(fd, 1200, 1200, 0, flags); /* no write */ - write(fd, "*X", 2); - setspeed(fd, 1200, (which_mouse->opt_baud), 0, flags); /* no write */ - return type; - } - - if(type->fun == M_geni) { - gpm_report(GPM_PR_INFO, GPM_MESS_INIT_GENI); - setspeed(fd, 1200, 9600, 1, flags); /* write */ - write(fd, ":", 1); - write(fd, "E", 1); /* setup tablet. relative mode, resolution... */ - write(fd, "@", 1); /* setup tablet. relative mode, resolution... */ - } - - if(type->fun == M_synaptics_serial) { - int packet_length; - - setspeed(fd, 1200, 1200, 1, flags); - packet_length = syn_serial_init(fd); - setspeed(fd, 1200, 9600, 1, flags); - - type->packetlen = packet_length; - type->howmany = packet_length; - } - - if(type->fun == M_vsxxx_aa) { - setspeed(fd, 4800, 4800, 0, flags); /* no write */ - write(fd, "R", 1); /* initialize a mouse; without getting an "R" */ - /* - * a mouse does not send a bytestream - */ - } - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/i.c deleted file mode 100644 index ed3df8c2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/i.c +++ /dev/null @@ -1,158 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep, write */ -#include /* select */ -#include /* termios */ -#include /* string */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* setspeed */ - -extern int SUMMA_BORDER; - -extern int summamaxx; - -extern int summamaxy; - -extern signed char summaid; - -Gpm_Type *I_summa(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - void resetsumma() { - write(fd, 0, 1); /* Reset */ - usleep(400000); /* wait */ - } - int waitsumma() { - struct timeval timeout; - - fd_set readfds; - - int err; - - FD_ZERO(&readfds); - FD_SET(fd, &readfds); - timeout.tv_sec = 0; - timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return (err); - } - int err; - - char buffer[255]; - - char config[5]; - - /* - * Summasketchtablet (from xf86summa.o: thanks to Steven Lang - * ) - */ -#define SS_PROMPT_MODE "B" /* Prompt mode */ -#define SS_FIRMID "z?" /* Request firmware ID string */ -#define SS_500LPI "h" /* 500 lines per inch */ -#define SS_READCONFIG "a" -#define SS_ABSOLUTE "F" /* Absolute Mode */ -#define SS_TABID0 "0" /* Tablet ID 0 */ -#define SS_UPPER_ORIGIN "b" /* Origin upper left */ -#define SS_BINARY_FMT "zb" /* Binary reporting */ -#define SS_STREAM_MODE "@" /* Stream mode */ - /* - * Geniustablet (hisketch.txt) - */ -#define GEN_MMSERIES ":" - char GEN_MODELL = 0x7f; - - /* - * Set speed to 9600bps - */ - setspeed(fd, 1200, 9600, 1, - B9600 | CS8 | CREAD | CLOCAL | HUPCL | PARENB | PARODD); - resetsumma(); - - write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE)); - - if(strstr(type->name, "acecad") != NULL) - summaid = 11; - - if(summaid < 0) { /* Summagraphics test */ - /* - * read the Summa Firm-ID - */ - write(fd, SS_FIRMID, strlen(SS_FIRMID)); - err = waitsumma(); - if(!((err == -1) || (!err))) { - summaid = 10; /* Original Summagraphics */ - read(fd, buffer, 255); /* Read Firm-ID */ - } - } - - if(summaid < 0) { /* Genius-test */ - resetsumma(); - write(fd, GEN_MMSERIES, 1); - write(fd, &GEN_MODELL, 1); /* Read modell */ - err = waitsumma(); - if(!((err == -1) || (!err))) { /* read Genius-ID */ - err = waitsumma(); - if(!((err == -1) || (!err))) { - err = waitsumma(); - if(!((err == -1) || (!err))) { - read(fd, &config, 1); - summaid = (config[0] & 224) >> 5; /* genius tablet-id - * (0-7) */ - } - } - } - } - - /* - * end of Geniustablet-test - */ - /* - * unknown tablet ? - */ - if((summaid < 0) || (summaid == 11)) { - resetsumma(); - write(fd, SS_BINARY_FMT SS_PROMPT_MODE, 3); - } - - /* - * read tablet size - */ - err = waitsumma(); - if(!((err == -1) || (!err))) - read(fd, buffer, sizeof(buffer)); - write(fd, SS_READCONFIG, 1); - read(fd, &config, 5); - summamaxx = (config[2] << 7 | config[1]) - (SUMMA_BORDER * 2); - summamaxy = (config[4] << 7 | config[3]) - (SUMMA_BORDER * 2); - - write(fd, SS_ABSOLUTE SS_STREAM_MODE SS_UPPER_ORIGIN, 3); - if(summaid < 0) - write(fd, SS_500LPI SS_TABID0 SS_BINARY_FMT, 4); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/m.c deleted file mode 100644 index 2f2adbd4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/m.c +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ -#include "daemon.h" /* which_mouse / win */ - -/* Summagraphics/Genius/Acecad tablet support absolute mode*/ - -/* Summagraphics MM-Series format*/ - -/* (Frank Holtz) hof@bigfoot.de Tue Feb 23 21:04:09 MET 1999 */ -int SUMMA_BORDER = 100, summamaxx, summamaxy; - -signed char summaid = -1; - -int M_summa(Gpm_Event * state, unsigned char *data) -{ - int x, y; - - x = ((data[2] << 7) | data[1]) - SUMMA_BORDER; - if(x < 0) - x = 0; - if(x > summamaxx) - x = summamaxx; - state->x = (x * win.ws_col / summamaxx); - realposx = (x * 16383 / summamaxx); - - y = ((data[4] << 7) | data[3]) - SUMMA_BORDER; - if(y < 0) - y = 0; - if(y > summamaxy) - y = summamaxy; - state->y = 1 + y * (win.ws_row - 1) / summamaxy; - realposy = y * 16383 / summamaxy; - - state->buttons = - !!(data[0] & 1) * GPM_B_LEFT + - !!(data[0] & 2) * GPM_B_RIGHT + !!(data[0] & 4) * GPM_B_MIDDLE; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/r.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/r.c deleted file mode 100644 index 5d275807..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/summa/r.c +++ /dev/null @@ -1,60 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* REALPOS */ - -/* Thu Jan 28 20:54:47 MET 1999 hof@hof-berlin.de SummaSketch reportformat */ -int R_summa(Gpm_Event * state, int fd) -{ - signed char buffer[5]; - - static int x, y; - - if(realposx == -1) { /* real absolute device? */ - x = x + (state->dx * 25); - if(x < 0) - x = 0; - if(x > 16383) - x = 16383; - y = y + (state->dy * 25); - if(y < 0) - y = 0; - if(y > 16383) - y = 16383; - } else { /* yes */ - x = realposx; - y = realposy; - } - - buffer[0] = 0x98 + ((state->buttons & GPM_B_LEFT) > 0 ? 1 : 0) + - ((state->buttons & GPM_B_MIDDLE) > 0 ? 2 : 0) + - ((state->buttons & GPM_B_RIGHT) > 0 ? 3 : 0); - buffer[1] = x & 0x7f; /* X0-6 */ - buffer[2] = (x >> 7) & 0x7f; /* X7-12 */ - buffer[3] = y & 0x7f; /* Y0-6 */ - buffer[4] = (y >> 7) & 0x7f; /* Y7-12 */ - - return write(fd, buffer, 5); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/sun/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/sun/m.c deleted file mode 100644 index d22ad304..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/sun/m.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -int M_sun(Gpm_Event * state, unsigned char *data) -{ - state->buttons = (~data[0]) & 0x07; - state->dx = (signed char) (data[1]); - state->dy = -(signed char) (data[2]); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/sun/r.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/sun/r.c deleted file mode 100644 index 3df1137b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/sun/r.c +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* write */ - -#include "types.h" /* Gpm_type */ - -int R_sun(Gpm_Event * state, int fd) -{ - signed char buffer[3]; - - buffer[0] = (state->buttons ^ 0x07) | 0x80; - buffer[1] = state->dx; - buffer[2] = -(state->dy); - return write(fd, buffer, 3); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics/synaptics.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics/synaptics.c deleted file mode 100644 index 5e675e48..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics/synaptics.c +++ /dev/null @@ -1,3622 +0,0 @@ - -/* - * synaptics.c - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies) - * Geert Van der Plas provided the code to support - * older Synaptics PS/2 touchpads. - * - * Synpatics Passthrough Support Copyright (C) 2002 Linuxcare Inc. - * dkennedy@linuxcare.com (David Kennedy) - * - * 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. - * - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -** -** Parameters: -** search below for configuration constants -*/ - -/* Pebl - pebl@diku.dk 20/12/2001 08:06. -** -** I want to have more features :). Every touch pad (ps2 and serial) is now be -** supported according to STIG and every feature/capability is read. However -** there seems to be some very old serial touchpads that have an advanced -** mode not mentioned in STIG. -** -** -** Further I have added the following -** -** Emulation of scrolling -** The window drivers allow using the edge to emulate a wheel -** mouse. When putting the finger at the right edge, a movement up or -** down translates to wheel movement. Taking the finger to the -** top/button edge keeps the wheel turning. Lift the finger again to -** operate normally again. Another option is to do a toss scrolling. -** -** Stick attached to a synaptic touchpad (aka styk) -** Some touchpads have a stick "attached", so they share the same port. -** In absolute mode the stick protocol is a simple ps2 protocol, except -** it is sent in an absolute packet. (In relative mode both uses ps2) -** Some sticks send packets when pressed (different from moved), which -** will be reported as left button. -** -** 4 Way button attached to a touchpad -** Likewise some touchpads have a round button giving the choices of -** four way to press the button. The packet is nearly identical to the -** stick, turn off the stick if you have this button. This is no longer -** needed. The button can act as a mouse or as buttons which can be -** changed on the fly. The buttons can be configured just as the -** touchpads corners. -** -** Four buttons to work -** Some touchpads have 4 buttons. Only 3 was read and the last was set to -** up or down "button". They can be configured just as the -** touchpads corners. -** -** Multiple fingers -** I have added an option to detect such by looking at pressure levels, -** which is not that great. If the pad have the capability to detect it, -** this is used instead, but this far from optimal. It does detect two -** horizontal parted finger if in same vertical position, otherwise the -** detection is bad. This is/was a problem as my wrist lays on the -** laptop which gives a 45 deg to horizontal for my fingers. Now I try -** to add further detections, which works for me in 95% of the -** time. -** -** Multi finger tap -** Using 1,2 or 3 fingers to make a tap translates into left, right or -** middle button pressed. I originally thought about doing what is -** called a "HOP" where after a quick finger shift the distance of the -** hop decides which button is pressed. I dropped it partly because -** synaptics did in version 3.2 and because it was harder than I -** thought. Multifinger taps can be configured just as the touchpads corners. -** -** Multi finger less sensitive -** Adding or removing a finger or just accidently touch the pad with -** the palm while using the pad causes the pad to report the average -** position between the touched places. This of cause gives annoying -** erratic movements. When adding or removing fingers are detected -** the mouse is stop for some small time to avoid this. This is not -** perfect as the finger detection is not perfect, but it helps a lot! -** -** Palm detection -** Some touchpads tries to detect whether the reported data is from a -** palm or similar. When reading this signal the movement is -** stopped. Except the detection does not work very well :( -** -** -** Enabling/disabling touchpad -** A new corner action is to disable the touchpad. It is enabled again -** by tapping the same corner. This is useful if I know I am going -** to write a lot. The stick still works. -** -** Debugging corner action -** A corner action now allows toggling the debug information. -** -** -** The structure has changed to handle both serial and ps2 touchpads. Many -** variable names have changed. -** -** The documentation referred to is from -** "Synaptics TouchPad Interfacing Guide" revision 2.5 -** or just STIG -** -**/ - -/* -** TODO -** - handle other versions of synaptics touchpads (mine is 3.4 firmware) -** (this should be close) -** - test this with more Synaptics touch pads (laptops and such) -** - provide a configuration interface to adjust parameters and -** enabled features -** - determine appropriate ranges for adjusting parameters -** -** TODO (pebl) -** - Two pads can not be used at the same time (internal/external) -** - Move a lot of the comments to a readme file. -** - Allow normal taps in unused corners. -** - Better detection of spontaneous reseting touchpad. -** - Implement resend command for serial connection. -** - Only start scrolling if mostly vertical movement. -** - Disable/enable command for serial touchpad. -** - Clean up the mess about extended packets with pressure 0. -** - source splitting of normal touchpad functions and synaptic specific and -** add other touchpads. -*/ - -/** -** Notation: -** A gesture means a motion or action that is not a regular mouse movement. -** -** Wmode is an absolute mode where no gesture is signaled by the touchpad, only -** supported on newer versions. -** -** variables *_enabled are use for enable behaviors that may not supported in -** the touchpad. -** -** Many variables have two counterparts (and some that dont should have): a -** *_time and *_packet, where the first is in msec and the latter is the same -** time converted to the number of packets, when using 80 packets per second. -** -** Variables: -** last_* is for last reviewed packet, not last reported/calculated movement/event. -** was_* is for last event, not necessary last packet. -** -** -** Data process line: -** -** syn_process_ps2_data ---- syn_translate_serial_data -- ----------------------------------------------- -** (handles also wmode) | | | -** | | V -** |- syn_preprocess_report --- syn_process_wmode_report --- syn_process_report -** | -** syn_process_serial_data --- syn_translate_ps2_wmode_data -- -** | | -** | | -** -- syn_translate_ps2_data ---- -** -** -*/ - -#include /* ceil */ -#include -#include -#include -#include -#include -#include - -#include "gpm.h" -#include "daemon.h" /* which_mouse */ -#include "synaptics.h" -#include "message.h" - -#define DEBUG 1 -#undef DEBUG - -#ifdef DEBUG -# define DEBUG_SYNAPTIC -# define DEBUG_PARAMS 1 -# define DEBUG_FLUSH 1 -# define DEBUG_RESET 1 -# define DEBUG_SENT_DATA 1 -# define DEBUG_RECEIVED_DATA 1 -# define DEBUG_TOSS 1 -# define DEBUG_PALM 1 -# define DEBUG_STICK 1 -# define DEBUG_TAPS 1 -# define DEBUG_MULTI_FINGER 1 -# define DEBUG_CMD 1 -# define DEBUG_GETBYTE 1 /* this is VERY verbose */ -# undef DEBUG_PUTBYTE 1 /* this is VERY verbose */ -# define DEBUG_PUTBYTE_ACK 1 /* this is VERY verbose */ -# define DEBUG_REPORTS 1 /* this is VERY verbose */ -#endif - -/* The next is UGLY, but I only want debug info from this file */ - -/* it's really ugly and you shouldn't use this. Instead use - * gpm -D | grep filename.c. - * ifdef DEBUG should not be used anymore! */ - -/* pebl: But this require that I boot my machine with gpm -D which I dont. The - intention is that when I am doing my normal doing, and the touchpad suddenly - behaves strange, I can start debuging without restarting gpm, using a - corneraction. -*/ - -/* BAD CODE BEGIN -#ifdef DEBUG_SYNAPTIC -# include - static int debug_syn_to_stderr = 1; - - static void gpm_report_static(int line, char *file, int stat, char* fmt, ... ) { - - va_list ap; - va_start(ap, fmt); - if (debug_syn_to_stderr){ - vfprintf(stderr, fmt, ap); - fputs("\n", stderr); - }else{ - gpm_report(line,file,stat,fmt,&ap); - } - va_end(ap); - - } -# define gpm_report gpm_report_static -#endif - -* END BADE CODE */ - -/* Prototype */ -typedef unsigned char byte; - -static void syn_ps2_absolute_mode(int fd); - -static char *syn_model_name(int sensor); - -static void syn_ps2_send_cmd(int fd, int stick, byte cmd); - -/* Defines */ - -#define abs(value) ((value) < 0 ? -(value) : (value)) -#define check_bits(value,mask) (((value) & (mask)) == (mask)) -#define sqr(value) ((value) * (value)) -#define distance(dx,dy) (sqr(dx) + sqr(dy)) -#define mod4(value) ((value) % 4) -#define max(x,y) ((x)>(y)?(x):(y)) - -/* -** Define the edge bit values. -*/ -#define LEFT_EDGE 0x01 -#define RIGHT_EDGE 0x02 -#define TOP_EDGE 0x04 -#define BOTTOM_EDGE 0x08 -#define UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) -#define LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) -#define UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) -#define LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) -#define is_corner(edges) (((edges) & (LEFT_EDGE | RIGHT_EDGE)) && \ - ((edges) & (TOP_EDGE | BOTTOM_EDGE))) - -/* -** Define the action button bit values. -*/ -#define RIGHT_BUTTON 0x01 -#define MIDDLE_BUTTON 0x02 -#define LEFT_BUTTON 0x04 -#define FOURTH_BUTTON 0x08 -#define UP_BUTTON 0x10 -#define DOWN_BUTTON 0x20 -#define ONE_FINGER 0x01 -#define TWO_FINGERS 0x02 -#define THREE_FINGERS 0x04 -#define FOUR_UP_BUTTON 0x01 -#define FOUR_DOWN_BUTTON 0x02 -#define FOUR_LEFT_BUTTON 0x04 -#define FOUR_RIGHT_BUTTON 0x08 -#define STICK_RIGHT_BUTTON 0x01 -#define STICK_MIDDLE_BUTTON 0x02 -#define STICK_LEFT_BUTTON 0x04 - -/* -** Define additional gpm button bit values. -*/ -#define GPM_B_NOT_SET (-1) - -/* -** Define the guest and touchpad devices. -*/ -#define DEVICE_TOUCHPAD 0 -#define DEVICE_STICK 1 - -/**************************************************************************** -** -** Configuration constants. -** -** Those with C at the end are suitable for adjustment by a configuration -** program. -****************************************************************************/ - -static int corner_taps_enabled = 1; /* are corner taps enabled C */ - -static int tap_gesture_enabled = 1; /* are gestures treaded as taps enabled - * C */ -static int tossing_enabled = 1; /* is toss/catch enabled C */ - -static int does_toss_use_static_speed = 1; /* is toss/catch speed C */ - - /* - * based on toss dist - */ -static int edge_motion_enabled = 1; /* is edge motion enabled C */ - -static int edge_motion_speed_enabled = 1; /* does pressure control C */ - - /* - * speed of edge motion - */ -static int pressure_speed_enabled = 1; /* does pressure control C */ - - /* - * speed in non edges - */ -static int tap_hold_edge_motion_enabled = 1; /* Enable edge motion while - * holding a tap C */ - -/* pressure induced speed related configuration constants */ -static int low_speed_pressure = 60; - - /*C*/ static int speed_up_pressure = 60; - - /*C*/ static float speed_pressure_factor = 0.05; - - /*C*/ static float standard_speed_factor = 0.08; - - /*C*/ - -/* toss/catch related constants */ -static int min_toss_time = 100; /* ms: 0.10 sec */ - -static int max_toss_time = 300; /* ms: 0.30 sec */ - - /*C*/ static int prevent_toss_time = 300; /* ms: 0.25 sec */ - - /*C*/ static int min_toss_dist = 2; /* mm */ - - /*C*/ static int static_toss_speed = 70; - - /*C*/ static float toss_speed_factor = 0.5; - - /*C*/ - -/* edge motion related configuration constants */ -static int x_min_center = 1632; /* define left edge C */ - -static int x_max_center = 5312; /* define right edge C */ - -static int y_min_center = 1408; /* define bottom edge C */ - -static int y_max_center = 4108; /* define top edge C */ - -static int edge_speed = 20; /* default speed at edges C */ - -/* gesture related configuration constants for when wmode is enabled. */ -static int wmode_enabled = 1; /* is wmode enabled C */ - -static int drag_lock_enabled = 1; /* is drag locking enabled C */ - -static int finger_threshold = 30; /* pressure before it is a finger C */ - -static int tap_lower_limit = 5; /* a tap last at least this long C */ - -static int tap_upper_limit = 200; /* a tap is at most this long C */ - -static int tap_range = 100; /* mm finger movement limit C */ - -static int tap_interval = 200; /* a tap reports button press this long C */ - -static int multiple_tap_delay = 30; /* time between reported button pressed - * C */ -static int pads_tap_interval = 8; /* if pad sends gestures, what is it's - * tap_interval. C */ - -/* wmode capabilities */ -static int palm_detect_enabled = 1; /* Ignore when palm on pad C */ - -static int palm_detect_level = 12; /* Detecting a palm level (between - * 0-11) C */ -static int multi_finger_tap_enabled = 1; /* No of fingers decides which - * button is pressed C */ -static int multi_finger_stop_enabled = 1; /* less sensitive mouse with - * multi finger C */ -static int multi_finger_stop_delay = 8; /* how long to stop after a multifinger - * detection. C */ -static int fake_finger_layer_enabled = 1; /* add an extra software layer - * to detect multi fingers C */ - -/* mixed configurations */ -static int touchpad_enabled = 1; /* Disable the touch pad, see corner - * action turn_on_off. C */ -static int stick_enabled = 1; /* Some machines have a touchpad and a stick on - * same device port. The stick will be ignored - * in absolute mode, this option try to - * recognize it's packets. C */ -static int stick_pressure_enabled = 1; /* A (hard) press on the stick is - * reported as left click C */ -static int four_way_button_enabled = 1; /* Round button giving 4 choices on - * some touchpads C */ -static int four_way_button_is_mouse = 1; /* Is the button: 4 buttons or - * does it moves the mouse. C */ -static int scrolling_enabled = 1; /* Simulate wheel mouse in at the right - * edge C */ -static int scrolling_edge = RIGHT_EDGE; /* Which edge is a the scrolling edge C - */ -static int scrolling_speed = 10; /* less is faster, 1 fastest */ - -static float scrolling_button_factor = 0.5; /* How fast should a - * button/corner tap scroll, - * higher faster C */ -static int auto_scrolling_enabled = 1; /* Moving to the upper/lower edge keeps - * scrolling up/downC */ -static int auto_scrolling_factor = 2.0; /* How fast should autoscrolling be C */ - -static int reset_on_error_enabled = 0; /* If a packet does not conform to any - * absolute protocol should we reset - * the touchpad? This is wrong, because - * * we should rather find out why it - * does that in first place. Do not - * turn it on per default. */ - -/* -** Types for describing actions. When adding a new action, place it as -** the last item. It will break old configurefiles otherwise. -*/ -typedef enum { - No_Action = 0, - Left_Button_Action, - Middle_Button_Action, - Right_Button_Action, - Fourth_Button_Action, - Up_Button_Action, - Down_Button_Action, - Turn_On_Off_Action, - Debug_On_Off_Action, - Reset_Touchpad_Action, - Toggle_Four_Way_Button_Action, - Toggle_Stick_Pressure_Action, - Toggle_Scrolling_Action, - Left_Double_Click_Action, -} action_type; - -typedef struct { - int action_mask; - action_type action; -} touchpad_action_type; - -static touchpad_action_type corner_actions[] = { - {UPPER_LEFT_CORNER, No_Action}, - {LOWER_LEFT_CORNER, No_Action}, - {UPPER_RIGHT_CORNER, Middle_Button_Action}, - {LOWER_RIGHT_CORNER, Right_Button_Action}, - {0, No_Action} /* stop flag value */ -}; - -static touchpad_action_type normal_button_actions[] = { - {LEFT_BUTTON, Left_Button_Action}, - {MIDDLE_BUTTON, Middle_Button_Action}, - {RIGHT_BUTTON, Right_Button_Action}, - {FOURTH_BUTTON, Fourth_Button_Action}, - {UP_BUTTON, Up_Button_Action}, - {DOWN_BUTTON, Down_Button_Action}, - {0, No_Action} /* stop flag value */ -}; - -static touchpad_action_type multi_finger_actions[] = { - {ONE_FINGER, Left_Button_Action}, - {TWO_FINGERS, Right_Button_Action}, - {THREE_FINGERS, Middle_Button_Action}, - {0, No_Action} /* stop flag value */ -}; - -static touchpad_action_type four_button_actions[] = { - {FOUR_LEFT_BUTTON, Middle_Button_Action}, - {FOUR_RIGHT_BUTTON, Fourth_Button_Action}, - {FOUR_UP_BUTTON, Up_Button_Action}, - {FOUR_DOWN_BUTTON, Down_Button_Action}, - {0, No_Action} /* stop flag value */ -}; - -static touchpad_action_type stick_actions[] = { - {LEFT_BUTTON, Left_Button_Action}, - {MIDDLE_BUTTON, Middle_Button_Action}, - {RIGHT_BUTTON, Right_Button_Action}, - {0, No_Action} /* stop flag value */ -}; - -/* -** These types are used to read the configuration data from the config file. -*/ -typedef enum { - Integer_Param, - Float_Param, - Flag_Param, - Action_Param -} param_type_type; - -typedef struct { - char *name; - param_type_type p_type; - union { - void *gen_p; /* avoids complaints by the compiler later on */ - int *int_p; - float *float_p; - int *flag_p; - touchpad_action_type *corner_p; - } addr; -} param_data_type; - -static param_data_type param_data[] = { - /* - * enabling configuration parameters - */ - {"edge_motion_enabled", Flag_Param, {&edge_motion_enabled}}, - {"edge_motion_speed_enabled", Flag_Param, {&edge_motion_speed_enabled}}, - {"corner_taps_enabled", Flag_Param, {&corner_taps_enabled}}, - {"tap_gesture_enabled", Flag_Param, {&tap_gesture_enabled}}, - {"pressure_speed_enabled", Flag_Param, {&pressure_speed_enabled}}, - {"tossing_enabled", Flag_Param, {&tossing_enabled}}, - {"does_toss_use_static_speed", Flag_Param, {&does_toss_use_static_speed}}, - {"tap_hold_edge_motion_enabled", Flag_Param, - {&tap_hold_edge_motion_enabled}}, - - /* - * pressure induced speed related configuration parameters - */ - {"low_pressure", Integer_Param, {&low_speed_pressure}}, - {"speed_up_pressure", Integer_Param, {&speed_up_pressure}}, - {"pressure_factor", Float_Param, {&speed_pressure_factor}}, - {"standard_speed_factor", Float_Param, {&standard_speed_factor}}, - /* - * toss/catch related parameters - */ - {"min_toss_time", Integer_Param, {&min_toss_time}}, - {"max_toss_time", Integer_Param, {&max_toss_time}}, - {"prevent_toss_time", Integer_Param, {&prevent_toss_time}}, - {"min_toss_dist", Integer_Param, {&min_toss_dist}}, - {"static_toss_speed", Integer_Param, {&static_toss_speed}}, - {"toss_speed_factor", Float_Param, {&toss_speed_factor}}, - /* - * edge motion related configuration parameters - */ - {"x_min_center", Integer_Param, {&x_min_center}}, - {"x_max_center", Integer_Param, {&x_max_center}}, - {"y_min_center", Integer_Param, {&y_min_center}}, - {"y_max_center", Integer_Param, {&y_max_center}}, - {"edge_speed", Integer_Param, {&edge_speed}}, - /* - * use wmode - */ - {"wmode_enabled", Flag_Param, {&wmode_enabled}}, - {"drag_lock_enabled", Flag_Param, {&drag_lock_enabled}}, - {"finger_threshold", Integer_Param, {&finger_threshold}}, - {"tap_lower_limit", Integer_Param, {&tap_lower_limit}}, - {"tap_upper_limit", Integer_Param, {&tap_upper_limit}}, - {"tap_range", Integer_Param, {&tap_range}}, - {"tap_interval", Integer_Param, {&tap_interval}}, - {"multiple_tap_delay", Integer_Param, {&multiple_tap_delay}}, - {"pads_tap_interval", Integer_Param, {&pads_tap_interval}}, - /* - * Additional wmode parameters - */ - {"palm_detect_enabled", Flag_Param, {&palm_detect_enabled}}, - {"palm_detect_level", Integer_Param, {&palm_detect_level}}, - {"multi_finger_tap_enable", Flag_Param, {&multi_finger_tap_enabled}}, - {"multi_finger_stop_enabled", Flag_Param, {&multi_finger_stop_enabled}}, - {"multi_finger_stop_delay", Integer_Param, {&multi_finger_stop_delay}}, - {"fake_finger_layer_enabled", Integer_Param, {&fake_finger_layer_enabled}}, - /* - * Additional options - */ - {"touchpad_enabled", Flag_Param, {&touchpad_enabled}}, - {"stick_enabled", Flag_Param, {&stick_enabled}}, - {"stick_pressure_enabled", Flag_Param, {&stick_pressure_enabled}}, - {"four_way_button_enabled", Flag_Param, {&four_way_button_enabled}}, - {"four_way_button_is_mouse", Flag_Param, {&four_way_button_is_mouse}}, - {"scrolling_enabled", Flag_Param, {&scrolling_enabled}}, - {"auto_scrolling_enabled", Flag_Param, {&auto_scrolling_enabled}}, - {"scrolling_edge", Integer_Param, {&scrolling_edge}}, - {"scrolling_speed", Integer_Param, {&scrolling_speed}}, - {"scrolling_button_factor", Float_Param, {&scrolling_button_factor}}, - {"auto_scrolling_factor", Float_Param, {&auto_scrolling_factor}}, - /* - * corner tap actions - */ - {"upper_left_action", Action_Param, {&corner_actions[0]}}, - {"lower_left_action", Action_Param, {&corner_actions[1]}}, - {"upper_right_action", Action_Param, {&corner_actions[2]}}, - {"lower_right_action", Action_Param, {&corner_actions[3]}}, - /* - * no. of fingers tap actions - */ - {"one_finger_tap_action", Action_Param, {&multi_finger_actions[0]}}, - {"two_fingers_tap_action", Action_Param, {&multi_finger_actions[1]}}, - {"three_fingers_tap_action", Action_Param, {&multi_finger_actions[2]}}, - /* - * normal button actions - */ - {"left_button_action", Action_Param, {&normal_button_actions[0]}}, - {"middle_button_action", Action_Param, {&normal_button_actions[1]}}, - {"right_button_action", Action_Param, {&normal_button_actions[2]}}, - {"fourth_button_action", Action_Param, {&normal_button_actions[3]}}, - {"up_button_action", Action_Param, {&normal_button_actions[4]}}, - {"down_button_action", Action_Param, {&normal_button_actions[5]}}, - /* - * 4 way button actions - */ - {"four_way_left_button_action", Action_Param, {&four_button_actions[0]}}, - {"four_way_right_button_action", Action_Param, {&four_button_actions[1]}}, - {"four_way_up_button_action", Action_Param, {&four_button_actions[2]}}, - {"four_way_down_button_action", Action_Param, {&four_button_actions[3]}}, - /* - * Synaptic Stick (passthrugh,stick) actions - */ - {"stick_left_button_action", Action_Param, {&stick_actions[0]}}, - {"stick_middle_button_action", Action_Param, {&stick_actions[1]}}, - {"stick_right_button_action", Action_Param, {&stick_actions[2]}}, - /* - * end of list - */ - {NULL, Flag_Param, {NULL}} -}; - -/* -** The information returned in the identification packet. -** STIG page 10 -*/ -typedef struct { - int info_model_code; - int info_major; - int info_minor; -} info_type; - -static info_type ident[2]; - -/* -** The information returned in the model ID packet. -** STIG page 11 -*/ - -#define INFO_ROT180_BITS 0x800000 /* bit 23 */ -#define INFO_PORTRAIT_BITS 0x400000 /* bit 22 */ -#define INFO_SENSOR_BITS 0x3F0000 /* bit 16-21 */ -#define INFO_HARDWARE_BITS 0x00FE00 /* bit 9-15 */ -#define INFO_NEW_ABS_BITS 0x000080 /* bit 7 */ -#define INFO_CAP_PEN_BITS 0x000040 /* bit 6 */ -#define INFO_SIMPLE_CMD_BITS 0x000020 /* bit 5 */ -#define INFO_GEOMETRY_BITS 0x00000F /* bit 0-3 */ - -typedef struct { - int info_rot180; - int info_portrait; - int info_sensor; - int info_hardware; - int info_new_abs; - int info_cap_pen; - int info_simple_cmd; - int info_geometry; -} model_id_type; - -static model_id_type model[2]; - -/* -** The sensor types as of STIG 2.5 -** Page 11. Plus some guessing. -*/ -static char *model_names[] = { - "Unknown", /* 0 */ - "Standard TouchPad (TM41xx134)", - "Mini Module (TM41xx156)", - "Super Module (TM41xx180)", - "Romulan Module", - "Apple Module", - "Single Chip", - "Flexible pad (discontinued)", - "Ultra-thin Module (TM41xx220)", - "Wide pad Module (TW41xx230)", - "TwinPad", /* 10 */ - "StampPad Module (TM41xx240)", - "Sub-mini Module (TM41xx140)", - "MultiSwitch module (TBD)", - "Standard Thin", - "Advanced Technology Pad (TM41xx221)", - "Ultra-thin Module, connector reversed", - "Low Power Module", - "Thin Module, ATP", - "Snap dome Module, ATP", - "FlexArm Module", /* 20 */ - "TWIII Module (TouchWriter 3)", - "TWIII Module (P64)", - "Combo Module", - "Squish Module", - "Thin TTL Serial module", - "TWIII Ultra Thin Module", - "PS/2 Passthrough", - "4 Button On Board Module", - "6 Buttons Off Board Module", - "6 Buttons On Board Module", /* 30 */ - "Ultrathin TTL serial Module", - "ClearPad Module", - "HyperThin Sensor Module", - "Pad With Scroll Strip", - "UltraThin TTL rounded, serial Module", - "Ultrathin ATP Module", - "SubMini w/6 buttons", - "Standard USB Module", - "cPad Dropin Plain USB Module", - "cPad", /* 40 */ - "", - "", - "", - "UltraNav", -}; - -/* -** Define the information known about a sensor. -** STIG page 14. -** Resolution only apply for absolute mode. -** For older models the default resolution is 85x94. -*/ -typedef struct { - char *model; - int x_per_mm; - int y_per_mm; - float width_mm; - float height_mm; -} sensor_info_type; - -static sensor_info_type sensor_info[] = { - {"", 0, 0, 0.0, 0.0}, - {"Standard", 85, 94, 47.1, 32.3}, - {"Mini", 91, 124, 44.0, 24.5}, - {"Super", 57, 58, 70.2, 52.4}, - {"", 0, 0, 0.0, 0.0}, - {"", 0, 0, 0.0, 0.0}, - {"", 0, 0, 0.0, 0.0}, - {"", 0, 0, 0.0, 0.0}, - {"UltraThin", 85, 94, 47.1, 32.3}, - {"Wide", 73, 96, 54.8, 31.7}, - {"", 0, 0, 0.0, 0.0}, - {"Stamp", 187, 170, 21.4, 17.9}, - {"SubMini", 122, 167, 32.8, 18.2}, -}; - -static sensor_info_type *sensor[2] = { - &sensor_info[0], &sensor_info[0] -}; - -/* -** The information returned in the extended capability packet. -** STIG page 15 -*/ - -#define EXT_CAP_EXTENDED 0x8000 /* Bit 15 */ -#define EXT_CAP_STICK 0x0080 /* Bit 8 */ -#define EXT_CAP_PASS_THROUGH 0X0080 /* Bit 8!! */ -#define EXT_CAP_SLEEP 0x0010 /* Bit 4 */ -#define EXT_CAP_FOUR_BUTTON 0x0008 /* Bit 3 */ -#define EXT_CAP_MULTI_FINGER 0X0002 /* Bit 1 */ -#define EXT_CAP_PALM_DETECT 0X0001 /* Bit 0 */ - -typedef struct { - int cap_ext; - int cap_stick; - int cap_sleep; - int cap_four_button; - int cap_multi_finger; - int cap_palm_detect; -} ext_cap_type; - -static ext_cap_type capabilities[2]; - -/* -** The information in the mode byte. -** STIG Page 17 -*/ -#define ABSOLUTE_MODE 0x80 /* Bit 7 set */ -#define RELATIVE_MODE 0x00 /* Bit */ -#define HIGH_REPORT_RATE 0x40 /* Bit 6 set = 80 packages per second */ -#define LOW_REPORT_RATE 0x00 /* Bit 40 packages per second */ -#define USE_9600_BAUD 0x08 /* Bit 3 for serial protocol */ -#define USE_1200_BAUD 0x00 /* Bit */ -#define PS2_SLEEP 0x08 /* Bit 3 for ps2 protocol */ -#define PS2_NO_SLEEP 0x00 /* Bit (only button press activates touchpad - * again) */ -#define NO_TAPDRAG_GESTURE 0x04 /* Bit 2 for model version >= 4 */ -#define TAPDRAG_GESTURE 0x00 /* Bit */ -#define EXTENDED_REPORT 0x02 /* Bit 1 for serial protocol absolute mode only - */ -#define NORMAL_REPORT 0x00 /* Bit */ -#define STICK_DISABLE 0x02 /* Bit 1 for ps2 protocol this disables any - * stick attached */ -#define STICK_ENABLED 0x00 /* Bit */ -#define REPORT_W_ON 0x01 /* Bit 0 set */ -#define REPORT_W_OFF 0x00 /* Bit */ - -/* -** The format of the translated data to a report. -*/ -typedef struct { - int left; - int middle; - int right; - int fourth; - int up; - int down; - int x; - int y; - int pressure; - int gesture; - int fingers; - int fingerwidth; - int w; -} report_type; - -static report_type last_report, cur_report; - -/* -** A location record. -** This is needed to make an average over several packages, -** because the reported x,y might not be that accurate. -*/ -typedef struct { - int x; - int y; -} location_type; - -/* -** Parameters for controlling the touchpad. -*/ - -/* touchpad information */ -static int res_x; - -static int res_y; - -static int x_per_mm; - -static int y_per_mm; - -/* status information */ -static int packet_num = 0; - -static int was_edges = 0; - -static int was_non_edge = 0; - -static location_type last_locs[4]; - -static Gpm_Event last_state; - -static int tap_lower_limit_packet; - -static int tap_upper_limit_packet; - -static int last_corner_action = GPM_B_NOT_SET; - -static int last_finger_action = GPM_B_NOT_SET; - -static int last_normal_button_actions[6] = - { GPM_B_NOT_SET, GPM_B_NOT_SET, GPM_B_NOT_SET, GPM_B_NOT_SET, GPM_B_NOT_SET, - GPM_B_NOT_SET -}; -static int last_stick_button_actions[8] = - { GPM_B_NOT_SET, GPM_B_NOT_SET, GPM_B_NOT_SET }; -static int last_4_way_button_actions[8] = - { GPM_B_NOT_SET, GPM_B_NOT_SET, GPM_B_NOT_SET, GPM_B_NOT_SET }; - -/* toss status information */ -static int is_tossing = 0; - -static int was_tossing = 0; - -static int min_toss_dist__2 = 32000; - -static int max_toss_packets; - -static int min_toss_packets; - -static int prevent_toss_packets; - -static int toss_timer; - -static location_type toss_speed; - -static location_type touch_loc; - -/* Multi tap information */ -static int gesture_delay = 0; - -static int fake_forget_tap_interval = 0; /* if hardware sends tap-hold, - * we need to keep track */ -static int fake_time_to_forget_tap = 0; /* not to lose user defined actions in - * the hold periode. (action like: - * Multifingers, non-repeating actions - * etc. */ - -/* Multi finger information */ -static int was_fingers = 0; - -static int multi_finger_stop_timer = 0; - -static int multi_finger_pressure = 0; - -static int multi_finger_xy = 0; - -/* Scrolling information */ -static int is_scrolling = 0; /* Scrolling using touchpad edge */ - -static int is_always_scrolling = 0; /* Only report scrolling, no mouse - * movement */ -static int scrolling_speed_timer = 0; - -static int scrolling_amount_left = 0; /* Tells how much to scroll up or down */ - -/**************************************************************************** -** -** ROUTINES for processing either type of touchpad. -** -****************************************************************************/ - -/* -** Dump the report data for debugging. -** -** Because the synaptics sends (trivial) data in one second after last touch, -** which makes reading the debug data harder, only dump the report if it is different -** than the previously dumped. -*/ -#if DEBUG_REPORTS -static void tp_dump_report_data(report_type report, - int edges, Gpm_Event * state) -{ - static report_type last_report_reported; - - static unsigned int times_report_repeated = 0; - - report.left |= state->buttons & GPM_B_LEFT; - report.right |= state->buttons & GPM_B_RIGHT; - report.middle |= state->buttons & GPM_B_MIDDLE; - - if(memcmp(&report, &last_report_reported, sizeof(report_type)) == 0) { - times_report_repeated++; - return; - } - - /* - * Was the last report repeated ? - */ - if(times_report_repeated > 0) { - gpm_report(GPM_PR_DEBUG, "\rSynps2: Last report reported %d times\n", - times_report_repeated); - times_report_repeated = 0; - } - - last_report_reported = report; - - gpm_report(GPM_PR_DEBUG, - "\rSynps2: %c%c%c%c%c %4dx%-4d %3d %2d %d %c%c%c%c %c%c %3d%3d %d %8d %8d %c", - report.fingers ? 'f' : '-', - report.gesture ? 'g' : '-', - report.left ? 'l' : '-', - report.middle ? 'm' : '-', - report.right ? 'r' : '-', - report.x, report.y, report.pressure, - report.w, was_fingers, - edges & LEFT_EDGE ? 'l' : '-', - edges & RIGHT_EDGE ? 'r' : '-', - edges & BOTTOM_EDGE ? 'b' : '-', - edges & TOP_EDGE ? 't' : '-', - report.gesture && !report.fingers ? 't' : '-', - report.gesture && report.fingers ? 'd' : '-', - state->dx, state->dy, state->buttons, - multi_finger_pressure, multi_finger_xy, - (multi_finger_pressure > 4500 - && multi_finger_xy > 50000 ? 'f' : ' ')); - -} -#endif - -/* syn_dump_info -** -** Print properties for the hardare. -** - */ -static void syn_dump_info(int stick) -{ - - gpm_report(GPM_PR_INFO, "Synaptic %s Device:", - (stick ? "Stick" : "Touchpad")); - - gpm_report(GPM_PR_INFO, - "Synaptics Ident: model_code=%d Firmware version %d.%d", - ident[stick].info_model_code, ident[stick].info_major, - ident[stick].info_minor); - gpm_report(GPM_PR_INFO, "Synaptics model:"); - gpm_report(GPM_PR_INFO, " rot180: %s", - model[stick].info_rot180 ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " portrait: %s", - model[stick].info_portrait ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " sensor: %d", model[stick].info_sensor); - gpm_report(GPM_PR_INFO, " %s", - syn_model_name(model[stick].info_sensor)); - gpm_report(GPM_PR_INFO, " %s", sensor[stick]->model); - gpm_report(GPM_PR_INFO, " %dx%d res/mm", - sensor[stick]->x_per_mm, sensor[stick]->y_per_mm); - gpm_report(GPM_PR_INFO, " %4.1fx%4.1f mm", - sensor[stick]->width_mm, sensor[stick]->height_mm); - gpm_report(GPM_PR_INFO, " %dx%d res", res_x, res_y); - gpm_report(GPM_PR_INFO, " hardware: %d", model[stick].info_hardware); - gpm_report(GPM_PR_INFO, " newABS: %s", - model[stick].info_new_abs ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " simpleCmd: %s", - model[stick].info_simple_cmd ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " geometry: %d", model[stick].info_geometry); - gpm_report(GPM_PR_INFO, " extended: %s", - capabilities[stick].cap_ext ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " stick: %s", - capabilities[stick].cap_stick ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " sleep: %s", - capabilities[stick].cap_sleep ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " 4 buttons: %s", - capabilities[stick].cap_four_button ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " multifinger: %s", - capabilities[stick].cap_multi_finger ? "Yes" : "No"); - gpm_report(GPM_PR_INFO, " palmdetect: %s", - capabilities[stick].cap_palm_detect ? "Yes" : "No"); - -#if DEBUG_TOSS - gpm_report(GPM_PR_INFO, "Min Toss Dist^2: %d\n", min_toss_dist__2); -#endif -} - -/* Get model name, STIG page 11 */ -static char *syn_model_name(int sensor) -{ - if(sensor < 0 || 44 < sensor) { - return "Reserved"; - } else { - return model_names[sensor]; - } -} - -/* convert the model id from bits to values -* STIG page 11 -*/ -static void syn_extract_model_id_info(int model_int, model_id_type * model) -{ - model->info_rot180 = check_bits(model_int, INFO_ROT180_BITS); - model->info_portrait = check_bits(model_int, INFO_PORTRAIT_BITS); - model->info_sensor = (model_int & INFO_SENSOR_BITS) >> 16; - model->info_hardware = (model_int & INFO_HARDWARE_BITS) >> 8; - model->info_new_abs = check_bits(model_int, INFO_NEW_ABS_BITS); - model->info_cap_pen = check_bits(model_int, INFO_CAP_PEN_BITS); - model->info_simple_cmd = check_bits(model_int, INFO_SIMPLE_CMD_BITS); - model->info_geometry = (model_int & INFO_GEOMETRY_BITS); -} - -/* Translate the reported data into a record for processing - * STIG page 14*/ -static sensor_info_type *syn_get_sensor_info(int sensor_id) -{ - if(sensor_id < 0 || 12 < sensor_id) { - return &sensor_info[0]; - } else { - return &sensor_info[sensor_id]; - } -} - -/* Translate the reported data of extended capabilities STIG page 15. If the - extended bit is not set it should be assumed that neither of the other - capabilities is available.*/ -static void syn_extract_extended_capabilities(int ext_cap_int, - ext_cap_type * cap) -{ - -#ifdef DEBUG - gpm_report(GPM_PR_INFO, "Synaptics Device Capabilities: %02X", ext_cap_int); -#endif - - cap->cap_ext = check_bits(ext_cap_int, EXT_CAP_EXTENDED); - - if(cap->cap_ext) { - cap->cap_stick = check_bits(ext_cap_int, EXT_CAP_STICK); - cap->cap_sleep = check_bits(ext_cap_int, EXT_CAP_SLEEP); - cap->cap_four_button = check_bits(ext_cap_int, EXT_CAP_FOUR_BUTTON); - cap->cap_multi_finger = check_bits(ext_cap_int, EXT_CAP_MULTI_FINGER); - cap->cap_palm_detect = check_bits(ext_cap_int, EXT_CAP_PALM_DETECT); - } else { - cap->cap_stick = 0; - cap->cap_sleep = 0; - cap->cap_four_button = 0; - cap->cap_multi_finger = 0; - cap->cap_palm_detect = 0; - /* - * Wmode is not supported, but this should be turned off after reading - * the config file. - */ - } -} - -/* -** Check for edges. -*/ -static int tp_edges(location_type loc) -{ - int edges = 0; - - if(loc.x <= x_min_center) - edges |= LEFT_EDGE; - - if(loc.x >= x_max_center) - edges |= RIGHT_EDGE; - - if(loc.y <= y_min_center) - edges |= BOTTOM_EDGE; - - if(loc.y >= y_max_center) - edges |= TOP_EDGE; - - return edges; -} - -/** - ** Handle scrolling. The wheel is way too fast to be usefull, so only report - ** every scrolling_speed. This function is also called when scrolling is done by - ** buttons, which is why DOWN and UP must be removed in the case of not scrolling. - */ - -static void tp_handle_scrolling(Gpm_Event * state) -{ - /* - * Limit the amount of scrolling, so that we do not overrun. - */ - if(scrolling_amount_left > 256 * 20) - scrolling_amount_left = 256 * 20; - - if(scrolling_amount_left < -256 * 20) - scrolling_amount_left = -256 * 20; - - state->buttons &= ~(GPM_B_DOWN | GPM_B_UP); - - if(scrolling_amount_left > scrolling_speed) { - scrolling_amount_left -= scrolling_speed; - state->buttons |= GPM_B_UP; - } else if(scrolling_amount_left < -scrolling_speed) { - scrolling_amount_left += scrolling_speed; - state->buttons |= GPM_B_DOWN; - } -} - -/* -** process_action -** -** Do the action and return a button state for a given action list and mask. -** Actions that should not be repeated should report GPM_B_NOT_SET (when -** holding down a button). -*/ - -static int tp_process_action(touchpad_action_type * action_list, int mask) -{ - int i = 0; - - int status = GPM_B_NOT_SET; - - static int Left_Double_Click = 0; - - if(mask == 0) { - gpm_report(GPM_PR_WARN, "Action Mask is 0"); - return GPM_B_NOT_SET; - } - - while(action_list[i].action_mask) { - if(check_bits(mask, action_list[i].action_mask)) { - switch (action_list[i].action) { - case Left_Button_Action: - status = GPM_B_LEFT; - break; - case Middle_Button_Action: - status = GPM_B_MIDDLE; - break; - case Right_Button_Action: - status = GPM_B_RIGHT; - break; - case Fourth_Button_Action: - status = GPM_B_FOURTH; - break; - case Up_Button_Action: - scrolling_amount_left += - ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_UP; - break; - case Down_Button_Action: - scrolling_amount_left -= - ceil(scrolling_button_factor * scrolling_speed); - status = GPM_B_DOWN; - break; - case Left_Double_Click_Action: - Left_Double_Click++; - status = GPM_B_LEFT; - if(Left_Double_Click == 2) - status = GPM_B_NONE; - if(Left_Double_Click == 4) { - status = GPM_B_NOT_SET; - Left_Double_Click = 0; - } - break; - case Turn_On_Off_Action: - touchpad_enabled = !touchpad_enabled; - status = GPM_B_NOT_SET; - break; - case Debug_On_Off_Action: -#ifdef DEBUG_SYNAPTIC - debug_syn_to_stderr = !debug_syn_to_stderr; -#endif - status = GPM_B_NOT_SET; - break; - case Reset_Touchpad_Action: - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - status = GPM_B_NOT_SET; - break; - case Toggle_Four_Way_Button_Action: - four_way_button_is_mouse = !four_way_button_is_mouse; - status = GPM_B_NOT_SET; - break; - case Toggle_Stick_Pressure_Action: - stick_pressure_enabled = !stick_pressure_enabled; - status = GPM_B_NOT_SET; - break; - case Toggle_Scrolling_Action: - is_always_scrolling = !is_always_scrolling; - status = GPM_B_NOT_SET; - break; - case No_Action: - status = GPM_B_NOT_SET; - break; - default: - gpm_report(GPM_PR_WARN, - "Default Action: Action no. %X not defined", - action_list[i].action); - status = GPM_B_NOT_SET; - break; - } - - return status; - } - - i++; - } - - return status; -} - -/* -** tp_process_corner_taps. -** -** last_*_action is an easy way of remember which taps/buttons should call/repeat -** the action when the tap/button is held pressed. It could just as well have -** been one variable where each bit held the repeater info for all the -** tap/buttons, but that will mean more code. -** -** The reason for not actually reusing last_*_action, instead of -** calculating it again, is that some actions like scrolling have "side effects". -** This may be perceived as a design fault. -** -** tp_process_corner_taps and tp_process_button_press are more complicated than -** to what is obvious. This is because 1) in a corner tap-and-hold the hold -** could take place at non edge. 2) A normal tap-and-hold can be moved to a -** corner. -*/ -static void tp_process_corner_taps(Gpm_Event * state, report_type * report) -{ - static int edges_at_cornertap_time; - - if(report->gesture && - ((is_corner(was_edges) && !last_report.gesture) || - (last_corner_action != GPM_B_NOT_SET))) { - - if(!last_report.gesture && last_corner_action == GPM_B_NOT_SET) - edges_at_cornertap_time = was_edges; - - last_corner_action = - tp_process_action(corner_actions, edges_at_cornertap_time); - - if(last_corner_action != GPM_B_NOT_SET) - state->buttons |= last_corner_action; - } -} - -/* tp_process_button_press -** -** Handles finger taps. Same way as tp_process_corner_taps. -** -** Should only calculate a tap if -** 1) There is a gesture (tap) -** 2) The tap did not start at a corner with a corneraction -** 3) If it is calculated before it should have returned a repeating action. -*/ -static void tp_process_finger_taps(Gpm_Event * state, report_type * report) -{ - - if(report->gesture && last_corner_action == GPM_B_NOT_SET && - !(corner_taps_enabled && is_corner(was_edges) && !last_report.gesture) && - !(last_report.gesture && last_finger_action == GPM_B_NOT_SET)) { - - if((multi_finger_tap_enabled && (was_fingers == 0 || was_fingers == 1)) || - (!multi_finger_tap_enabled && was_fingers > 0)) - last_finger_action = - tp_process_action(multi_finger_actions, ONE_FINGER); - - if(multi_finger_tap_enabled && was_fingers == 2) - last_finger_action = - tp_process_action(multi_finger_actions, TWO_FINGERS); - - if(multi_finger_tap_enabled && was_fingers == 3) - last_finger_action = - tp_process_action(multi_finger_actions, THREE_FINGERS); - - if(last_finger_action != GPM_B_NOT_SET) - state->buttons |= last_finger_action; - } -} - -/* -** tp_process_do_repeating_action -** -** The function test whether a feature's action should be repeated/called. The -** action should be called if the feature is there and if it was there last -** time, then it should be a repeating action. -*/ - -static inline void -tp_process_repeating_action(Gpm_Event * state, int feature, int last_feature, - int *last_action, - touchpad_action_type * action_list, - int feature_mask) -{ - if(feature) { - if(!(last_feature && *last_action == GPM_B_NOT_SET)) { - *last_action = tp_process_action(action_list, feature_mask); - if(*last_action != GPM_B_NOT_SET) - state->buttons |= *last_action; - } - } else { - *last_action = GPM_B_NOT_SET; - } -} - -/* -** tp_process_do_repeating_actions -** -** Call tp_process_do_repeating_action foreach possible action (right now only buttons.) -*/ - -static inline void -tp_process_repeating_actions(Gpm_Event * state, int features, int last_features, - int last_actions[], - touchpad_action_type * action_list) -{ - int feature_no, feature_mask; - - for(feature_no = 0; feature_no < 8; feature_no++) { - feature_mask = (1 << feature_no); - tp_process_repeating_action(state, features & feature_mask, - last_features & feature_mask, - &last_actions[feature_no], action_list, - feature_mask); - } -} - -/* tp_process_button_press -** -** Handles normal button presse explicitly because of the report -** layout (instead of using tp_process_do_repeating_actions). -*/ -static void tp_process_button_press(Gpm_Event * state, report_type * report) -{ - - tp_process_repeating_action(state, report->left, last_report.left, - &last_normal_button_actions[0], - normal_button_actions, LEFT_BUTTON); - - tp_process_repeating_action(state, report->right, last_report.right, - &last_normal_button_actions[1], - normal_button_actions, RIGHT_BUTTON); - - tp_process_repeating_action(state, report->middle, last_report.middle, - &last_normal_button_actions[2], - normal_button_actions, MIDDLE_BUTTON); - - tp_process_repeating_action(state, report->fourth, last_report.fourth, - &last_normal_button_actions[3], - normal_button_actions, FOURTH_BUTTON); - - tp_process_repeating_action(state, report->up, last_report.up, - &last_normal_button_actions[4], - normal_button_actions, UP_BUTTON); - - tp_process_repeating_action(state, report->down, last_report.down, - &last_normal_button_actions[5], - normal_button_actions, DOWN_BUTTON); -} - -/* -** syn_process_wmode_report -** -** Translate synaptics specific values. -*/ - -static void syn_process_wmode_report(report_type * report) -{ - /* - * STIG page 9: Values of w, vary from pad to pad. It is not precise when - * pressure is small < 25. 4-7 finger of normal width 8-14 very wide finger - * or palm 15 maximum reportable width - */ - report->fingerwidth = max(0, report->w - 4); - - /* - * Check whether there is one finger on the pad - */ - report->fingers = (report->pressure > finger_threshold); - - /* - * use w values. w = 0: 2 fingers, w = 1: 3 fingers, (if there is pressure) - */ - if(capabilities[0].cap_multi_finger) { - if(report->pressure != 0 && (report->w == 0 || report->w == 1)) { - report->fingers = 2 + report->w; - } - } -} - -/* -** syn_ps2_process_extended_packets -** -** The internal synaptics ps2 touchpads can have extra devices attached (stick, -** 4 way button) to them, and they reports there state as special embedded -** packets. These attached devices are handled here. -** -** The function returns 1 if it does not make sense to continue normal touchpad -** processing, 0 otherwise. -** -** I dont think that the external touchpads (serial) can have the same devices -** attached. This code should be moved to ps2 specific part, but it is easy to -** have it here. -*/ - -static int syn_ps2_process_extended_packets(unsigned char *data, - report_type * report, - Gpm_Event * state) -{ - static int last_stick_buttons = GPM_B_NONE; - - static int last_4_way_buttons = GPM_B_NONE; - - int tmp_buttons = GPM_B_NONE; - - /* - * Sanity check of data. - */ - if((report->pressure == 0 && (report->x != 0 || report->y != 0)) || - report->w == 3) { - - /* - * Something is wrong, should we assume it is an extended packet? It * - * cannot be processed further than here as the pressure is 0, which - * would * break things, if the user uses it simultaneously with the - * touchpad. - */ - /* - * Allow some simultaneously usage: tap-hold on touchpad, with extended - * movement. Do not do buttons, as they are not always correctly defined - * yet. - */ - if(last_report.gesture) { - report->gesture = 1; - if(tap_gesture_enabled) - tp_process_finger_taps(state, report); - if(corner_taps_enabled) - tp_process_corner_taps(state, report); - } - - /* - * Stick invariant bits (I hope). See absolute packets - */ - /* - * Stick pressed: The stick do only generates one packet, so double tap - * is a problem; squeezing in a non-clicked state. It is probably not a - * real problem, as it is hard not to move the stick a little between - * pressing, thereby returning a non-clicked state between the packets. - * Maybe press-lock mechanism is useful. Forget it, the styk supports it! - */ - if((data[0] & 0xFC) == 0x84 && - (data[1] & 0xC8) == 0x08 && (data[3] & 0xFC) == 0xC4) { - - tp_process_button_press(state, report); - - if(stick_enabled) { - state->dx = ((data[1] & 0x10) ? data[4] - 256 : data[4]); - state->dy = -((data[1] & 0x20) ? data[5] - 256 : data[5]); - } - - if(stick_pressure_enabled) { - tmp_buttons = ((data[1] & 0x01) ? STICK_LEFT_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x04) ? STICK_MIDDLE_BUTTON : 0); - tmp_buttons |= ((data[1] & 0x02) ? STICK_RIGHT_BUTTON : 0); - tp_process_repeating_actions(state, tmp_buttons, last_stick_buttons, - &last_stick_button_actions[0], - stick_actions); - } - - last_stick_buttons = tmp_buttons; - -#ifdef DEBUG_STICK - gpm_report(GPM_PR_DEBUG, - "StickData? %02x %02x %02x %02x %02x %02x :dx:%d dy:%d b:%d", - data[0], data[1], data[2], data[3], data[4], data[5], - state->dx, state->dy, state->buttons); -#endif - return 1; - } - - /* - * 4 way button invariant bits (I hope). I dont know the official name. - */ - if((data[0] & 0xFC) == 0x80 && - (data[1] & 0xFF) == 0x00 && - (data[3] & 0xFC) == 0xC0 && report->x < 4 && report->y < 4) { - - if(four_way_button_enabled) { - - report->fourth = !report->fourth; /* Note that this is reversed. */ - tp_process_button_press(state, report); - - if(four_way_button_is_mouse) { - /* - * Report motion - */ - if(report->x & 1) /* UP */ - state->dy = -1; - if(report->y & 1) /* DOWN */ - state->dy = 1; - if(report->x & 2) /* LEFT */ - state->dx = -1; - if(report->y & 2) /* RIGHT */ - state->dx = 1; - } else { - /* - * Report buttons - */ - tmp_buttons = ((report->x & 1) ? FOUR_UP_BUTTON : 0); /* UP */ - tmp_buttons |= ((report->y & 1) ? FOUR_DOWN_BUTTON : 0); /* DOWN - */ - tmp_buttons |= ((report->x & 2) ? FOUR_LEFT_BUTTON : 0); /* LEFT - */ - tmp_buttons |= ((report->y & 2) ? FOUR_RIGHT_BUTTON : 0); /* RIGHT - */ - tp_process_repeating_actions(state, tmp_buttons, - last_4_way_buttons, - &last_4_way_button_actions[0], - four_button_actions); - } - } - - last_4_way_buttons = tmp_buttons; - - if(scrolling_amount_left != 0) { - tp_handle_scrolling(state); - } - - return 1; - } - - /* - * This is unknown packet. - */ - gpm_report(GPM_PR_ERR, "\rSynps2: Pressure is 0, but x or y is not 0. " - "Data: %02X %02X %02X %02X %02X %02X", - data[0], data[1], data[2], data[3], data[4], data[5]); - return 1; - } - - /* - * Multiplexing with the stick (guest) device. - */ - if(stick_pressure_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_stick_buttons; - if(tmp_buttons || last_stick_buttons) { - tp_process_repeating_actions(state, tmp_buttons, last_stick_buttons, - &last_stick_button_actions[0], - stick_actions); - last_stick_buttons = tmp_buttons; - } - } - if(four_way_button_enabled) { - tmp_buttons = report->pressure == 0 ? GPM_B_NONE : last_4_way_buttons; - if(tmp_buttons || last_4_way_buttons) { - tp_process_repeating_actions(state, tmp_buttons, last_4_way_buttons, - &last_4_way_button_actions[0], - four_button_actions); - last_4_way_buttons = tmp_buttons; - } - } - - return 0; -} - -/** -** Preprocess the report even before doing wmode stuff. -** Is always called directly after the conversion to check the data received. -** return 0 if it is reasonable, 1 if there is something wrong. -** -** Checks for correct data package, palm on the pad, number of fingers. -** -*/ - -static int tp_find_fingers(report_type * report, Gpm_Event * state) -{ - - static int fake_extra_finger; - - static int was_fake_pressure; - - state = NULL; /* FIXME: gpm 1.99.13 */ - - /* - * Check whether there is a palm on the pad - */ - if(palm_detect_enabled && - report->fingers && (report->fingerwidth >= palm_detect_level)) { -#ifdef DEBUG_PALM - gpm_report(GPM_PR_DEBUG, "\rTouchpad: palm detected. finger width: %d", - report->fingerwidth); -#endif - /* - * BUG should not return 1, as this drops packets. Return a repeated - * report ? - */ - /* - * last_locs [mod4 (packet_num - 1)].x = report->x; - */ - /* - * last_locs [mod4 (packet_num - 1)].y = report->y; - */ - /* - * or - */ - /* - * report->pressure = 0; - */ - return 1; - } - - /* - * Extra check for vertical multi fingers which my pad is very bad to - * detect. ** Only check for extra fingers if no of fingers has not changed. - * Faking ** fingers may go wrong so sanity check needed. This is not an - * attempt to ** know the number of fingers all the time, as this is not - * needed. - */ - if(fake_finger_layer_enabled) { - - if(report->fingers > 1) { - fake_extra_finger = 0; - } - - if(report->fingers == 0) { - fake_extra_finger = 0; -#ifdef DEBUG_REPORTS - multi_finger_pressure = 0; - multi_finger_xy = 0; -#endif - } else if(report->fingers + fake_extra_finger == last_report.fingers) { - - multi_finger_pressure = - sqr(report->pressure) - sqr(last_report.pressure); - multi_finger_xy = - (sqr(last_locs[mod4(packet_num - 1)].x - report->x) + - sqr(last_locs[mod4(packet_num - 1)].y - report->y)); - - /* - * Check for a second finger. If the move is larger than tap range, * - * then it is not a tap, and adding the finger does not change - * reported * buttons, but it will still stop the moving if * - * multi_finger_stop_enabled is on. These tests are complete base on - * my * imagination and experience, so any better idea are welcome. - */ - if(report->fingers == 1 && - multi_finger_pressure > 4500 - && multi_finger_xy > 2 * sqr((double) tap_range)) { - fake_extra_finger = 1; - was_fake_pressure = report->pressure; - - } /* Check for third finger. */ - else if(last_report.pressure > 180 - && (report->fingers + fake_extra_finger) == 2 - && multi_finger_pressure > 4500 - && multi_finger_xy > 2 * sqr((double) tap_range)) { - fake_extra_finger = 2; - was_fake_pressure = report->pressure; - - } else if((fake_extra_finger > 0) && - (was_fake_pressure - report->pressure > 20)) { - fake_extra_finger--; - - } else if(multi_finger_pressure < -5000 - && multi_finger_xy > 2 * sqr((double) tap_range)) { - /* - * Probably missed a placed multi finger, as this is one removed! - */ - last_report.fingers++; - } - } - - report->fingers += fake_extra_finger; - - } - - /* - * Check whether to reduce sensibility when adding or removing fingers - */ - if(multi_finger_stop_enabled) { - - /* - * Is a finger added or removed since last packet? - */ - if((report->fingers > 1 && report->fingers > last_report.fingers) || - (last_report.fingers > 1 && report->fingers < last_report.fingers)) { - - /* - * Updating the timer right after another added/removed finger, would - * make the undo moving become redo, so dont. - */ - if(multi_finger_stop_timer != multi_finger_stop_delay - 1) - multi_finger_stop_timer = multi_finger_stop_delay; - -#ifdef DEBUG_MULTI_FINGER - gpm_report(GPM_PR_DEBUG, "%s multi finger %d %d %d", - report->fingers > last_report.fingers ? "Add" : "Remove", - last_report.fingers, report->fingers, fake_extra_finger); -#endif - - } /* Should be tested last, because of undo * - * moving when removing fingers. */ - else if(report->fingers == 0) { - multi_finger_stop_timer = 0; - } - - /* - * Stop moving the mouse after a finger adding/removing. - */ - if(multi_finger_stop_timer > 0) { - last_locs[mod4(packet_num - 1)].x = report->x; - last_locs[mod4(packet_num - 1)].y = report->y; - last_locs[mod4(packet_num - 2)].x = report->x; - last_locs[mod4(packet_num - 2)].y = report->y; - - /* - * Undo the previous move (before detecting of the adding/removing). - */ - if(multi_finger_stop_timer == multi_finger_stop_delay) { - last_locs[mod4(packet_num - 2)].x += - last_state.dx * 2 / standard_speed_factor; - last_locs[mod4(packet_num - 2)].y -= - last_state.dy * 2 / standard_speed_factor; - } - - multi_finger_stop_timer--; - } - } - - /* - * If wmode is not used, we do not know all the informations to reset the - * was_fingers variable or stop waiting for a tap-hold, so set a timer to - * reset the variables when we believe it is time. pads_tap_interval is - * optimal when set to the touchpads tap_interval. - */ - - if(fake_forget_tap_interval) { - if(report->fingers || report->gesture) - fake_time_to_forget_tap = pads_tap_interval; - - if(fake_time_to_forget_tap > 0) - fake_time_to_forget_tap--; - else - was_fingers = 0; - } - - was_fingers = max(was_fingers, report->fingers); - - return 0; -} - -/** -** tp_find_gestures -** Process the report from a wmode enabled device. No gesture calculation is -** done by the device in wmode, so the find tap and drag hold and tap hold gestures. -** -** Tap mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** _________________________ -** | tap_lower/upper_limit |tap_interval| -** ----------------- ----------------- -** -** stroke_x/y : = -** finger_on_pad_timer: 0000123 +++++++++++++0000000000000000 -** time_to_forget_tap : 0000000 000000000000=---------3210000 -** gesture_delay : 0000000 ... 00000000000000000000000000000 -** drag_locked : 0000000 00000000000000000000000000000 -** gesture : 0000000 00000000000011111111111110000 -** -** Note: -** 0) When gesture is high a button is reported pressed (usually left button). -** 1) finger_on_pad_timer is increased at most to 1 larger than tap_upper_limit, -** but then it is not a tap any longer. -** 2) If tap_interval is larger than 1s (80 packets) then time_to_forget_tap never reaches 0, -** before the touchpads stop sending packets, so gesture is reported until touched again. -** -** -** Tap hold mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval -** ________________ v ___ ___ -** |tap_l/u_limit | |not tap| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ +++0000 -** time_to_forget_tap : 00000000 000=----11111 1110000 -** gesture_delay : 00000000 ... 0000000000000 0000000 -** drag_locked : 00000000 0000000000000 0000000 -** gesture : 00000000 0001111111111 1110000 -** -** Note: -** 0) time_to_forget_tap is set to 1 when touching the pad 2 time, so the gesture is stop when released. -** (two fast taps would be a problem). -** -** -** Two consecutive taps mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** -** tap_interval multiple_tap_delay -** ________________ v _______________ v | -** |tap_l/u_limit | |tap_l/u_limit| -** ----------------- ------ -------- -** -** stroke_x/y : = = -** finger_on_pad_timer: 0000123+ +++00000123++ ++00000000000000000 -** time_to_forget_tap : 00000000 000=----11111 11=---------32100000 -** gesture_delay : 00000000 ... 0000000000000 ... 00=----3210000000000 -** drag_locked : 00000000 0000000000000 00000000000000000000 -** gesture : 00000000 0001111111111 11000000001111100000 -** -** Note: -** 0) There is no gesture if gesture_delay is non zero. -** 1) multiple_tap_delay (gesture_delay) should be less than tap_interval (time_to_forget_tap), -** or else no second tap is reported. -** 2) Three fast taps (shorter than multiple_tap_delay) would reset gesture_delay the second time -** and only report 2 taps (the first and last). (likewise with more fast taps). BUG ? -** -** -** Drag lock mechanism: High when touched. (=: assigned, -: decreased, +: increased) -** MISSING -*/ - -static void tp_find_gestures(report_type * report) -{ - static int finger_on_pad_timer = 0; - - static int time_to_forget_tap = 0; - - static int stroke_x; - - static int stroke_y; - - static int drag_locked = 0; - - if(report->fingers > 0) { - - /* - * finger down for the first time - */ - if(finger_on_pad_timer == 0) { - stroke_x = report->x; - stroke_y = report->y; - } - - /* - * don't want timer to overflow - */ - if(finger_on_pad_timer < (tap_upper_limit_packet)) - finger_on_pad_timer++; - - /* - * dragging and consecutive tap gestures is to end with finger up forget - * fast that there was a tap if this is not a part of a tap. - */ - if(time_to_forget_tap > 0) - time_to_forget_tap = 1; - - } else { /* interesting things happen when finger is up */ - - /* - * tap determination: Was the finger long enough on the pad and not too - * long, while staying at the same place. - */ - if((finger_on_pad_timer > (tap_lower_limit_packet)) && /* minimum - * finger down - * time */ - (finger_on_pad_timer < (tap_upper_limit_packet)) && /* maximum - * finger down - * time */ - ((distance((double) (stroke_x - last_report.x), /* maximum - * range for - * finger to - * drift while - * down */ - (double) (stroke_y - last_report.y)) - < sqr((double) tap_range)) || - (multi_finger_tap_enabled && was_fingers > 1))) { - - /* - * not a consecutive tap? - */ - if(time_to_forget_tap == 0) - gesture_delay = 0; /* right -> don't delay gesture */ - else { /* a consecutive tap! */ - gesture_delay = multiple_tap_delay * 80 / 1000; /* delay - * gesture to - * create - * multiple - * click */ - } - - /* - * is drag locked - */ - if(drag_locked) { - drag_locked = 0; /* unlock it and don't gesture. */ - time_to_forget_tap = 0; - } else - time_to_forget_tap = tap_interval * 80 / 1000; /* setup - * gesture time - * * to count - * down */ - - } else { /* It was not a tap */ - - /* - * a drag to lock? If user did a tap and quickly hold the finger - * longer than a tap. - */ - if(drag_lock_enabled && (time_to_forget_tap > 0) - && (finger_on_pad_timer >= (tap_upper_limit_packet))) - drag_locked = 1; - - if(time_to_forget_tap > 0) - time_to_forget_tap--; - if(time_to_forget_tap == 0) - was_fingers = 0; - if(gesture_delay > 0) - gesture_delay--; - - } - -#ifdef DEBUG_TAPS - if(finger_on_pad_timer) - gpm_report(GPM_PR_DEBUG, "A tap? %d < %d < %d && (%d)^2 + (%d)^2 < %d", - tap_lower_limit_packet, finger_on_pad_timer, - tap_upper_limit_packet, stroke_x - last_report.x, - stroke_y - last_report.y, tap_range * tap_range); -#endif - - finger_on_pad_timer = 0; - - } - - report->gesture = ((time_to_forget_tap > 0) && (gesture_delay == 0)) - || drag_locked; -} - -/* -** tp_process_report -** -** Process the touchpad report. Do tossing mechanism, edge mechanism (edge -** extension, corner taps), speed pressure. -** -** Tossing mechanism: High when touched. (=: assigned, -: decreased) -** (Pause) -** ________________________ _____ ______ prevent_toss ___ -** | min/max_toss_packets | < 1s | .... | ... | -** ----------------- ---------- ----- ---- -** -** is_tossing : 000000000000000000000000001111111111000000000000000000000000000000000000 -** was_tossing: 000000000000000000000000000000000001111111111111111111111111111111100000 -** toss_timer : ======================= ====================---- ... 321000== -** -** Note -** 0) When is_tossing is high a motion is reported/calculated. -** 1) if prevent_toss delay is 0 then toss to toss is allowed without pause. -** 2) if the pause is to short (< prevent_toss), the timers start over! -** 3) The 1 second limit is due to the touchpad only sends packets one second after a release. -** -** -*/ -static void tp_process_report(Gpm_Event * state, report_type * report) -{ - location_type loc; - - int edges; - - float pressure_speed_factor; - - float edge_speed_factor; - - int edge_motion_on; - - float dx, dy; - - /* - * extract location and edges - */ - loc.x = report->x; - loc.y = report->y; - edges = tp_edges(loc); - - if(report->fingers > 0) { - - if(tossing_enabled) { - /* - * this is the cue to stop tossing, if we are tossing so Force a touch - * free pause before a new tossing is allowed (prevent toss time) - */ - was_tossing = (was_tossing || is_tossing); - toss_timer = prevent_toss_packets; - is_tossing = 0; - - /* - * if we start tossing then this is from where - */ - if(last_report.fingers == 0) { - touch_loc = loc; - } - } - - /* - * Save the edge state, so we can detect a movement from non edge to - * edge. - */ - if(!edges) - was_non_edge = 1; - - /* - * Need enough packets to perform smoothing on dy and dx * but it should - * work with only 2, so why is 4 required? - */ - if(packet_num > 3) { - - /* - * Is this start of scrolling? - */ - if(scrolling_enabled && !is_scrolling) - is_scrolling = ((edges & scrolling_edge) && /* Note: only one &! */ - !was_non_edge && /* Must start at edge */ - !last_report.gesture && /* No consecutive tap */ - (!corner_taps_enabled || /* Corner disabled or */ - !is_corner(edges))); /* no corner */ - - /* - ** 1) if edge motion is enabled, only activate if we moved into the edge or - ** if not using the corners taps. Dont activate right away after a gesture - ** from a corner tap. 2) No harm is done if activated when scrolling (as - ** long as the scrolling edge is vertical). 3)If user is tap holding (then - ** he cannot lift the finger and hit the touchpad boarder). - */ - - edge_motion_on = (edges && edge_motion_enabled && - (was_non_edge || - !corner_taps_enabled || - (!is_corner(edges) && !last_report.gesture))); - edge_motion_on |= (edges && auto_scrolling_enabled && is_scrolling); - edge_motion_on |= (edges && tap_hold_edge_motion_enabled - && last_report.gesture && was_non_edge); - - /* - * compute the speed factor based on pressure - */ - pressure_speed_factor = standard_speed_factor; - - if(report->pressure > speed_up_pressure) { - pressure_speed_factor *= - 1.0 + - ((report->pressure - speed_up_pressure) * speed_pressure_factor); - } - - /* - * use the edge speed factor if edge_motion_speed is enabled - */ - edge_speed_factor = (edge_motion_speed_enabled ? - pressure_speed_factor : standard_speed_factor); - - pressure_speed_factor = (pressure_speed_enabled ? - pressure_speed_factor : - standard_speed_factor); - - if(auto_scrolling_enabled && is_scrolling) { - edge_speed_factor *= 1.0 + auto_scrolling_factor; - } - - /* - * Calculate dx and dy depending on whether we are at an edge - */ - - if(edge_motion_on && (edges & TOP_EDGE)) - state->dy = -edge_speed * edge_speed_factor; - else if(edge_motion_on && (edges & BOTTOM_EDGE)) - state->dy = edge_speed * edge_speed_factor; - else - state->dy = (pressure_speed_factor * - (((last_locs[mod4(packet_num - 1)].y + - last_locs[mod4(packet_num - 2)].y) / 2) - - ((loc.y + last_locs[mod4(packet_num - 1)].y) / 2))); - - if(edge_motion_on && (edges & LEFT_EDGE)) - state->dx = -edge_speed * edge_speed_factor; - else if(edge_motion_on && (edges & RIGHT_EDGE)) - state->dx = edge_speed * edge_speed_factor; - else - state->dx = (pressure_speed_factor * - (((loc.x + - last_locs[mod4(packet_num - 1)].x) / 2) - - ((last_locs[mod4(packet_num - 1)].x + - last_locs[mod4(packet_num - 2)].x) / 2))); - } - /* - * If (packet_num > 3) - */ - last_locs[mod4(packet_num)] = loc; - was_edges = edges; - packet_num++; - } else { - /* - * No finger on the pad - */ - /* - * Start the tossing action if enabled - */ - if(tossing_enabled && was_fingers == 1 && - !was_tossing && - !is_scrolling && - (packet_num > min_toss_packets) && (packet_num < max_toss_packets)) { - - dx = last_locs[mod4(packet_num - 1)].x - touch_loc.x; - dy = -(last_locs[mod4(packet_num - 1)].y - touch_loc.y); - -#if DEBUG_TOSS - gpm_report(GPM_PR_INFO, "dx: %2.1f dy: %2.1f tdist^2: %2.1f", - dx, dy, distance(dx, dy)); -#endif - - if(distance(dx, dy) > min_toss_dist__2) { - is_tossing = 1; - - /* - * determine the toss speed - */ - if(does_toss_use_static_speed) { - toss_speed.x = (static_toss_speed * standard_speed_factor * - dx / (abs(dx) + abs(dy))); - toss_speed.y = (static_toss_speed * standard_speed_factor * - dy / (abs(dx) + abs(dy))); - } else { - toss_speed.x = dx * standard_speed_factor * toss_speed_factor; - toss_speed.y = dy * standard_speed_factor * toss_speed_factor; - } - -#if DEBUG_TOSS - gpm_report(GPM_PR_INFO, "tossx: %d tossy: %d", toss_speed.x, - toss_speed.y); -#endif - } - } - - /* - * no fingers therefore: no edge, and restart packet count - */ - was_non_edge = 0; - is_scrolling = 0; - scrolling_speed_timer = 0; - packet_num = 0; - } - - /* - * if we are tossing then apply the toss speed - */ - if(tossing_enabled && is_tossing) { - state->dx = toss_speed.x; - state->dy = toss_speed.y; - } - - /* - * if we are scrolling then stop moving and report wheel amount. The reason - * ** for having this above buttons actions is buttons can then move the ** - * mouse while scrolling. - */ - if((scrolling_enabled && is_scrolling) || is_always_scrolling) { - scrolling_amount_left -= state->dy; - state->dx = 0; - state->dy = 0; - } - - /* - * check for (corner)buttons if we didn't just complete a toss or is - * scrolling - */ - if(!is_tossing && !was_tossing && !is_scrolling) { - /* - ** If there is no gesture then there are no buttons, but dont clear if we - ** are about to make a double tap. Otherwise compute new buttons. - */ - if(!report->gesture && - !report->left && !report->right && !report->middle - && !report->fourth) { - if(!gesture_delay && !fake_time_to_forget_tap) { - last_corner_action = GPM_B_NOT_SET; - last_finger_action = GPM_B_NOT_SET; - } - state->buttons = GPM_B_NONE; - } else { - tp_process_button_press(state, report); - if(tap_gesture_enabled) - tp_process_finger_taps(state, report); - if(corner_taps_enabled) - tp_process_corner_taps(state, report); - } - } - - /* - * Is there any amount of scrolling left? Should be checked after corner - * actions. - */ - if(scrolling_amount_left != 0) { - tp_handle_scrolling(state); - } - - was_tossing = was_tossing && toss_timer; - if(was_tossing) - toss_timer--; - - /* - * remember the last state of the finger for toss processing - */ - last_report = *report; - last_state = *state; - - /* - * Dont do anything if the pad is not enabled, but after corner actions are - * done so it can be turn on again. - */ - if(!touchpad_enabled) { - state->buttons = GPM_B_NONE; - state->dx = 0; - state->dy = 0; - } -#if DEBUG_REPORTS - tp_dump_report_data(*report, edges, state); -#endif - -} - -/* -** syn_read_config_file -** -** Read the configuration data from the global config file -** SYSCONFDIR "/gpm-syn.conf". -*/ -void tp_read_config_file(char *config_filename) -{ - char line[80]; - - char *token; - - char *end_ptr; - - int param, tmp_read_int_param; - - FILE *config; - - char full_filename[100]; - - int status; - - float tmp_read_float_param; - - status = snprintf(full_filename, 100, SYSCONFDIR "/%s", config_filename); - if(status < 0) { - gpm_report(GPM_PR_WARN, "Too long path for configure file: %s", - config_filename); - return; - } - - if(!(config = fopen(full_filename, "r"))) { - gpm_report(GPM_PR_WARN, "Failed to open configfile: %s", full_filename); - } else { - while(fgets(line, 80, config)) { - if(line[0] == '[') { - if((token = strtok(line, "[] \t"))) { - param = 0; - - /* - * which param is it - */ - while(param_data[param].name && - strcasecmp(token, param_data[param].name) != 0) { - param++; - } - - /* - * was a param found? - */ - if(!param_data[param].name) { - gpm_report(GPM_PR_WARN, "Unknown parameter %s", token); - } else { - token = strtok(NULL, "[] \t"); - - switch (param_data[param].p_type) { - case Integer_Param: - tmp_read_int_param = strtol(token, &end_ptr, 0); - if(end_ptr != token) - *(param_data[param].addr.int_p) = tmp_read_int_param; - else - gpm_report(GPM_PR_WARN, - "Integer value (%s) for parameter %s is invalid", - token, param_data[param].name); -#if DEBUG_PARAMS - gpm_report(GPM_PR_INFO, "Param %s set to %d", - param_data[param].name, - *(param_data[param].addr.int_p)); -#endif - break; - - case Float_Param: - tmp_read_float_param = strtod(token, &end_ptr); - if(end_ptr != token) - *(param_data[param].addr.float_p) = - tmp_read_float_param; - else - gpm_report(GPM_PR_WARN, - "Float value (%s) for parameter %s is invalid", - token, param_data[param].name); -#if DEBUG_PARAMS - gpm_report(GPM_PR_INFO, "Param %s set to %3.3f", - param_data[param].name, - *(param_data[param].addr.float_p)); -#endif - break; - - case Flag_Param: - if(strchr("YyTt1", token[0])) { - *(param_data[param].addr.flag_p) = 1; - } else if(strchr("NnFf0", token[0])) { - *(param_data[param].addr.flag_p) = 0; - } else { - gpm_report(GPM_PR_WARN, - "Flag value (%s) for parameter %s is invalid", - token, param_data[param].name); - } -#if DEBUG_PARAMS - gpm_report(GPM_PR_INFO, "Param %s set to %s", - param_data[param].name, - (*(param_data[param].addr.flag_p) ? - "True" : "False")); -#endif - break; - - case Action_Param: - tmp_read_int_param = strtol(token, &end_ptr, 0); - if(end_ptr != token) - param_data[param].addr.corner_p->action = - tmp_read_int_param; - else - gpm_report(GPM_PR_WARN, - "Action value (%s) for parameter %s is invalid", - token, param_data[param].name); -#if DEBUG_PARAMS - gpm_report(GPM_PR_INFO, "Param %s set to %d", - param_data[param].name, - param_data[param].addr.corner_p->action); -#endif - break; - - default:; - } - } - } - } - } - - fclose(config); - } -} - -/* -** syn_process_touchpad_config -** -** Extract important information and report (as desired) to the user. -*/ -static void syn_process_config(info_type ident, model_id_type model) -{ - sensor[0] = syn_get_sensor_info(model.info_sensor); - gpm_report(GPM_PR_INFO, " Firmware version %d.%d\n", - ident.info_major, ident.info_minor); - - tp_read_config_file("gpm-syn.conf"); - - /* - * Limit the options depending on the touchpad capabilities. This should be - * done after reading the configure file so they may be turned off on - * purpose and can'nt be turned on if not supported. - */ - if(!capabilities[0].cap_ext) { - wmode_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_palm_detect) { - palm_detect_enabled = 0; - } - - if(!wmode_enabled || !capabilities[0].cap_stick) { - stick_enabled = 0; - stick_pressure_enabled = 0; - } - - /* - * fake_forget_tap_interval must be set if the hardware does the gesture. - */ - if(!wmode_enabled) - fake_forget_tap_interval = 1; - - /* - * Save important information - */ - x_per_mm = sensor[0]->x_per_mm; - y_per_mm = sensor[0]->y_per_mm; - res_x = (int) (x_per_mm * sensor[0]->width_mm); - res_y = (int) (y_per_mm * sensor[0]->height_mm); - - /* - * convert the tap times to packets (80 pkts/sec and 1000 ms/sec) - */ - tap_lower_limit_packet = tap_lower_limit * 80 / 1000; - tap_upper_limit_packet = tap_upper_limit * 80 / 1000; - - /* - * Convert the toss dist to touchpad resolution from mm - */ - min_toss_dist__2 = sqr(min_toss_dist * (x_per_mm + y_per_mm) / 2); - - /* - * convert the toss times to packets (80 pkts/sec and 1000 ms/sec) - */ - max_toss_packets = max_toss_time * 80 / 1000; - min_toss_packets = min_toss_time * 80 / 1000; - prevent_toss_packets = prevent_toss_time * 80 / 1000; - -} - -/**************************************************************************** -** -** ROUTINES for interfacing to a SERIAL touchpad -** -****************************************************************************/ - -static unsigned char tp_hextoint(unsigned char byte1, unsigned char byte2) -{ - unsigned char bytes[3]; - - int result; - - bytes[0] = byte1; - bytes[1] = byte2; - bytes[2] = '\0'; - sscanf((char *) bytes, "%x", &result); - return result; -} - -static void tp_serial_flush_input(int fd) -{ - struct timeval tv; - - fd_set rfds; - - unsigned char junk; - - FD_ZERO(&rfds); - FD_SET(fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - usleep(50000); - - while(select(fd + 1, &rfds, NULL, NULL, &tv) == 1) { -#if DEBUG_FLUSH - gpm_report(GPM_PR_INFO, "Serial tossing"); - fflush(stdout); -#endif - read(fd, &junk, 1); -#if DEBUG_FLUSH - gpm_report(GPM_PR_INFO, " %c", junk); -#endif - FD_ZERO(&rfds); - FD_SET(fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } -} - -static void tp_serial_read(int fd, unsigned char *bytes, size_t count) -{ - struct timeval tv; - - fd_set rfds; - - int num_read = 0; - - int read_count; - - FD_ZERO(&rfds); - FD_SET(fd, &rfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - while((select(fd + 1, &rfds, NULL, NULL, &tv) == 1) && - (num_read < (int) count)) { - read_count = read(fd, &bytes[num_read], count - num_read); - num_read += read_count; - - FD_ZERO(&rfds); - FD_SET(fd, &rfds); - } - - for(; num_read < (int) count; num_read++) { - bytes[num_read] = '\0'; - } -} - -/* Write a string of commands */ -static void tp_serial_send_cmd(int fd, unsigned char *cmd) -{ - unsigned char junk[15]; - - tp_serial_flush_input(fd); - write(fd, cmd, strlen((char *) cmd)); - tp_serial_read(fd, junk, strlen((char *) cmd)); -#if DEBUG_FLUSH - junk[strlen(cmd)] = '\0'; - gpm_report(GPM_PR_DEBUG, "serial tossing: %s", junk); -#endif -} - -/* write 'mode' to a serial touchpad, STIG 58 */ -static void syn_serial_set_mode(int fd, unsigned char mode) -{ - unsigned char bytes[15]; - - sprintf((char *) bytes, "%%C3B%02X5555", mode); -#if DEBUG_SENT_DATA - gpm_report(GPM_PR_DEBUG, "modes: %s", bytes); -#endif - tp_serial_send_cmd(fd, bytes); -} - -/* read the identification from the serial touchpad, STIG 57*/ -static void syn_serial_read_ident(int fd, info_type * info) -{ - unsigned char bytes[5]; - - tp_serial_send_cmd(fd, (unsigned char *) "%A"); - tp_serial_read(fd, bytes, 4); - -#if DEBUG_SENT_DATA - bytes[4] = '\0'; - gpm_report(GPM_PR_INFO, "Serial ident: %s", bytes); -#endif - - if(bytes[0] == 'S' && bytes[0] == 'T') { - /* - * reformat the data The out commented is wrong according to STIG page - * 57. - */ - /* - * info->info_model_code = (bytes [2] & 0x07) >> 3; - */ - info->info_model_code = bytes[2] >> 3; - info->info_major = (bytes[2] & 0x07); - info->info_minor = bytes[3]; - } else { - gpm_report(GPM_PR_ERR, - "PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - info->info_model_code = 0; - info->info_minor = 0; - info->info_major = 0; - } -} - -/* read the model_id from the serial touchpad (in ps/2 format) */ -static void syn_serial_read_model_id(int fd, model_id_type * model) -{ - unsigned char bytes[7]; - - int model_int; - - /* - * for older touchpads this command is not supported and no response will - * come. We should do non blocking input here to handle that case - * and return byte2 as 0x47 ... later. - * - * pebl: It is easier just to check version number less than 3.2, STIG page 60. - */ - if((ident[0].info_major >= 4) || - (ident[0].info_major == 3 && ident[0].info_minor >= 2)) { - tp_serial_send_cmd(fd, (unsigned char *) "%D"); - tp_serial_read(fd, bytes, 6); - - /* - * reformat the data - */ - model_int = ((tp_hextoint(bytes[0], bytes[1]) << 16) | - (tp_hextoint(bytes[2], bytes[3]) << 8) | - (tp_hextoint(bytes[4], bytes[5]))); - -#if DEBUG_SENT_DATA - bytes[6] = '\0'; - gpm_report(GPM_PR_DEBUG, "Serial model id: %s", bytes); -#endif - - } else { - model_int = 0; - } - - syn_extract_model_id_info(model_int, model); -} - -/* read the mode bytes and capabilities from the serial touchpad, STIG 57 */ -static void syn_serial_read_cap(int fd, ext_cap_type * cap) -{ - unsigned char bytes[8]; - - int cap_int = 0; - - tp_serial_send_cmd(fd, (unsigned char *) "%B"); - tp_serial_read(fd, bytes, 8); - -#if DEBUG_SENT_DATA - bytes[7] = '\0'; - gpm_report(GPM_PR_DEBUG, "Serial capabilites: %s", bytes); -#endif - - if(ident[0].info_major >= 4) { - if(bytes[0] == '3' && bytes[0] == 'B') { - cap_int = ((tp_hextoint(bytes[4], bytes[5]) << 8) | - (tp_hextoint(bytes[6], bytes[7]))); - } else { - gpm_report(GPM_PR_ERR, - "PS/2 serial device doesn't appear to be a synaptics touchpad\n"); - } - } - - syn_extract_extended_capabilities(cap_int, cap); -} - -/*------------------------------------------------------------------------*/ - -/* PS/2 Utility functions. */ - -/* Adapted from tpconfig.c by C. Scott Ananian */ - -/*------------------------------------------------------------------------*/ - -/* PS2 Synaptics is using LSB, STIG page 29. -** -** After power on or reset the touchpads are set to these defaults: -** 100 samples per second -** Resolution is 4 counts per mm -** Scaling 1:1 -** Stream mode is selected -** Data reporting is disabled -** Absolute mode is disabled -*/ - -/* Normal ps2 commands, Command set is on STIG page 33 */ -#define PS2_RESET 0xFF /* Reset */ -#define PS2_RESEND 0xFE /* Resend command */ -#define PS2_SET_DEFAULT 0xF6 /* Set default */ -#define PS2_DISABLE_DATA 0xF5 /* Stop sending motion data packets */ -#define PS2_ENABLE_DATA 0xF4 /* Start sending motion data packets */ -#define PS2_SAMPLE_RATE 0xF3 /* Set sample rate to value in a following byte - */ -#define PS2_READ_DEVICE 0xF2 /* Read device type (ack and idcode) */ -#define PS2_REMOTE_MODE 0xF0 /* Set touchpad in remote mode */ -#define PS2_WRAP_MODE 0xEE /* Enter wrap mode */ -#define PS2_END_WRAP_MODE 0xEE /* Leave wrap mode */ -#define PS2_READ_DATA 0xEB /* Read move data (in remote mode) */ -#define PS2_STREAM_MODE 0xEA /* Enter stream mode (device sends move data) */ -#define PS2_STATUS_REQ 0xE9 /* Ask for status request */ -#define PS2_RESOLUTION 0xE8 /* Set resolution to next transmitted byte */ -#define PS2_SCALE_12 0xE7 /* Set scale to 1:2 */ -#define PS2_SCALE_11 0xE6 /* Set scale to 1:1 */ - -/* Normal ps2 responce */ -#define PS2_ERROR 0xFC /* Error, after a reset,resend or disconnect */ -#define PS2_ACK 0xFA /* Command acknowledge */ -#define PS2_READY 0xAA /* Send after a calibration or ERROR */ -#define PS2_MOUSE_IDCODE 0x00 /* Identification code (meaning mouse) sent - * after a PS2_READY */ - -/* Additional synaptic commands*/ -#define PS2_SYN_CMD 0xE8 /* Four of these each with an following byte - * encodes a command */ -#define PS2_SYN_INERT 0xE6 /* This ps2 command is ignored by synaptics */ -#define PS2_SYN_SET_MODE1 0x0A /* Set the mode byte 1 instead of sample rate - * (used after a sample rate cmd) */ -#define PS2_SYN_SET_MODE2 0x14 /* Set the mode byte 2 instead of sample rate - * (used after a sample rate cmd). All other - * sample rate gives undefined behavior (used - * to address 4 byte mode) */ -#define PS2_SYN_SET_STICK 0x28 /* Send byte to stick */ -#define PS2_SYN_STATUS_OK 0x47 /* Special synaptics Status report is - * recognized */ - -/* These are the commands that can be given (encoded) by PS_SYN_CMD */ -#define PS2_SYN_CMD_IDENTIFY 0x00 /* Identify Touchpad */ -#define PS2_SYN_CMD_MODES 0x01 /* Read Touchpad Modes */ -#define PS2_SYN_CMD_CAPABILITIES 0x02 /* Read capabilities */ -#define PS2_SYN_CMD_MODEL_ID 0x03 /* Read model id */ -#define PS2_SYN_CMD_SERIAL_NO_P 0x06 /* Read serial number prefix */ -#define PS2_SYN_CMD_SERIAL_NO_S 0x07 /* Read serial number suffix */ -#define PS2_SYN_CMD_RESOLUTIONS 0x08 /* Read resolutions */ - -/* read a byte from the ps/2 port */ -static byte tp_ps2_getbyte(int fd) -{ - byte b; - -#ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG, "Getting byte"); -#endif - - read(fd, &b, 1); - -#ifdef DEBUG_GETBYTE - gpm_report(GPM_PR_DEBUG, "Got %X", b); -#endif - - return b; -} - -/* write a byte to the ps/2 port, handling resend.*/ -static byte tp_ps2_putbyte(int fd, byte b) -{ - byte ack; - -#ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG, "Send real byte %X", b); -#endif - - write(fd, &b, 1); - read(fd, &ack, 1); - - if(ack == PS2_RESEND) { - write(fd, &b, 1); - read(fd, &ack, 1); - } -#ifdef DEBUG_PUTBYTE_ACK - gpm_report(GPM_PR_DEBUG, "Responce %X to byte %X", ack, b); -#endif - - return ack; -} - -/* Read a byte from the touchpad or use the Synaptics extended ps/2 syntax to - * read a byte from the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. - */ -static byte syn_ps2_getbyte(int fd, int stick) -{ - byte response[6]; - - if(!stick) { - response[1] = tp_ps2_getbyte(fd); - } else { - response[0] = tp_ps2_getbyte(fd); - response[1] = tp_ps2_getbyte(fd); - response[2] = tp_ps2_getbyte(fd); - response[3] = tp_ps2_getbyte(fd); - response[4] = tp_ps2_getbyte(fd); - response[5] = tp_ps2_getbyte(fd); - - /* - * Do some sanity checking - */ - if((response[0] & 0xFC) != 0x84) { - gpm_report(GPM_PR_ERR, "Byte 0 of stick device responce is not valid"); - return -1; - } - if((response[3] & 0xCC) != 0xC4) { - gpm_report(GPM_PR_ERR, "Byte 3 of stick device responce is not valid"); - return -1; - } - } - - return response[1]; -} - -/* write byte to the touchpad or use the Synaptics extended ps/2 syntax to write - * a byte to the stick device. The variable stick is used to indicate - * whether it is the touchpad or stick device that is meant. */ -static void syn_ps2_putbyte(int fd, int stick, byte b) -{ - byte ack; - -#ifdef DEBUG_PUTBYTE - gpm_report(GPM_PR_DEBUG, "Send byte %X to %s", b, - (stick ? "Stick" : "Touchpad")); -#endif - - if(!stick) { - ack = tp_ps2_putbyte(fd, b); - } else { - syn_ps2_send_cmd(fd, DEVICE_TOUCHPAD, b); - ack = tp_ps2_putbyte(fd, PS2_SAMPLE_RATE); - if(ack != PS2_ACK) - gpm_report(GPM_PR_ERR, "Invalid ACK to stick putbytet sample rate"); - ack = tp_ps2_putbyte(fd, PS2_SYN_SET_STICK); - if(ack != PS2_ACK) - gpm_report(GPM_PR_ERR, "Invalid ACK to stick putbytet set stick"); - ack = syn_ps2_getbyte(fd, DEVICE_STICK); - } - - if(ack != PS2_ACK) - gpm_report(GPM_PR_ERR, "Invalid ACK to synps2 %s putbyte %02X, got %02X", - (stick ? "Stick" : "Touchpad"), b, ack); -} - -/* use the Synaptics extended ps/2 syntax to write a special command byte -* STIG page 36: Send exactly four PS2_SYN_CMD (which is otherwise ignored) -* and after each a byte with the 2 first bits being the command (LSB). End it with -* either PS2_SAMPLE_RATE or PS2_STATUS_REQ. It is hinted to send an inert command -* first so not having five or more PS2_SYN_CMD by coincident. -* -* If data is for the stick device every byte has to be encode by the above method. -*/ -static void syn_ps2_send_cmd(int fd, int stick, byte cmd) -{ - int i; - -#ifdef DEBUG_CMD - gpm_report(GPM_PR_DEBUG, "Send Command %X to %s", cmd, - (stick ? "Stick" : "Touchpad")); -#endif - - /* - * initialize with 'inert' command - */ - tp_ps2_putbyte(fd, PS2_SYN_INERT); - for(i = 0; i < 4; i++) { - syn_ps2_putbyte(fd, stick, PS2_SYN_CMD); - syn_ps2_putbyte(fd, stick, (cmd >> 6) & 0x3); - cmd <<= 2; - } -} - -#if 0 - -/* write 'cmd' to mode byte 1. - * This function is not used. - * Code 0x0A is unknown to me, maybe used in older synaptics? - * - * This is used for some old 2 byte control synaptics. The function is not - * used, and is probably leftover from mixing with Van der Plas code. - */ -static void syn_ps2_set_mode1(int fd, int stick, byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - tp_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - tp_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE1); -} - -#endif - -/* write 'cmd' to mode byte 2 - * See ps2_send_cmd. PS2_SR_SET_MODE stores the touchpad mode encoded in the - * four PS2_SYN_CMD commands - */ -static void syn_ps2_set_mode2(int fd, int stick, byte cmd) -{ - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte(fd, stick, PS2_SAMPLE_RATE); - syn_ps2_putbyte(fd, stick, PS2_SYN_SET_MODE2); -} - -/* read three byte status ('a','b','c') corresponding to register 'cmd' -* Special status request for synaptics is given after a cmd. -* Byte b is PS2_SYN_STATUS_OK to recognize a synaptics -*/ -static void syn_ps2_status_rqst(int fd, int stick, byte cmd, byte * bytes) -{ - gpm_report(GPM_PR_INFO, "Status request for %s, %X", - (stick ? "stick" : "touchpad"), cmd); - - syn_ps2_send_cmd(fd, stick, cmd); - syn_ps2_putbyte(fd, stick, PS2_STATUS_REQ); - bytes[0] = syn_ps2_getbyte(fd, stick); - bytes[1] = syn_ps2_getbyte(fd, stick); - bytes[2] = syn_ps2_getbyte(fd, stick); - - gpm_report(GPM_PR_INFO, "Status request %X %X %X", bytes[0], bytes[1], - bytes[2]); -} - -#if 0 - -/* read the modes from the touchpad (in ps/2 format) */ -static void syn_ps2_read_modes(int fd, int stick) -{ - unsigned char bytes[3]; - - syn_ps2_status_rqst(fd, stick, PS2_SYN_CMD_MODES, bytes); -# ifdef DEBUG - gpm_report(GPM_PR_INFO, "Synaptic PS/2 %s modes: %02X", - (stick ? "stick" : "touchpad"), bytes[2]); -# endif -} - -#endif - -/* read the identification from the ps2 touchpad */ -static void syn_ps2_read_ident(int fd, int stick, info_type * info) -{ - byte bytes[3]; - - syn_ps2_status_rqst(fd, stick, PS2_SYN_CMD_IDENTIFY, bytes); - if(bytes[1] != PS2_SYN_STATUS_OK) { - gpm_report(GPM_PR_ERR, - "PS/2 device doesn't appear to have synaptics %s identification\n", - (stick ? "sticks" : "touchpads")); - info->info_minor = 0; - info->info_model_code = 0; - info->info_major = 0; - - } else { - info->info_minor = bytes[0]; - info->info_model_code = (bytes[2] >> 4) & 0x0f; - info->info_major = bytes[2] & 0x0f; - } -} - -/* read the model_id from the ps2 touchpad/stick */ -static void syn_ps2_read_model_id(int fd, int stick, model_id_type * model) -{ - unsigned char bytes[3]; - - int model_int; - - syn_ps2_status_rqst(fd, stick, PS2_SYN_CMD_MODEL_ID, bytes); - model_int = ((bytes[0] << 16) | (bytes[1] << 8) | (bytes[2])); - syn_extract_model_id_info(model_int, model); -} - -/* read the extended capability from the ps2 touchpad, STIG page 15 */ -static void syn_ps2_read_cap(int fd, int stick, ext_cap_type * cap) -{ - unsigned char bytes[3]; - - int ext_cap_int; - - syn_ps2_status_rqst(fd, stick, PS2_SYN_CMD_CAPABILITIES, bytes); - - if(bytes[1] != PS2_SYN_STATUS_OK) { - gpm_report(GPM_PR_ERR, - "PS/2 device doesn't appear to have synaptics %s capabilities\n", - (stick ? "stick" : "touchpad")); - ext_cap_int = 0; - } else { - ext_cap_int = bytes[0] << 8 | bytes[2]; - } - - syn_extract_extended_capabilities(ext_cap_int, cap); -} - -/* - * ps2_disable_data - * - * Disable data reporting (streaming), and flush eventual old packets. As the - * kernel keeps a queue of received data from the touchpad, the next byte we - * read could be old data and not the ack to our command or request. Disable - * data should always be called before sending commands or request to the - * touchpad. - * - * Note that this is a general ps2 command which should not be in this file, - * but in mice.c. - */ -static void tp_ps2_disable_data(int fd) -{ - struct timeval tv; - - fd_set rfds; - - unsigned char status; - - byte cmd = PS2_DISABLE_DATA; - - FD_ZERO(&rfds); - FD_SET(fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - write(fd, &cmd, 1); - - usleep(50000); - - while(select(fd + 1, &rfds, NULL, NULL, &tv) == 1) { - read(fd, &status, 1); -#if DEBUG_RESET - gpm_report(GPM_PR_INFO, "PS/2 device disable data flush: %02X", status); -#endif - FD_ZERO(&rfds); - FD_SET(fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - } - - if(status != PS2_ACK) - gpm_report(GPM_PR_ERR, "Invalid ACK to disable stream command, got %02X", - status); -} - -/* - * syn_ps2_enable_data - * - * Enable data after a disable data command. Should have called the disable data - * before calling this function. - */ - -static void syn_ps2_enable_data(int fd) -{ - if(stick_enabled) - syn_ps2_putbyte(fd, DEVICE_STICK, PS2_ENABLE_DATA); - syn_ps2_putbyte(fd, DEVICE_TOUCHPAD, PS2_ENABLE_DATA); -} - -/* - * syn_ps2_send_reset - * - * Send reset command and absorb additional READY, IDCODE from the - * touchpad. Should have called the disable data before calling this function. - * Synaptics garanties always to return PS2_READY. STIG page 31 and 48. - */ - -static void syn_ps2_send_reset(int fd, int stick) -{ - byte status, id_code = PS2_MOUSE_IDCODE; - - byte reset_cmd = PS2_RESET; - - gpm_report(GPM_PR_DEBUG, "Reseting Synaptic PS/2 %s\n", - (stick ? "Stick" : "Touchpad")); - - /* - * Send reset command without eating the ack. - */ - if(!stick) { - write(fd, &reset_cmd, 1); - status = tp_ps2_getbyte(fd); - } else { - syn_ps2_putbyte(fd, stick, reset_cmd); - status = PS2_ACK; - } - - /* - * Sometimes the touchpad sends additional ready,idcode before ack the reset - * command. I dont know why! - */ - while(status == PS2_READY) { - gpm_report(GPM_PR_INFO, - "PS/2 device sending additional READY, ID CODE.\n"); - id_code = syn_ps2_getbyte(fd, stick); - status = syn_ps2_getbyte(fd, stick); - } - - if(status != PS2_ACK || id_code != PS2_MOUSE_IDCODE) { - gpm_report(GPM_PR_ERR, - "Sending reset command to PS/2 Device failed: No ACK, got %02X.\n", - status); - } - - /* - * Wait 750 ms to recalibrate. - */ - usleep(750000); - - if((status = syn_ps2_getbyte(fd, stick)) != PS2_READY) { - gpm_report(GPM_PR_ERR, - "Reseting PS/2 Device failed: No READY, got %02X.\n" - "Check pc_keyb.c for reconnect smartness.\n", status); - } - if((id_code = syn_ps2_getbyte(fd, stick)) != PS2_MOUSE_IDCODE) { - gpm_report(GPM_PR_ERR, - "Reseting PS/2 Device failed: Wrong ID, got %02X.\n", id_code); - } - -} - -/* -** syn_ps2_absolute_mode -** -** Put the touchpad into absolute mode. -*/ - -static void syn_ps2_absolute_mode(int fd) -{ - - /* - * select 6 byte packet, high packet rate, no-sleep - */ - syn_ps2_set_mode2(fd, DEVICE_TOUCHPAD, - (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - PS2_NO_SLEEP | - (wmode_enabled ? NO_TAPDRAG_GESTURE : TAPDRAG_GESTURE) | - (stick_enabled ? STICK_ENABLED : STICK_DISABLE) | - (wmode_enabled ? REPORT_W_ON : REPORT_W_OFF))); - -} - -/**************************************************************************** -** -** TRANSLATE FUNCTIONS the incoming data to an uniform report -** -****************************************************************************/ - -/* SERIAL PACKETS - * STIG page 63, note 7 bit! - * - * byte 0 | 1 | reserved | gesture | finger | left | middle | right| - * byte 1 | 0 | x-pos 7-12 | - * byte 2 | 0 | x-pos 1-6 | - * byte 3 | 0 | y-pos 7-12 | - * byte 4 | 0 | y-pos 1-6 | - * byte 5 | 0 | z pressure 7-2 | - * byte 6 | 0 | down | up |y-pos 0 | x-pos 0 | z pressure 0-1 | (new_abs set) - * byte 7 | 0 | reserved | W mode 0-3 | (new_abs and wmode set) - */ - -static void syn_serial_translate_data(unsigned char *data, report_type * report) -{ - report->gesture = check_bits(data[0], 0x10); - report->fingers = check_bits(data[0], 0x08); - report->left = check_bits(data[0], 0x04); - report->middle = check_bits(data[0], 0x02); - report->right = check_bits(data[0], 0x01); - report->x = (data[1] << 7) | (data[2] << 1); - report->y = (data[3] << 7) | (data[4] << 1); - report->pressure = data[5] << 2; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->w = 0; - report->fingerwidth = 0; - - if(model[0].info_new_abs) { - report->up = check_bits(data[6], 0x20); - report->down = check_bits(data[6], 0x40); - report->y |= (data[6] & 0x08) >> 3; - report->x |= (data[6] & 0x04) >> 2; - report->pressure |= (data[6] & 0x03); - - if(wmode_enabled) { - report->w = (data[7] & 0x0F); - } - } -} - -/* PS2 PACKETS - * - * Handle error packets. It may be garbage or not, as the synaptics pad keeps sending data 1 - * sec after last touch. - */ - -static void syn_ps2_translate_error(unsigned char *data, report_type * report) -{ - gpm_report(GPM_PR_WARN, - "Unrecognized Synaptic PS/2 Touchpad packet: %02X %02X %02X %02X %02X %02X", - data[0], data[1], data[2], data[3], data[4], data[5]); - - if(reset_on_error_enabled) { - /* - * Hack to get the fd: which_mouse is the current mouse, and as the - * synaptic code is called, it is the current mouse. - */ - syn_ps2_reset(which_mouse->fd); - syn_ps2_absolute_mode(which_mouse->fd); - } - - report->left = 0; - report->middle = 0; - report->right = 0; - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = 0; - report->y = 0; - report->pressure = 0; - report->gesture = 0; - report->fingers = 0; - report->fingerwidth = 0; - report->w = 0; - -} - -/* - * STIG page 42 - * wmode = 0, newer version. Gesture, right and left are repeated. - * - * byte 0 | 1 | 0 | Finger | Reserved | 0 | Gesture | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | Gesture | Right | Left | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - * STIG page 43 - * wmode = 0, old version < 3.2. - * Second is a second gesture!? - * - * byte 0 | 1 | 1 | z-pres 6-7 | Second | Gesture | Right | Left | - * byte 1 | finger | 0 | 0 | x-pos 12-8 | - * byte 2 | x-pos 0-7 | - * byte 3 | 1 | 0 | z-pressure 0-5 | - * byte 4 |Reserved | 0 | 0 | y - pos 8-12 | - * byte 5 | y - pos 0-7 | - * - */ - -/* Translate the reported data into a record for processing */ -static void syn_ps2_translate_data(unsigned char *data, report_type * report) -{ - - /* - * Check that this is indeed an absolute 6 byte new version packet - */ - if(((data[0] & 0xc8) == 0x80) && /* Check static in byte 0 */ - ((data[3] & 0xc8) == 0xc0) && /* Check static in byte 3 */ - ((data[0] & 0x0F) == (data[3] & 0x0F))) { /* check repeated data */ - report->left = check_bits(data[0], 0x01); - report->middle = 0; - report->right = check_bits(data[0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | ((data[5]))); - report->pressure = data[2]; - report->gesture = check_bits(data[0], 0x04); - report->fingers = check_bits(data[0], 0x20); - report->fingerwidth = 0; - report->w = 0; - - } /* th Old style packet maybe */ - else if(((data[0] & 0xC0) == 0xC0) && /* Static in byte 0 */ - ((data[1] & 0x60) == 0x00) && /* Static in byte 1 */ - ((data[3] & 0xC0) == 0x80) && /* Static in byte 3 */ - ((data[4] & 0x60) == 0x00)) { /* Static in byte 4 */ - report->left = check_bits(data[0], 0x01); - report->middle = 0; - report->right = check_bits(data[0], 0x02); - report->fourth = 0; - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x1F) << 8) | ((data[2]))); - report->y = (((data[4] & 0x1f) << 8) | ((data[5]))); - report->pressure = (((data[0] & 0x30) << 2) | ((data[3] & 0x3f))); - report->gesture = check_bits(data[0], 0x04); - report->fingers = check_bits(data[1], 0x80); - report->fingerwidth = 0; - report->w = 0; - - } else { - syn_ps2_translate_error(data, report); - } -} - -/* STIG page 42 - * wmode = 1, - * - * byte 0 | 1 | 0 | W 2-3 | 0 | W 1 | Right | Left | - * byte 1 | y-pos 11-8 | x-pos 11-8 | - * byte 2 | z pressure 0-7 | - * byte 3 | 1 | 1 | y-pos 12 | x-pos 12 | 0 | W 0 | R/D | L/U | - * byte 4 | x - pos 0-7 | - * byte 5 | y - pos 0-7 | - * - */ - -static void syn_ps2_translate_wmode_data(unsigned char *data, - report_type * report) -{ - /* - * Check that it is an absolute packet - */ - if(((data[0] & 0xc8) == 0x80) && ((data[3] & 0xc8) == 0xc0)) { - - report->left = check_bits(data[0], 0x01); - report->middle = check_bits(data[0] ^ data[3], 0x01); - report->right = check_bits(data[0], 0x02); - report->fourth = check_bits(data[0] ^ data[3], 0x02); - report->up = 0; - report->down = 0; - report->x = (((data[1] & 0x0F) << 8) | - ((data[3] & 0x10) << 8) | ((data[4]))); - report->y = (((data[1] & 0xF0) << 4) | - ((data[3] & 0x20) << 7) | ((data[5]))); - report->pressure = data[2]; - report->fingers = 0; - report->fingerwidth = 0; - report->gesture = 0; - report->w = (((data[3] & 0x04) >> 2) | - ((data[0] & 0x04) >> 1) | ((data[0] & 0x30) >> 2)); - - } else { - syn_ps2_translate_error(data, report); - } -} - -/**************************************************************************** -** -** INTERFACE ROUTINES -** -****************************************************************************/ - -/* -** syn_process_serial_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_serial_data(Gpm_Event * state, unsigned char *data) -{ - /* - * initialize the state - */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - syn_serial_translate_data(data, &cur_report); - if(wmode_enabled) { - syn_process_wmode_report(&cur_report); - } - if(tp_find_fingers(&cur_report, state)) - return; - if(wmode_enabled) { - tp_find_gestures(&cur_report); - } - - tp_process_report(state, &cur_report); -} - -/* -** syn_serial_reset -** -** Reset the touchpad to relative mode. This cannot be called directly as a -** command should be sent in 1200 baud, not 9600. -*/ - -void syn_serial_reset(int fd) -{ - gpm_report(GPM_PR_INFO, "Reseting Synaptic Serial Touchpad."); - - syn_serial_set_mode(fd, (RELATIVE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | NORMAL_REPORT | REPORT_W_OFF)); - -} - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -*/ -int syn_serial_init(int fd) -{ - int return_packetlength; - - gpm_report(GPM_PR_DEBUG, "Initializing Synaptics Serial TouchPad"); - - syn_serial_read_ident(fd, &ident[0]); - syn_serial_read_model_id(fd, &model[0]); - syn_serial_read_cap(fd, &capabilities[0]); - - syn_process_config(ident[0], model[0]); - - syn_dump_info(0); - - /* - * Change the protocol to use either 6,7 or 8 bytes, STIG 63 - */ - if(model[0].info_new_abs) { - if(wmode_enabled) { - return_packetlength = 8; - } else { - return_packetlength = 7; - } - } else { - return_packetlength = 6; - wmode_enabled = 0; - } - - syn_serial_set_mode(fd, (ABSOLUTE_MODE | - HIGH_REPORT_RATE | - USE_9600_BAUD | - (model[0].info_new_abs ? EXTENDED_REPORT : - NORMAL_REPORT) | (wmode_enabled ? REPORT_W_ON : - REPORT_W_OFF))); - - return return_packetlength; -} - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte report. -*/ -void syn_process_ps2_data(Gpm_Event * state, unsigned char *data) -{ - /* - * gpm_report(GPM_PR_DEBUG,"Data %02x %02x %02x %02x %02x - * %02x",data[0],data[1],data[2],data[3],data[4],data[5]); - */ - - /* - * initialize the state - */ - state->buttons = 0; - state->dx = 0; - state->dy = 0; - - if(wmode_enabled) { - syn_ps2_translate_wmode_data(data, &cur_report); - if(syn_ps2_process_extended_packets(data, &cur_report, state)) - return; - syn_process_wmode_report(&cur_report); - if(tp_find_fingers(&cur_report, state)) - return; - tp_find_gestures(&cur_report); - } else { - syn_ps2_translate_data(data, &cur_report); - if(tp_find_fingers(&cur_report, state)) - return; - } - - tp_process_report(state, &cur_report); -} - -/* -** syn_ps2_reset -** -** Reset the touchpad and set to relative mode (ps/2). -*/ - -void syn_ps2_reset(int fd) -{ - gpm_report(GPM_PR_INFO, "Reseting Synaptic PS/2 Touchpad."); - - /* - * Stop incoming motion data (of whatever kind absolute/relative). - */ - tp_ps2_disable_data(fd); - - if(stick_enabled) - syn_ps2_send_reset(fd, DEVICE_STICK); - syn_ps2_send_reset(fd, DEVICE_TOUCHPAD); - - syn_ps2_enable_data(fd); -} - -/* - * syn_ps2_init_stick - * - * Initialize the attached device on the synaptics touchpad (usually a stick). - */ - -static void syn_ps2_init_stick(int fd) -{ - - if(!stick_enabled) - return; - - gpm_report(GPM_PR_DEBUG, "Initializing Synaptics PS/2 Stick Device"); - - /* - * Reset it, set defaults, streaming - */ - syn_ps2_send_reset(fd, DEVICE_STICK); - syn_ps2_putbyte(fd, DEVICE_STICK, PS2_SET_DEFAULT); - syn_ps2_putbyte(fd, DEVICE_STICK, PS2_STREAM_MODE); - - /* - * Unused - */ - /* - * syn_ps2_read_ident (fd, DEVICE_STICK, &ident[1]); - */ - /* - * syn_ps2_read_model_id (fd, DEVICE_STICK, &model[1]); - */ - /* - * syn_ps2_read_cap (fd, DEVICE_STICK, &capabilities[1]); - */ - - /* - * syn_dump_info(DEVICE_STICK); - */ -} - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init(int fd) -{ - - gpm_report(GPM_PR_DEBUG, "Initializing Synaptics PS/2 TouchPad"); - - tp_ps2_disable_data(fd); - - /* - * Init touchpad - */ - syn_ps2_send_reset(fd, DEVICE_TOUCHPAD); - - syn_ps2_read_ident(fd, DEVICE_TOUCHPAD, &ident[0]); - syn_ps2_read_model_id(fd, DEVICE_TOUCHPAD, &model[0]); - syn_ps2_read_cap(fd, DEVICE_TOUCHPAD, &capabilities[0]); - - syn_process_config(ident[0], model[0]); - syn_dump_info(DEVICE_TOUCHPAD); - - syn_ps2_absolute_mode(fd); - - /* - * Absolut mode must be set before Init Stick device - */ - syn_ps2_init_stick(fd); - - /* - * Enable absolut mode and streaming - */ - syn_ps2_enable_data(fd); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics_ps2/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics_ps2/m.c deleted file mode 100644 index fafac936..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics_ps2/m.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* synaptics support */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -int M_synaptics_ps2(Gpm_Event * state, unsigned char *data) -{ - syn_process_ps2_data(state, data); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics_serial/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics_serial/m.c deleted file mode 100644 index c2ec2772..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/synaptics_serial/m.c +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* synaptics support */ - -/* Synaptics TouchPad mouse emulation (Henry Davies) */ -int M_synaptics_serial(Gpm_Event * state, unsigned char *data) -{ - syn_process_serial_data(state, data); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/synps2/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/synps2/i.c deleted file mode 100644 index cca7f9a7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/synps2/i.c +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "synaptics.h" /* Gpm_type */ - -/* synaptics touchpad, ps2 version: Henry Davies */ -Gpm_Type *I_synps2(int fd, unsigned short flags, struct Gpm_Type *type, - int argc, char **argv) -{ - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - syn_ps2_init(fd); - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/i.c deleted file mode 100644 index e5b03778..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/i.c +++ /dev/null @@ -1,48 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "mice.h" /* check_no_argv */ -#include "daemon.h" /* which_mouse */ -#include "drivers.h" - -int twiddler_key_init(void); /* FIXME: from twiddler */ - -Gpm_Type *I_twid(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - - if(check_no_argv(argc, argv)) - return NULL; - - if(twiddler_key_init() != 0) - return NULL; - /* - * the twiddler is a serial mouse: just drop dtr - * and run at 2400 (unless specified differently) - */ - if((which_mouse->opt_baud) == DEF_BAUD) - (which_mouse->opt_baud) = 2400; - argv[1] = "dtr"; /* argv[1] is guaranteed to be NULL (this is - * dirty) */ - return I_serial(fd, flags, type, argc, argv); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/m.c deleted file mode 100644 index d98dc467..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/m.c +++ /dev/null @@ -1,190 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* KG_SHIFT */ - -#include "types.h" /* Gpm_type */ -#include "twiddler.h" /* twiddler */ - -int M_twid(Gpm_Event * state, unsigned char *data) -{ - unsigned long message = 0UL; - - int i, h, v; - - static int lasth, lastv, lastkey, key, lock = 0, autorepeat = 0; - - /* - * build the message as a single number - */ - for(i = 0; i < 5; i++) - message |= (data[i] & 0x7f) << (i * 7); - key = message & TW_ANY_KEY; - - if((message & TW_MOD_M) == 0) { /* manage keyboard */ - if(((message & TW_ANY_KEY) != (unsigned long) lastkey) || autorepeat) - autorepeat = twiddler_key(message); - lastkey = key; - lock = 0; - return -1; /* no useful mouse data */ - } - - switch (message & TW_ANY1) { - case TW_L1: - state->buttons = GPM_B_RIGHT; - break; - case TW_M1: - state->buttons = GPM_B_MIDDLE; - break; - case TW_R1: - state->buttons = GPM_B_LEFT; - break; - case 0: - state->buttons = 0; - break; - } - /* - * also, allow R1 R2 R3 (or L1 L2 L3) to be used as mouse buttons - */ - if(message & TW_ANY2) - state->buttons |= GPM_B_MIDDLE; - if(message & TW_L3) - state->buttons |= GPM_B_LEFT; - if(message & TW_R3) - state->buttons |= GPM_B_RIGHT; - - /* - * put in modifiers information - */ - { - struct { - unsigned long in, out; - } *ptr, list[] = { - { - TW_MOD_S, 1 << KG_SHIFT}, { - TW_MOD_C, 1 << KG_CTRL}, { - TW_MOD_A, 1 << KG_ALT}, { - 0, 0} - }; - for(ptr = list; ptr->in; ptr++) - if(message & ptr->in) - state->modifiers |= ptr->out; - } - - /* - * now extraxt H/V - */ - h = (message >> TW_H_SHIFT) & TW_M_MASK; - v = (message >> TW_V_SHIFT) & TW_M_MASK; - if(h & TW_M_BIT) - h = -(TW_M_MASK + 1 - h); - if(v & TW_M_BIT) - v = -(TW_M_MASK + 1 - v); - -#ifdef TWIDDLER_STATIC - /* - * static implementation: return movement - */ - if(!lock) { - lasth = h; - lastv = v; - lock = 1; - } - state->dx = -(h - lasth); - lasth = h; - state->dy = -(v - lastv); - lastv = v; - -#elif defined(TWIDDLER_BALLISTIC) - { - /* - * in case I'll change the resolution - */ - static int tw_threshold = 5; /* above this it moves */ - - static int tw_scale = 5; /* every 5 report one */ - - if(h > -tw_threshold && h < tw_threshold) - state->dx = 0; - else { - h = h - (h < 0) * tw_threshold + lasth; - lasth = h % tw_scale; - state->dx = -(h / tw_scale); - } - if(v > -tw_threshold && v < tw_threshold) - state->dy = 0; - else { - v = v - (v < 0) * tw_threshold + lastv; - lastv = v % tw_scale; - state->dy = -(v / tw_scale); - } - } - -#else /* none defined: use mixed approach */ - { - /* - * in case I'll change the resolution - */ - static int tw_threshold = 60; /* above this, movement is ballistic */ - - static int tw_scale = 10; /* ball: every 6 units move one unit */ - - static int tw_static_scale = 3; /* stat: every 3 units move one unit */ - - static int lasthrest, lastvrest; /* integral of small motions uses rest */ - - if(!lock) { - lasth = h; - lasthrest = 0; - lastv = v; - lastvrest = 0; - lock = 1; - } - - if(h > -tw_threshold && h < tw_threshold) { - state->dx = -(h - lasth + lasthrest) / tw_static_scale; - lasthrest = (h - lasth + lasthrest) % tw_static_scale; - } else { /* ballistic */ - - h = h - (h < 0) * tw_threshold + lasthrest; - lasthrest = h % tw_scale; - state->dx = -(h / tw_scale); - } - lasth = h; - if(v > -tw_threshold && v < tw_threshold) { - state->dy = -(v - lastv + lastvrest) / tw_static_scale; - lastvrest = (v - lastv + lastvrest) % tw_static_scale; - } else { /* ballistic */ - - v = v - (v < 0) * tw_threshold + lastvrest; - lastvrest = v % tw_scale; - state->dy = -(v / tw_scale); - } - lastv = v; - } -#endif - - /* - * fprintf(stderr,"%4i %4i -> %3i %3i\n",h,v,state->dx,state->dy); - */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/twiddler.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/twiddler.c deleted file mode 100644 index 394efb88..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/twid/twiddler.c +++ /dev/null @@ -1,629 +0,0 @@ - -/* - * twiddler.c - support for the twiddler keyboard - * - * Copyright 1998 rubini@linux.it (Alessandro Rubini) - * Changed 04/23/2001 nico@schottelius.org (Nico Schottelius) - * --> removed hard wired dev names. Instead used symbolic constants and - * generated option.consolename - * - * 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. - ********/ - -/* TODO: - resolution change (mice.c) - switch up/down (mice.c) - manage X.... - modifiers - */ - -/* Done: - two cfg files - mouse buttons - unblank - special keys... - meta keys - auto-repeat: double press plus hold... - README -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpm.h" -#include "gpmInt.h" -#include "message.h" -#include "twiddler.h" - -#include "daemon.h" - -/* - * Each table is made up of 256 entries, as these are the possible chords - * Then, there is one table for each modifier (two of them are not allowed). - * Each entry is a pointer: a "low" pointer represents a single byte, true - * pointers represent strings. This is not very clean, but it works well. - */ - -char *twiddler_table[7][256]; - -/* This maps modifiers to tables */ -struct twiddler_map_struct { - unsigned long modifiers; - char *keyword; - char **table; -} twiddler_map[] = { - { - TW_MOD_0, "", twiddler_table[0]}, { - TW_MOD_S, "Shift", twiddler_table[1]}, { - TW_MOD_N, "Numeric", twiddler_table[2]}, { - TW_MOD_F, "Function", twiddler_table[3]}, { - TW_MOD_C, "Control", twiddler_table[4]}, { - TW_MOD_C, "Ctrl", twiddler_table[4]}, { - TW_MOD_A, "Alt", twiddler_table[5]}, { - TW_MOD_A, "Meta", twiddler_table[5]}, - -/* This is different!! */ - { - TW_MOD_C | TW_MOD_S, "Ctrl+Shift", twiddler_table[6]}, { - TW_MOD_C | TW_MOD_S, "Shift+Ctrl", twiddler_table[6]}, { - 0, NULL, NULL} -}; - -/* Convert special keynames to strings */ -struct twiddler_f_struct { - char *instring; - char *outstring; -} twiddler_f[] = { - { - "F1", "\033[[A"}, { - "F2", "\033[[B"}, { - "F3", "\033[[C"}, { - "F4", "\033[[D"}, { - "F5", "\033[[E"}, { - "F6", "\033[17~"}, { - "F7", "\033[18~"}, { - "F8", "\033[19~"}, { - "F9", "\033[20~"}, { - "F10", "\033[21~"}, { - "F11", "\033[23~"}, { - "F12", "\033[24~"}, { - "F13", "\033[25~"}, { - "F14", "\033[26~"}, { - "F15", "\033[28~"}, { - "F16", "\033[29~"}, { - "F17", "\033[31~"}, { - "F18", "\033[32~"}, { - "F19", "\033[33~"}, { - "F20", "\033[34~"}, { - "Find", "\033[1~"}, { - "Insert", "\033[2~"}, { - "Remove", "\033[3~"}, { - "Select", "\033[4~"}, { - "Prior", "\033[5~"}, { - "Next", "\033[6~"}, { - "Macro", "\033[M"}, { - "Pause", "\033[P"}, { - "Up", "\033[A"}, { - "Down", "\033[B"}, { - "Left", "\033[D"}, { - "Right", "\033[C"}, { - NULL, NULL} -}; - -/* Convert special keynames to functions */ -struct twiddler_fun_struct { - char *name; - int (*fun) (char *string); -}; - -/*===================================================================*/ - -/* This part deals with pushing keys */ - -/* Function support: - if a chord maps to a function, we need two pointers: one to the - function and one to its argument. Therefore we must keep an array - that keeps both pointers, and the pointer in the table is just - an handle to this pair of pointers. The table has a maximum len -*/ - -#define TWIDDLER_MAX_ACTIVE_FUNS 128 - -/* These are the special functions that perform special actions */ -int twiddler_console(char *s) -{ - int consolenr = atoi(s); /* atoi never fails :) */ - - int fd; - - if(consolenr == 0) - return 0; /* nothing to do */ - - fd = open_console(O_RDONLY); - if(fd < 0) - return -1; - if(ioctl(fd, VT_ACTIVATE, consolenr) < 0) { - close(fd); - return -1; - } - -/*if (ioctl(fd, VT_WAITACTIVE, consolenr)<0) {close(fd); return -1;} */ - close(fd); - return 0; -} - -int twiddler_exec(char *s) -{ - int pid; - - extern struct options option; - - switch (pid = fork()) { - case -1: - return -1; - case 0: - close(0); - close(1); - close(2); /* very rude! */ - - open(GPM_NULL_DEV, O_RDONLY); - open(option.consolename, O_WRONLY); - dup(1); - execl("/bin/sh", "sh", "-c", s, NULL); - exit(1); /* shouldn't happen */ - - default: /* father: */ - return (0); - } -} - -/* The functions and their name */ -struct twiddler_fun_struct twiddler_functions[] = { - {"Console", twiddler_console}, - {"Exec", twiddler_exec}, - {NULL, NULL} -}; - -/* The registered functions */ -struct twiddler_active_fun { - int (*fun) (char *s); - char *arg; -} twiddler_active_funs[TWIDDLER_MAX_ACTIVE_FUNS]; - -static int active_fun_nr = 0; - -int twiddler_do_fun(int i) -{ - twiddler_active_funs[i].fun(twiddler_active_funs[i].arg); - return 0; -} - -/* - * Ok, from now on it's normal handling - */ - -/* This returns the table to use */ -static inline char **twiddler_get_table(unsigned long message) -{ - unsigned long mod = message & TW_ANY_MOD; - - struct twiddler_map_struct *ptr; - - for(ptr = twiddler_map; ptr->table; ptr++) - if(ptr->modifiers == mod) - return ptr->table; - return NULL; -} - -/* And this uses the item to push keys */ -static inline int twiddler_use_item(char *item) -{ - int fd = open_console(O_WRONLY); - - int i, retval = 0; - - unsigned char pushthis, unblank = 4; /* 4 == TIOCLINUX unblank */ - - /* - * a special function - */ - /* - * a single byte - */ - if(((unsigned long) item & 0xff) == (unsigned long) item) { - pushthis = (unsigned long) item & 0xff; - retval = ioctl(fd, TIOCSTI, &pushthis); - } else if(i = (struct twiddler_active_fun *) item - twiddler_active_funs, - i >= 0 && i < active_fun_nr) - twiddler_do_fun(i); - else /* a string */ - for(; *item != '\0' && retval == 0; item++) - retval = ioctl(fd, TIOCSTI, item); - - ioctl(fd, TIOCLINUX, &unblank); - if(retval) - gpm_report(GPM_PR_ERR, GPM_MESS_IOCTL_TIOCSTI, option.progname, - strerror(errno)); - close(fd); - return retval; -} - -/* return value is one if auto-repeating, 0 if not */ -int twiddler_key(unsigned long message) -{ - char **table = twiddler_get_table(message); - - char *val; - - /* - * These two are needed to avoid transmitting single keys when typing - * chords. When the number of keys being held down decreases, data - * is transmitted; but as soon as it increases the cycle is restarted. - */ - static unsigned long last_message; - - static int marked; - - /* - * The time values are needed to implement repetition of keys - */ - static struct timeval tv1, tv2; - - static unsigned int nclick, last_pressed; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - if(!table) - return 0; - message &= 0xff; - val = table[message]; - - if((message < last_message) && !marked) { /* ok, do it */ - marked++; /* don't retransmit on release */ - twiddler_use_item(table[last_message]); - if(last_pressed != last_message) { - nclick = 1; - GET_TIME(tv1); - } /* first click (note: this is release) */ - last_pressed = last_message; - } - if(message < last_message) { /* marked: just ignore */ - last_message = message; - return 0; - } - - /* - * building up a chord or repeating - */ - - if(message != last_pressed) { /* building up */ - marked = 0; - last_message = message; - return 0; - } - - /* - * Hmmm... double click - */ - if(message > last_message) { - marked = 0; /* but don't use it */ - GET_TIME(tv2); - nclick = 1 + (DIF_TIME(tv1, tv2) < 300); /* if fast, counts as double */ - last_message = message; - if(nclick == 1) - GET_TIME(tv1); /* maybe the next.. */ - return 1; - } - - /* - * so, we are repeating... - */ - if(nclick == 2) { - GET_TIME(tv1); /* compute delay */ - if(DIF_TIME(tv2, tv1) > 500) /* held enough */ - twiddler_use_item(table[message]); - return 1; - } - return 0; -} - -/*===================================================================*/ - -/* This part deals with reading the cfg file(s) */ - -/* retrieve the right table according to the modifier string */ -char **twiddler_mod_to_table(char *mod) -{ - struct twiddler_map_struct *ptr; - - int len = strlen(mod); - - if(len == 0) - return twiddler_map->table; - - for(ptr = twiddler_map; ptr->table; ptr++) { - if(!strncasecmp(mod, ptr->keyword, len)) - return ptr->table; - } - return NULL; -} - -/* Convert the "M00L"-type string to an integer */ -int twiddler_chord_to_int(char *chord) -{ - char *convert = "0LMR"; /* 0123 */ - - char *tmp; - - int result = 0; - - int shift = 0; - - if(strlen(chord) != 4) - return -1; - - while(*chord) { - if(!(tmp = strchr(convert, *chord))) - return -1; - result |= (tmp - convert) << shift; - chord++; - shift += 2; - } - return result; -} - -/* Convert an escape sequence to a single byte */ -int twiddler_escape_sequence(char *s, int *len) -{ - int res = 0; - - *len = 0; - if(isdigit(*s)) { /* octal */ - while(isdigit(*s)) { - res *= 8; - res += *s - '0'; - s++; - (*len)++; - if(*len == 3) - return res; - } - return res; - } - - *len = 1; - switch (*s) { - case 'n': - return '\n'; - case 'r': - return '\r'; - case 'e': - return '\e'; - case 't': - return '\t'; - case 'a': - return '\a'; - case 'b': - return '\b'; - default: - return *s; - - /* - * a case statement after default: ???? - */ - case 'x': /* hex */ - (*len)++; - s++; - if(isdigit(*s)) - res = *s - '0'; - else - res = tolower(*s) - 'a' + 10; - s++; - if(isxdigit(*s)) { - (*len)++; - res *= 16; - if(isdigit(*s)) - res += *s - '0'; - else - res += tolower(*s) - 'a' + 10; - } - return res; - } -} - -/* - * Convert the rest to a string or a byte - * the special return value "s" signals an error - */ -char *twiddler_rest_to_value(char *s) -{ - char *ptr; - - static char buf[64]; - - int ibuf = 0, len; - - struct twiddler_f_struct *sptr; - - struct twiddler_fun_struct *fptr; - - /* - * look for the value - */ - ptr = strchr(s, '='); - if(!ptr) - return s; - ptr++; - while(isspace(*ptr)) - ptr++; - if(!*ptr) - return s; - - /* - * now see what the rest is: accept a single char, - * standalone escape sequences or strings (with escape seq.) - * Whenever the string is not quoted, try to interpret it - */ - if(*ptr == '"') { /* string... */ - ptr++; - while(*ptr != '"') { - if(*ptr == '\\') { - ptr++; - buf[ibuf++] = twiddler_escape_sequence(ptr, &len); - ptr += len; - } else - buf[ibuf++] = *(ptr++); - } - buf[ibuf] = '\0'; - return strdup(buf); - } - if(*ptr == '\\') - return (char *) twiddler_escape_sequence(ptr + 1, &len /* unused */ ); - - if(strlen(ptr) == 1) - return ((char *) ((unsigned long) *ptr & 0xFF)); - - /* - * look for special string - */ - for(sptr = twiddler_f; sptr->instring; sptr++) - if(!strcmp(ptr, sptr->instring)) - return sptr->outstring; - - /* - * finally, look for special functions - */ - for(fptr = twiddler_functions; fptr->name; fptr++) - if(!strncasecmp(fptr->name, ptr, strlen(fptr->name))) { - if(active_fun_nr == TWIDDLER_MAX_ACTIVE_FUNS) { - gpm_report(GPM_PR_ERR, GPM_MESS_TOO_MANY_SPECIAL, option.progname, - TWIDDLER_MAX_ACTIVE_FUNS); - return s; - } - twiddler_active_funs[active_fun_nr].fun = fptr->fun; - twiddler_active_funs[active_fun_nr].arg = - strdup(ptr + strlen(fptr->name)); - return (char *) (twiddler_active_funs + active_fun_nr++); - } - - return s; /* error */ -} - -int twiddler_key_init(void) -{ - FILE *f; - char *files[] = { TW_SYSTEM_FILE, TW_CUSTOM_FILE, NULL }; - int fileindex = 0; - - char s[128], buf[64]; /* buf is for the string */ - - char mod[64], chord[64], *value; - - int index, lineno = 0, errcount = 0; - - char **table; - - static int initcount = 0; - - if(initcount) - return 0; /* do it only once */ - initcount++; - - if(!(f = fopen(TW_SYSTEM_FILE, "r"))) { - gpm_report(GPM_PR_ERR, GPM_MESS_DOUBLE_S, TW_SYSTEM_FILE, - strerror(errno)); - return -1; - } - - /* - * ok, go on reading all the files in files[] - */ - while(files[fileindex]) { - while(fgets(s, 128, f)) { - lineno++; - - /* - * trim newline and blanks, if any - */ - if(s[strlen(s) - 1] == '\n') - s[strlen(s) - 1] = '\0'; - while(isspace(s[strlen(s) - 1])) - s[strlen(s) - 1] = '\0'; - - if(s[0] == '\0' || s[0] == '#') - continue; /* ignore comment or empty */ - - if(sscanf(s, "%s = %s", chord, buf) == 2) /* M00L = anything */ - mod[0] = '\0'; /* no modifiers */ - else if(sscanf(s, "%s %s = %s", mod, chord, buf) == 3) /* Mod M00L =k */ - ; - else if(sscanf(s, "%s", buf) != 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_SYNTAX_1, option.progname, - TW_SYSTEM_FILE, lineno); - errcount++; - continue; - } - - /* - * Ok, here we are: now check the parts - */ - if(!(table = twiddler_mod_to_table(mod))) { - gpm_report(GPM_PR_ERR, GPM_MESS_UNKNOWN_MOD_1, option.progname, - TW_SYSTEM_FILE, lineno, mod); - errcount++; - continue; - } - if((index = twiddler_chord_to_int(chord)) <= 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_INCORRECT_COORDS, option.progname, - TW_SYSTEM_FILE, lineno, chord); - errcount++; - continue; - } - if((value = twiddler_rest_to_value(s)) == s) { - gpm_report(GPM_PR_ERR, GPM_MESS_INCORRECT_LINE, option.progname, - TW_SYSTEM_FILE, lineno, s); - errcount++; - continue; - } - - if(table[index]) { - gpm_report(GPM_PR_ERR, GPM_MESS_REDEF_COORDS, option.progname, - TW_SYSTEM_FILE, lineno, mod, " ", chord); - } - /* - * all done - */ - if(value) - table[index] = value; - else - table[index] = ""; /* the empty string represents the nul byte */ - } /* fgets */ - fclose(f); - while(files[++fileindex]) /* next file, optional */ - if((f = fopen(files[fileindex], "r"))) - break; - } - return errcount; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/vsxxx_aa/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/vsxxx_aa/m.c deleted file mode 100644 index e585c1f5..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/vsxxx_aa/m.c +++ /dev/null @@ -1,84 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ - -/* Support for DEC VSXXX-AA and VSXXX-GA serial mice used on */ - -/* DECstation 5000/xxx, DEC 3000 AXP and VAXstation 4000 */ - -/* workstations */ - -/* written 2001/07/11 by Karsten Merker (merker@linuxtag.org) */ - -/* modified (completion of the protocol specification and */ - -/* corresponding correction of the protocol identification */ - -/* mask) 2001/07/12 by Maciej W. Rozycki (macro@ds2.pg.gda.pl) */ - -int M_vsxxx_aa(Gpm_Event * state, unsigned char *data) -{ - -/* The mouse protocol is as follows: - * 4800 bits per second, 8 data bits, 1 stop bit, odd parity - * 3 data bytes per data packet: - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 0 SignX SignY LMB MMB RMB - * Second Byte 0 DX DX DX DX DX DX DX - * Third Byte 0 DY DY DY DY DY DY DY - * - * SignX: sign bit for X-movement - * SignY: sign bit for Y-movement - * DX and DY: 7-bit-absolute values for delta-X and delta-Y, sign extensions - * are in SignX resp. SignY. - * - * There are a few commands the mouse accepts: - * "D" selects the prompt mode, - * "P" requests a mouse's position (also selects the prompt mode), - * "R" selects the incremental stream mode, - * "T" performs a self test and identification (power-up-like), - * "Z" performs undocumented test functions (a byte follows). - * Parity as well as bit #7 of commands are ignored by the mouse. - * - * 4 data bytes per self test packet (useful for hot-plug): - * 7 6 5 4 3 2 1 0 - * First Byte: 1 0 1 0 R3 R2 R1 R0 - * Second Byte 0 M2 M1 M0 0 0 1 0 - * Third Byte 0 E6 E5 E4 E3 E2 E1 E0 - * Fourth Byte 0 0 0 0 0 LMB MMB RMB - * - * R3-R0: revision, - * M2-M0: manufacturer location code, - * E6-E0: error code: - * 0x00-0x1f: no error (fourth byte is button state), - * 0x3d: button error (fourth byte specifies which), - * else: other error. - * - * The mouse powers up in the prompt mode but we use the stream mode. - */ - - state->buttons = data[0] & 0x07; - state->dx = (data[0] & 0x10) ? data[1] : -data[1]; - state->dy = (data[0] & 0x08) ? -data[2] : data[2]; - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/i.c deleted file mode 100644 index 0804c6b2..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/i.c +++ /dev/null @@ -1,191 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ -#include -#include /* select */ - -#include "mice.h" /* check_no_argv */ -#include "types.h" /* Gpm_type */ -#include "message.h" /* gpm_report */ -#include "wacom.h" /* wacom */ - -Gpm_Type *I_wacom(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - -/* wacom graphire tablet */ -#define UD_RESETBAUD "\r$" /* reset baud rate to default (wacom V) */ - /* - * or switch to wacom IIs (wacomIV) - */ -#define UD_RESET "#\r" /* Reset tablet and enable WACOM IV */ -#define UD_SENDCOORDS "ST\r" /* Start sending coordinates */ -#define UD_FIRMID "~#\r" /* Request firmware ID string */ -#define UD_COORD "~C\r" /* Request max coordinates */ -#define UD_STOP "\nSP\r" /* stop sending coordinates */ - - flags = 0; /* FIXME: 1.99.13 */ - - void reset_wacom() { - /* - * Init Wacom communication; this is modified from xf86Wacom.so module - */ - /* - * Set speed to 19200 - */ - setspeed(fd, 1200, 19200, 0, B19200 | CS8 | CREAD | CLOCAL | HUPCL); - /* - * Send Reset Baudrate Command - */ - write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD)); - usleep(250000); - /* - * Send Reset Command - */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(75000); - /* - * Set speed to 9600bps - */ - setspeed(fd, 1200, 9600, 0, B9600 | CS8 | CREAD | CLOCAL | HUPCL); - /* - * Send Reset Command - */ - write(fd, UD_RESET, strlen(UD_RESET)); - usleep(250000); - write(fd, UD_STOP, strlen(UD_STOP)); - usleep(100000); - } - - int wait_wacom() { - /* - * Wait up to 200 ms for Data from Tablet. - * Do not read that data. - * Give back 0 on timeout condition, -1 on error and 1 for DataPresent - */ - struct timeval timeout; - - fd_set readfds; - - int err; - - FD_ZERO(&readfds); - FD_SET(fd, &readfds); - timeout.tv_sec = 0; - timeout.tv_usec = 200000; - err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout); - return ((err > 0) ? 1 : err); - } - - char buffer[50], *p; - - int RequestData(char *cmd) { - int err; - - /* - * Send cmd if not null, and get back answer from tablet. - * Get Data to buffer until full or timeout. - * Give back 0 for timeout and !0 for buffer full - */ - if(cmd) - write(fd, cmd, strlen(cmd)); - memset(buffer, 0, sizeof(buffer)); - p = buffer; - err = wait_wacom(); - while(err != -1 && err && (p - buffer) < (int) (sizeof(buffer) - 1)) { - p += read(fd, p, (sizeof(buffer) - 1) - (p - buffer)); - err = wait_wacom(); - } - /* - * return 1 for buffer full - */ - return ((strlen(buffer) >= (sizeof(buffer) - 1)) ? !0 : 0); - } - - /* - * We do both modes, relative and absolute, with the same function. - * If WacomAbsoluteWanted is !0 then that function calculates - * absolute values, else relative ones. - * We set this by the -o switch: - * gpm -t wacom -o absolute # does absolute mode - * gpm -t wacom # does relative mode - * gpm -t wacom -o relative # does relative mode - */ - - /* - * accept boolean options absolute and relative - */ - static argv_helper optioninfo[] = { - {"absolute", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value:!0}, - {"relative", ARGV_BOOL, u: {iptr: &WacomAbsoluteWanted}, value:0}, - {"", ARGV_END, u: {iptr: &WacomAbsoluteWanted}, value:0} - }; - parse_argv(optioninfo, argc, argv); - type->absolute = WacomAbsoluteWanted; - reset_wacom(); - - /* - * "Flush" input queque - */ - while(RequestData(NULL)) ; - - /* - * read WACOM-ID - */ - RequestData(UD_FIRMID); - - /* - * Search for matching modell - */ - for(WacomModell = 0; - WacomModell < (int) (sizeof(wcmodell) / sizeof(struct WC_MODELL)); - WacomModell++) { - if(!strncmp(buffer + 2, wcmodell[WacomModell].magic, 2)) { - /* - * Magic matches, modell found - */ - wmaxx = wcmodell[WacomModell].maxX; - wmaxy = wcmodell[WacomModell].maxY; - break; - } - } - if(WacomModell >= (int) (sizeof(wcmodell) / sizeof(struct WC_MODELL))) - WacomModell = -1; - gpm_report(GPM_PR_INFO, GPM_MESS_WACOM_MOD, type->absolute ? 'A' : 'R', - (WacomModell == (-1)) ? "Unknown" : wcmodell[WacomModell].name, - buffer + 2); - - /* - * read Wacom max size - */ - if(WacomModell != (-1) && (!wcmodell[WacomModell].maxX)) { - RequestData(UD_COORD); - sscanf(buffer + 2, "%d,%d", &wmaxx, &wmaxy); - wmaxx = (wmaxx - wcmodell[WacomModell].border); - wmaxy = (wmaxy - wcmodell[WacomModell].border); - } - write(fd, UD_SENDCOORDS, 4); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/m.c deleted file mode 100644 index 95fa9329..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/m.c +++ /dev/null @@ -1,161 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* strcmp */ - -#include "types.h" /* Gpm_type */ -#include "wacom.h" /* wacom */ -#include "daemon.h" /* which_mouse */ -#include "mice.h" /* REALPOS */ - -/* - * Wacom Tablets with pen and mouse: - * Relative-Mode And Absolute-Mode; - * Stefan Runkel 01/2000 , - * Mike Pioskowik 01/2000 -*/ - -/* for relative and absolute : */ -int WacomModell = -1; /* -1 means "dont know" */ - -int WacomAbsoluteWanted = 0; /* Tell Driver if Relative or Absolute */ - -int wmaxx, wmaxy; - -char upmbuf[25]; /* needed only for macro buttons of ultrapad */ - -/* Data for Wacom Modell Identification */ - -/* (MaxX, MaxY are for Modells which do not answer resolution requests */ -struct WC_MODELL wcmodell[3] = { - /* - * ModellName Magic MaxX MaxY Border Tresh - */ - {"UltraPad", "UD", 0, 0, 250, 20}, - /* - * { "Intuos" , "GD", 0, 0, 0, 20 }, not supported - */ - {"PenPartner", "CT", 0, 0, 0, 20}, - {"Graphire", "ET", 5103, 3711, 0, 20} -}; - -int M_wacom(Gpm_Event * state, unsigned char *data) -{ - static int ox = -1, oy; - - int x, y; - - int macro = 0; /* macro buttons from tablet */ - - /* - * Bit [0]&64 seems to have different meanings - graphire: inside of active - * area; Ultrapad: Pen in proximity (means: pen detected) Penpartner: no - * idea... this may be of worth sometimes, but for now, we can say, that if - * the graphire tells us that we are in the active area, we can tell also - * that the graphire has the pen in proximity. - */ - - if(!(data[0] & 64)) { /* Tool not in proximity or out of active area */ - /* - * handle Ultrapad macro buttons, if we get a packet without proximity - * bit but with the buttonflag set, we know that we have a macro event - */ - if(IsA(UltraPad)) { - if(data[0] & 8) { /* here: macro button has been pressed */ - if(data[3] & 8) - macro = (data[6]); - if(data[3] & 16) - macro = (data[6]) + 12; - if(data[3] & 32) - macro = (data[6]) + 24; /* rom-version >= 1.3 */ - - state->modifiers = macro; - /* - * Here we simulate the middle mousebutton - */ - /* - * with ultrapad Eprom Version 1.2 - */ - /* - * WHY IS THE FOLLOWING CODE DISABLE ? FIXME - * gpm_report(GPM_PR_INFO,GPM_MESS_WACOM_MACRO, macro); if - * (macro==12) state->buttons = GPM_B_MIDDLE; - */ - } /* end if macrobutton pressed */ - } - /* - * end if ultrapad - */ - if(!IsA(UltraPad)) { /* Tool out of active area */ - ox = -1; - state->buttons = 0; - state->dx = state->dy = 0; - } - - return 0; /* nothing more to do so leave */ - } - /* - * end if Tool out of active area - */ - x = (((data[0] & 0x3) << 14) + (data[1] << 7) + data[2]); - y = (((data[3] & 0x3) << 14) + (data[4] << 7) + data[5]); - - if(WacomAbsoluteWanted) { /* Absolute Mode */ - if(x > wmaxx) - x = wmaxx; - if(x < 0) - x = 0; - if(y > wmaxy) - y = wmaxy; - if(y < 0) - y = 0; - state->x = (x * win.ws_col / wmaxx); - state->y = (y * win.ws_row / wmaxy); - - realposx = (x / wmaxx); /* this two lines come from the summa driver. */ - realposy = (y / wmaxy); /* they seem to be buggy (always give zero). */ - - } else { /* Relative Mode */ - /* - * Treshold; if greather then treat tool as first time in proximity - */ - if(abs(x - ox) > (wmaxx / wcmodell[WacomModell].treshold) - || abs(y - oy) > (wmaxy / wcmodell[WacomModell].treshold)) - ox = x; - oy = y; - - state->dx = - (x - ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold); - state->dy = - (y - oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold); - } - - ox = x; - oy = y; - - state->buttons = /* for Ultra-Pad and graphire */ - !!(data[3] & 8) * GPM_B_LEFT + !!(data[3] & 16) * GPM_B_RIGHT + !!(data[3] & 32) * GPM_B_MIDDLE; /* UD: - * rom-version - * >=1.3 - */ - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/wacom.h b/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/wacom.h deleted file mode 100644 index a82b4e90..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wacom/wacom.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_WACOM_H -#define _GPM_WACOM_H - -struct WC_MODELL { - char name[15]; - char magic[3]; - int maxX; - int maxY; - int border; - int treshold; -}; - -extern int WacomModell; -extern int WacomAbsoluteWanted; -extern int wmaxx; -extern int wmaxy; -extern char upmbuf[25]; - -extern struct WC_MODELL wcmodell[3]; - -#define IsA(m) ((WacomModell==(-1))? 0:!strcmp(#m,wcmodell[WacomModell].name)) - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wp/i.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/wp/i.c deleted file mode 100644 index a786c5ba..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wp/i.c +++ /dev/null @@ -1,107 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ - -#include "types.h" /* Gpm_type */ - -extern int wizardpad_width; - -extern int wizardpad_height; - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -Gpm_Type *I_wp(int fd, unsigned short flags, struct Gpm_Type *type, int argc, - char **argv) -{ - struct termios tty; - - char tablet_info[256]; - - int count, pos, size; - - flags = argc = 0; /* FIXME: 1.99.13 */ - argv = NULL; - - /* - * Set speed to 9600bps (copied from I_summa, above :) - */ - tcgetattr(fd, &tty); - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - tty.c_cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL; - tcsetattr(fd, TCSAFLUSH, &tty); - - /* - * Reset the tablet (':') and put it in remote mode ('S') so that it isn't - * sending anything to us. - */ - write(fd, ":S", 2); - tcsetattr(fd, TCSAFLUSH, &tty); - - /* - * Query the model of the tablet - */ - write(fd, "T", 1); - sleep(1); - count = read(fd, tablet_info, 255); - - /* - * The tablet information should start with "KW" followed by the rest of the - * model number. If it isn't there, it probably isn't a WizardPad. - */ - if(count < 2) - return NULL; - if(tablet_info[0] != 'K' || tablet_info[1] != 'W') - return NULL; - - /* - * Now, we want the width and height of the tablet. They should be of the - * form "X###" and "Y###" where ### is the number of units of the tablet. - * The model I've got is "X130" and "Y095", but I guess there might be other - * ones sometime. - */ - for(pos = 0; pos < count; pos++) { - if(tablet_info[pos] == 'X' || tablet_info[pos] == 'Y') { - if(pos + 3 < count) { - size = (tablet_info[pos + 1] - '0') * 100 + - (tablet_info[pos + 2] - '0') * 10 + (tablet_info[pos + 3] - '0'); - if(tablet_info[pos] == 'X') { - wizardpad_width = size; - } else { - wizardpad_height = size; - } - } - } - } - - /* - * Set the tablet to stream mode with 180 updates per sec. ('O') - */ - write(fd, "O", 1); - - return type; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wp/m.c b/software/gpm/browse_source/gpm-1.99.7/src/drivers/wp/m.c deleted file mode 100644 index 0a6c9fb0..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/drivers/wp/m.c +++ /dev/null @@ -1,54 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "types.h" /* Gpm_type */ -#include "daemon.h" /* which_mouse */ -#include "mice.h" /* REALPOS */ - -/* Genius Wizardpad tablet -- Matt Kimball (mkimball@xmission.com) */ -int wizardpad_width = -1; - -int wizardpad_height = -1; - -int M_wp(Gpm_Event * state, unsigned char *data) -{ - int x, y, pressure; - - x = ((data[4] & 0x1f) << 12) | ((data[3] & 0x3f) << 6) | (data[2] & 0x3f); - state->x = x * win.ws_col / (wizardpad_width * 40); - realposx = x * 16383 / (wizardpad_width * 40); - - y = ((data[7] & 0x1f) << 12) | ((data[6] & 0x3f) << 6) | (data[5] & 0x3f); - state->y = win.ws_row - y * win.ws_row / (wizardpad_height * 40) - 1; - realposy = 16383 - y * 16383 / (wizardpad_height * 40) - 1; - - pressure = ((data[9] & 0x0f) << 4) | (data[8] & 0x0f); - - state->buttons = - (pressure >= 0x20) * GPM_B_LEFT + !!(data[1] & 0x02) * GPM_B_RIGHT + - /* - * the 0x08 bit seems to catch either of the extra buttons... - */ - !!(data[1] & 0x08) * GPM_B_MIDDLE; - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/check_no_argv.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/check_no_argv.c deleted file mode 100644 index d645fce7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/check_no_argv.c +++ /dev/null @@ -1,37 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* NULL */ -#include "mice.h" /* daemon internals */ - -/*========================================================================*/ - -/* Provide a common error engine by parsing with an empty option-set */ - -/*========================================================================*/ -int check_no_argv(int argc, char **argv) -{ - static argv_helper optioninfo[] = { - {"", ARGV_END, {NULL}, 0} - }; - return parse_argv(optioninfo, argc, argv); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/getsym.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/getsym.c deleted file mode 100644 index c19fbf9f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/getsym.c +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include "daemon.h" - -/* routine to convert digits from octal notation (Andries Brouwer) */ -int getsym(const unsigned char *p0, unsigned char *res) -{ - const unsigned char *p = p0; - - char c; - - c = *p++; - if(c == '\\' && *p) { - c = *p++; - if(isodigit(c)) { - c -= '0'; - if(isodigit(*p)) - c = 8 * c + (*p++ - '0'); - if(isodigit(*p)) - c = 8 * c + (*p++ - '0'); - } - } - *res = c; - return (p - p0); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/isodigit.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/isodigit.c deleted file mode 100644 index 4c62164d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/isodigit.c +++ /dev/null @@ -1,26 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -int isodigit(const unsigned char c) -{ - return ((c & ~7) == '0'); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/limit_delta.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/limit_delta.c deleted file mode 100644 index 8a0c6263..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/limit_delta.c +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -/*========================================================================*/ - -/* - * When repeating, it is important not to try to repeat more bits of dx and - * dy than the protocol can handle. Otherwise, you may end up repeating the - * low bits of a large value, which causes erratic motion. - */ - -/*========================================================================*/ - -int limit_delta(int delta, int min, int max) -{ - return delta > max ? max : delta < min ? min : delta; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/m_listtypes.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/m_listtypes.c deleted file mode 100644 index cd0bf473..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/m_listtypes.c +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "types.h" /* Gpm_type */ -#include "message.h" /* texts */ -#include "daemon.h" /* mice */ - -int M_listTypes(void) -{ - Gpm_Type *type; - - printf(GPM_MESS_VERSION "\n"); - printf(GPM_MESS_AVAIL_MYT); - for(type = mice; type->fun; type++) - printf(GPM_MESS_SYNONYM, type->repeat_fun ? '*' : ' ', - type->name, type->desc, type->synonyms); - - putchar('\n'); - - return 1; /* to exit() */ -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/option_modem_lines.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/option_modem_lines.c deleted file mode 100644 index e330d510..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/option_modem_lines.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "message.h" /* messaging in gpm */ -#include "mice.h" /* daemon internals */ -#include "daemon.h" /* option */ - -/*========================================================================*/ - -/* Parse the "old" -o options */ - -/*========================================================================*/ -int option_modem_lines(int fd, int argc, char **argv) -{ - static int err, lines, reallines; - - static argv_helper optioninfo[] = { - {"dtr", ARGV_BOOL, u: {iptr: &lines}, value:TIOCM_DTR}, - {"rts", ARGV_BOOL, u: {iptr: &lines}, value:TIOCM_RTS}, - {"both", ARGV_BOOL, u: {iptr: &lines}, value:TIOCM_DTR | TIOCM_RTS}, - {"", ARGV_END, u: {iptr:&lines}, 0} - }; - - if(argc < 2) - return 0; - if(argc > 2) { - gpm_report(GPM_PR_ERR, GPM_MESS_TOO_MANY_OPTS, option.progname, argv[0]); - errno = EINVAL; /* used by gpm_oops(), if the caller reports - * failure */ - return -1; - } - err = parse_argv(optioninfo, argc, argv); - if(err) - return 0; /* a message has been printed, but go on as - * good */ - - /* - * ok, move the lines - */ - ioctl(fd, TIOCMGET, &reallines); - reallines &= ~lines; - ioctl(fd, TIOCMSET, &reallines); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/parse_argv.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/parse_argv.c deleted file mode 100644 index 97f9ebee..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/parse_argv.c +++ /dev/null @@ -1,106 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* str* */ -#include /* isalnum */ -#include /* fprintf */ -#include /* strtol */ - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int parse_argv(argv_helper * info, int argc, char **argv) -{ - int i, j = 0, errors = 0; - - long l; - - argv_helper *p; - - char *s, *t; - - int base = 0; /* for strtol */ - - for(i = 1; i < argc; i++) { - for(p = info; p->type != ARGV_END; p++) { - j = strlen(p->name); - if(strncmp(p->name, argv[i], j)) - continue; - if(isalnum(argv[i][j])) - continue; - break; - } - if(p->type == ARGV_END) { /* not found */ - fprintf(stderr, "%s: Uknown option \"%s\" for pointer \"%s\"\n", - option.progname, argv[i], argv[0]); - errors++; - continue; - } - /* - * Found. Look for trailing stuff, if any - */ - s = argv[i] + j; - while(*s && isspace(*s)) - s++; /* skip spaces */ - if(*s == '=') - s++; /* skip equal */ - while(*s && isspace(*s)) - s++; /* skip other spaces */ - - /* - * Now parse what s is - */ - switch (p->type) { - case ARGV_BOOL: - if(*s) { - gpm_report(GPM_PR_ERR, GPM_MESS_OPTION_NO_ARG, option.progname, - p->name, s); - errors++; - } - *(p->u.iptr) = p->value; - break; - - case ARGV_DEC: - base = 10; /* and fall through */ - case ARGV_INT: - l = strtol(s, &t, base); - if(*t) { - gpm_report(GPM_PR_ERR, GPM_MESS_INVALID_ARG, option.progname, s, - p->name); - errors++; - break; - } - *(p->u.iptr) = (int) l; - break; - - case ARGV_STRING: - *(p->u.sptr) = strdup(s); - break; - - case ARGV_END: /* let's please "-Wall" */ - break; - } - } /* for i in argc */ - if(errors) - gpm_report(GPM_PR_ERR, GPM_MESS_CONT_WITH_ERR, option.progname); - return errors; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/read_mouse_id.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/read_mouse_id.c deleted file mode 100644 index 9c9f9b68..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/read_mouse_id.c +++ /dev/null @@ -1,44 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* read/write */ -#include "mice.h" /* Gpm_type */ - -/* - * Sends the SEND_ID command to the ps2-type mouse. - * Return one of GPM_AUX_ID_... - */ -int read_mouse_id(int fd) -{ - unsigned char c = GPM_AUX_SEND_ID; - - unsigned char id; - - write(fd, &c, 1); - read(fd, &c, 1); - if(c != GPM_AUX_ACK) { - return (GPM_AUX_ID_ERROR); - } - read(fd, &id, 1); - - return (id); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/setspeed.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/setspeed.c deleted file mode 100644 index 5d156ebe..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/setspeed.c +++ /dev/null @@ -1,91 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* termios */ -#include /* usleep, write */ - -int setspeed(int fd, int old, int new, int needtowrite, unsigned short flags) -{ - struct termios tty; - - char *c; - - tcgetattr(fd, &tty); - - tty.c_iflag = IGNBRK | IGNPAR; - tty.c_oflag = 0; - tty.c_lflag = 0; - tty.c_line = 0; - tty.c_cc[VTIME] = 0; - tty.c_cc[VMIN] = 1; - - switch (old) { - case 19200: - tty.c_cflag = flags | B19200; - break; - case 9600: - tty.c_cflag = flags | B9600; - break; - case 4800: - tty.c_cflag = flags | B4800; - break; - case 2400: - tty.c_cflag = flags | B2400; - break; - case 1200: - default: - tty.c_cflag = flags | B1200; - break; - } - - tcsetattr(fd, TCSAFLUSH, &tty); - - switch (new) { - case 19200: - c = "*r"; - tty.c_cflag = flags | B19200; - break; - case 9600: - c = "*q"; - tty.c_cflag = flags | B9600; - break; - case 4800: - c = "*p"; - tty.c_cflag = flags | B4800; - break; - case 2400: - c = "*o"; - tty.c_cflag = flags | B2400; - break; - case 1200: - default: - c = "*n"; - tty.c_cflag = flags | B1200; - break; - } - - if(needtowrite) - write(fd, c, 2); - usleep(100000); - tcsetattr(fd, TCSAFLUSH, &tty); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/generic/write_to_mouse.c b/software/gpm/browse_source/gpm-1.99.7/src/generic/write_to_mouse.c deleted file mode 100644 index fc3566c4..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/generic/write_to_mouse.c +++ /dev/null @@ -1,55 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* usleep */ -#include /* tcflush */ - -#include "mice.h" /* ‘GPM_AUX_ACK’ */ - -/** - * Writes the given data to the ps2-type mouse. - * Checks for an ACK from each byte. - * - * Returns 0 if OK, or >0 if 1 or more errors occurred. - */ -int write_to_mouse(int fd, unsigned char *data, size_t len) -{ - unsigned int i; - - int error = 0; - - for(i = 0; i < len; i++) { - unsigned char c; - - write(fd, &data[i], 1); - read(fd, &c, 1); - if(c != GPM_AUX_ACK) - error++; - } - - /* - * flush any left-over input - */ - usleep(30000); - tcflush(fd, TCIFLUSH); - return (error); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/daemon.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/daemon.h deleted file mode 100644 index 0e803a2d..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/daemon.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Daemon internals - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_DAEMON_H -#define _GPM_DAEMON_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include "types.h" /* Internal types */ -#include /* fd_set */ - -/************************************************************************* - * Macros - */ - -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* for adding a mouse; add_mouse */ -#define GPM_ADD_DEVICE 0 -#define GPM_ADD_TYPE 1 -#define GPM_ADD_OPTIONS 2 - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - - - -/************************************************************************* - * Global variables - */ - -extern char *opt_lut; -extern char *opt_special; - -extern int opt_resize; /* not really an option */ -extern time_t opt_age_limit; -extern struct options option; /* one should be enough for us */ -extern int mouse_argc[3]; /* 0 for default (unused) */ -extern char **mouse_argv[3]; /* and two mice */ - -extern int opt_aged, - opt_ptrdrag, - opt_test, - opt_double; - - -extern int statusX, - statusY, - statusB, - statusC; /* clicks */ -extern int fifofd; -extern int opt_rawrep; -extern int maxx, - maxy; - - -extern fd_set selSet, - readySet, - connSet; -extern int eventFlag; -extern struct winsize win; - -extern Gpm_Cinfo *cinfo[MAX_VC+1]; - -extern struct mouse_features mouse_table[3], - *which_mouse; /*the current one*/ - -extern Gpm_Type mice[]; -extern Gpm_Type *repeated_type; - -time_t last_selection_time; - - -/************************************************************************* - * Functions - */ - -char **build_argv(char *argv0, char *str, int *argcptr, char sep); - -void disable_paste(int vc); - -int do_client(Gpm_Cinfo *cinfo, Gpm_Event *event); -int do_selection(Gpm_Event *event); - -void get_console_size(Gpm_Event *ePtr); -int get_data(Gpm_Connect *where, int whence); -unsigned char *getMouseData(int fd, Gpm_Type *type, int kd_mode); -int getsym(const unsigned char *p0, unsigned char *res); - -void gpm_exited(void); -void gpm_killed(int signo); - -int isodigit(const unsigned char c); - -int limit_delta(int delta, int min, int max); - -int open_console(const int mode); -int old_main(); - -int processConn(int fd); -int processMouse(int fd, Gpm_Event *event, int kd_mode); -int processRequest(Gpm_Cinfo *ci, int vc); -int processSpecial(Gpm_Event *event); - -void selection_copy(int x1, int y1, int x2, int y2, int mode); -void selection_paste(void); - -void startup(int argc, char **argv); - - -int wait_text(int *fdptr); - -/* meta-mouse functions */ -void add_mouse (int type, char *value); -int init_mice (struct micetab *micelist); -int reset_mice(struct micetab *micelist); - -/* gpn.c */ -void cmdline(int argc, char **argv); -int giveInfo(int request, int fd); -int loadlut(char *charset); -int usage(char *whofailed); -struct Gpm_Type *find_mouse_by_name(char *name); -void check_uniqueness(void); -void check_kill(void); - -/* gpm.c */ -int old_main(); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm-proto.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm-proto.h deleted file mode 100644 index fe53a6c3..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm-proto.h +++ /dev/null @@ -1,121 +0,0 @@ - -#ifndef __GPMPROTO_H__ -#define __GPMPROTO_H__ - -/* - * This is a draft for a protocol to use for a "generic input device" - * that can feed packets to gpm. In general, this "generic input - * device" will be a program that collects data from whatever source - * fits its scope and pushes packet to gpm for handling. The same - * protocol may be used to get events into X. My main motivation for - * this is exploiting my screenless touchscreen to do handwriting - * recognition and other silly stuff. - * - * While it may look complex, I think it's in fact easy; also, it - * fits the fixed-size contraint that simplifies data transfer, features - * aligned data items and does not pose any limit on the number of - * axis/buttons/keys delivered with each packet. It can be - * implemented slowly and each functionality can be verified in real - * usage. It should be extensible enough to be pretty long-lived. - * - * Please note that I don't know of any similar effort, so I may just - * be reinventing the wheel or doing some other stupid errors. - * - * Please note that timestamping is still missing, although it should - * fit the design (just forgot about it, and the joystick api reminded - * me about that). - */ - -/* - * This is the fixed-size packet, multi-byte fields use the network - * byte order, so ntohl() and ntohs() are needed, but portability is - * ensured. Note that it is 16 bytes, 4 of them are "control" info and - * the rest is three 4-bytes data items. - */ - -struct gpm_procotol_packet { - __u8 flags; /* 10xxxxFF flags defined later */ - __u8 buttons; /* 01BBBBBB button-1 to button-6 */ - __u16 key; /* how to read the following data */ - union { - __u32 l; /* "long" */ - __s32 sl; /* "signed long" */ - __u16 w[2]; /* "word" */ - __s16 sw[2]; /* "signed word" */ - __u8 b[4]; /* "byte" */ - __s8 sb[4]; /* "signed byte" */ - } data[3]; -}; - -/* - * these flags can be used to build up longer packets (thus placing no limit - * on the number of dimensions, buttons, keypresses per packet). A complete - * packet has both flags set, otherwise other packets must be retrieved to - * have all the information available. Most "simple" input devices will - * just need one chunk of data (it offers three dimensions and 6 buttons) - */ -#define GPM_PROTOCOL_FLAG_FIRST 0x01 -#define GPM_PROTOCOL_FLAG_LAST 0x02 - -/* - * The "key" field is made up of three bitfields, each defines what the - * corresponfing "data" item means. There are 15 meanings for each datum, - * and the top four bits are currently unused and must be cleared. - */ -enum gpm_protocol_item { - GPM_ITEM_UNUSED = 0, /* the data field is unused */ - GPM_ITEM_RAXIS, /* relative X, Y, Z or further (signed long) */ - GPM_ITEM_AAXIS, /* absolute axis (unsigned long, full-range) */ - GPM_ITEM_BUTTONS, /* 32 buttons (7-38, 39-70, ...) as u32 mask */ - GPM_ITEM_8BITKEYS, /* ascii or so, as u8. 0xff == unused */ - GPM_ITEM_KEYCODES, /* keycodes as s16: pos/neg, 0x8000 == unused */ - GPM_ITEM_KEYSYM, /* X keysym. positive/negative (?) as s32 */ - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED, - GPM_ITEM_RESERVED -}; - -/* - RAXIS: relative position. First axis is X, then Y, then Z and so - on. Use of third-and-further axis is application - specific. As for scaling, I think every motion must be - rescaled, and a mouse tick may be 1/1024 of the whole - screen or so, but I'm not sure about that. If it is not - rescaled to match absolute movements, then you can't mix - relative and absolute movements, something that I want - to be able to do. - - AAXIS: absolute position on an axis, scaled to the whole 32bit - range. - - BUTTONS: if more than 6 buttons are there, a data field can host - 32 extra buttons. If 38 are not enough other data fields - can follow. If the complete packet is made up by more - than one protocol item, the "buttons" field of trailing - items is unused. Use of the buttons is application - specific. - - 8BITKEYS: One to four ascii-or-so keys to push in the keyboard buffer. - This is needed by the twiddler, for example. I have to study - how the X protocol works before I can use this in X. - - KEYCODES: Raw keyboard keycodes. I feel these must be discouraged, as - users remap their keyboards (although smart use of dumpkeys - can unmap the keycodes properly). Positive for press and - negative for release; up to two keycodes can fit in one - data item - - KEYSYM: X keysym. (range 0 to 0xFFFFFF). Once again, I have to study X, - but I think there is no need for press/release events. Each - data item can host a single keysym as they span 24 bits - -*/ - - -#endif /* __GPM_PROTO_H__ */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm.h deleted file mode 100644 index 1d73ece5..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm.h +++ /dev/null @@ -1,301 +0,0 @@ -/* -*-mode:C;tab-width:3-*- - * gpm.h - public include file for gpm - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 1998 Ian Zimmerman - * Copyright 2002-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPM_H_ -#define _GPM_H_ - -#include /* _PATH_VARRUN etc. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*....................................... Xtermish stuff */ - -#define GPM_XTERM_ON \ - printf("%c[?1001s",27), fflush(stdout), /* save old hilit tracking */ \ - printf("%c[?1000h",27), fflush(stdout) /* enable mouse tracking */ - -#define GPM_XTERM_OFF \ - printf("%c[?1000l",27), fflush(stdout), /* disable mouse tracking */ \ - printf("%c[?1001r",27), fflush(stdout) /* restore old hilittracking */ - -/*....................................... Cfg pathnames */ - -/* Provide trailing slash, since mostly used for building pathnames. */ - -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/var/run/" -#endif - -#ifndef _PATH_DEV -#define _PATH_DEV "/dev/" -#endif - -#define GPM_NODE_DIR _PATH_VARRUN - -/* itz Wed Jul 1 11:56:46 PDT 1998 this definitely ought not to be - world-writable; umask doesn't apply either, as gpm is most often - run from init */ - -#define GPM_NODE_DIR_MODE 0775 - -#define GPM_NODE_PID GPM_NODE_DIR "gpm.pid" -#define GPM_NODE_DEV _PATH_DEV "gpmctl" - -/* itz Wed Jul 1 12:09:29 PDT 1998 let's simplify this by placing the - file always in /dev whether it's a device or socket. It doesn't - really belong to /var/run anyway. */ - -#define GPM_NODE_CTL GPM_NODE_DEV -#define GPM_NODE_FIFO _PATH_DEV "gpmdata" - -/*....................................... Cfg buttons */ -/* Each button has one bit in the 16 bit buttons field. - * Mouse movement and wheel movement are not associated with a button - * i.e. buttons=GPM_B_NONE in these cases - * (except for ms3 mouse, for reasons unknown?) - * The middle button if pressed down (or clicked) is independent of - * the wheel "device" which it happens to be associated with - * The use of GPM_B_UP/DOWN with ms3 is unclear. Maybe the wheel - * could be rolled forward then backward - * and this would generate a 'click' event on 'button 5' GPM_B_UP, - * but really the expected behaviour of wheel is movement, typically - * used for jump scrolling or for jumping between fields on a form. */ - -#define GPM_B_DOWN 32 -#define GPM_B_UP 16 -#define GPM_B_FOURTH 8 -#define GPM_B_LEFT 4 -#define GPM_B_MIDDLE 2 -#define GPM_B_RIGHT 1 -#define GPM_B_NONE 0 - -/*................................... Strange requests (iff conn->pid==0)*/ - -#define GPM_REQ_SNAPSHOT 0 -#define GPM_REQ_BUTTONS 1 -#define GPM_REQ_CONFIG 2 -#define GPM_REQ_NOPASTE 3 - -/*....................................... The event types */ - -enum Gpm_Etype { - GPM_MOVE=1, - GPM_DRAG=2, /* exactly one of the bare ones is active at a time */ - GPM_DOWN=4, - GPM_UP= 8, - -#define GPM_BARE_EVENTS(type) ((type)&(0x0f|GPM_ENTER|GPM_LEAVE)) - - GPM_SINGLE=16, /* at most one in three is set */ - GPM_DOUBLE=32, - GPM_TRIPLE=64, /* WARNING: I depend on the values */ - - GPM_MFLAG=128, /* motion during click? */ - GPM_HARD=256, /* if set in the defaultMask, force an already - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ - GPM_LEAVE=1024 /* leave event, used in Roi's */ -}; - -#define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnySingle(type) ((type)&GPM_SINGLE) -#define Gpm_StrictDouble(type) (((type)&GPM_DOUBLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyDouble(type) ((type)&GPM_DOUBLE) -#define Gpm_StrictTriple(type) (((type)&GPM_TRIPLE) && !((type)&GPM_MFLAG)) -#define Gpm_AnyTriple(type) ((type)&GPM_TRIPLE) - -/*....................................... The event data structure */ - -enum Gpm_Margin {GPM_TOP=1, GPM_BOT=2, GPM_LFT=4, GPM_RGT=8}; - -/*....................................... The reported event */ - -typedef struct Gpm_Event { - - unsigned char buttons, modifiers; /* try to be a multiple of 4 */ - unsigned short vc; - - /* displacement x,y for this event, and absolute x,y */ - short dx, dy, x, y; - enum Gpm_Etype type; - - /* clicks e.g. double click are determined by time-based processing */ - int clicks; - - - /* FIXME: this seems to be unused. if so, remove it */ - enum Gpm_Margin margin; - - /* wdx/y: displacement of wheels in this event. Absolute values are not - * required, because wheel movement is typically used for scrolling - * or selecting fields, not for cursor positioning. The application - * can determine when the end of file or form is reached, and not - * go any further. - * A single mouse will use wdy, "vertical scroll" wheel. */ - short wdx, wdy; - -} Gpm_Event; - -/*....................................... The handling function */ - -typedef int Gpm_Handler(Gpm_Event *event, void *clientdata); - -/*....................................... The connection data structure */ - -#define GPM_MAGIC 0x47706D4C /* "GpmL" */ -typedef struct Gpm_Connect { - unsigned short eventMask, defaultMask; - unsigned short minMod, maxMod; - int pid; - int vc; -} Gpm_Connect; - -/*....................................... The region of Interest */ - -typedef struct Gpm_Roi { - short xMin,xMax; - short yMin,yMax; - unsigned short minMod, maxMod; - unsigned short eventMask; - unsigned short owned; - Gpm_Handler *handler; - void *clientdata; - struct Gpm_Roi *prev; - struct Gpm_Roi *next; -} Gpm_Roi; - - -/*....................................... Global variables for the client */ - -extern int gpm_flag, gpm_ctlfd, gpm_fd, gpm_hflag, gpm_morekeys; - -extern int gpm_zerobased; -extern int gpm_visiblepointer; -extern int gpm_mx, gpm_my; /* max x and y to fit margins */ -extern struct timeval gpm_timeout; - -extern unsigned char _gpm_buf[]; -extern unsigned short * _gpm_arg; - -extern Gpm_Handler *gpm_handler; -extern void *gpm_data; - -extern Gpm_Handler *gpm_roi_handler; -extern void *gpm_roi_data; - -extern Gpm_Roi *gpm_roi; -extern Gpm_Roi *gpm_current_roi; - - -/*....................................... Prototypes for the client */ -/* all of them return 0 or errno */ - -#include /* needed to get FILE */ -#include /* to get the prototype for ioctl() */ - -/* liblow.c */ -extern int Gpm_Open(Gpm_Connect *, int); -extern int Gpm_Close(void); -extern int Gpm_GetEvent(Gpm_Event *); -extern int Gpm_CharsQueued(void); -extern int Gpm_Getc(FILE *); -#define Gpm_Getchar() Gpm_Getc(stdin) -extern int Gpm_Repeat(int millisec); -extern int Gpm_FitValuesM(int *x, int *y, int margin); -#define Gpm_FitValues(x,y) Gpm_FitValuesM((x),(y),-1); -#define Gpm_FitEvent(ePtr) \ - do { \ - int _x, _y; \ - if ((ePtr)->margin && ((ePtr)->type&(GPM_DRAG | GPM_UP))) \ - { \ - _x = (ePtr)->x; \ - _y = (ePtr)->y; \ - Gpm_FitValuesM(&_x, &_y, (ePtr)->margin); \ - (ePtr)->x = _x; \ - (ePtr)->y = _y; \ - } \ - } while(0) \ - - -/* the following is a (progn ...) form */ - -#define Gpm_DrawPointer(x, y, fd) \ - (_gpm_buf[sizeof(short)-1] = 2, \ - _gpm_arg[0] = _gpm_arg[2] = \ - (unsigned short)(x)+gpm_zerobased, \ - _gpm_arg[1] = _gpm_arg[3] = \ - (unsigned short)(y)+gpm_zerobased, \ - _gpm_arg[4] = (unsigned short)3, \ - ioctl(fd, TIOCLINUX, _gpm_buf+sizeof(short)-1)) - -/* the following is a heavy thing ... */ -extern int gpm_consolefd; /* liblow.c */ - -/* #define GPM_DRAWPOINTER(event) \ - * ((gpm_consolefd=open("/dev/console",O_RDWR))>=0 && \ - * Gpm_DrawPointer((event)->x,(event)->y,gpm_consolefd), \ - * close(gpm_consolefd)) - */ - -#define GPM_DRAWPOINTER(ePtr) \ - (Gpm_DrawPointer((ePtr)->x,(ePtr)->y,gpm_consolefd)) - - - -/* libhigh.c */ - -Gpm_Handler Gpm_HandleRoi; -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler *fun, void *xtradata); -Gpm_Roi * Gpm_PopRoi(Gpm_Roi *which); -Gpm_Roi * Gpm_RaiseRoi(Gpm_Roi *which, Gpm_Roi *before); -Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); - - -/* libcurses.c */ -/* #include Hmm... seems risky */ - -extern int Gpm_Wgetch(); -#define Gpm_Getch() (Gpm_Wgetch(NULL)) - -/* libxtra.c */ -char *Gpm_GetLibVersion(int *where); -char *Gpm_GetServerVersion(int *where); -int Gpm_GetSnapshot(Gpm_Event *ePtr); - -/* tools.c: do they really need to be exported? Can't we keep them in gpmInt.h ? */ -char *Gpm_get_console( void ); -int Gpm_x_high_y(int base, int pot_y); -int Gpm_cnt_digits(int number); -void gpm_oops(int line, char *file, char *text, ... ); - -/* report.c / report-lib.c */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -#ifdef __cplusplus - }; -#endif - -#endif /* _GPM_H_ */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm2-import.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm2-import.h deleted file mode 100644 index 9ca1ae0b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm2-import.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - * Import stuff from gpm2 - */ - -#ifndef _GPM2_IMPORT_H -#define _GPM2_IMPORT_H - -int become_daemon(); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm2-messages.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm2-messages.h deleted file mode 120000 index a98db912..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpm2-messages.h +++ /dev/null @@ -1 +0,0 @@ -gpm-1.99.7/../../gpm2/include/gpm2-messages.h \ No newline at end of file diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpmCfg.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/gpmCfg.h deleted file mode 100644 index 5d96a8f1..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpmCfg.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * gpm-Linux configuration file (server only) - * - * Copyright 1994-1996 rubini@linux.it - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#ifndef _GPMCFG_INCLUDED -#define _GPMCFG_INCLUDED - -#define GPM_NAME "gpm" -#define GPM_DATE "May 2002" - -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* FIXME: still needed ?? */ -/* How many virtual consoles are managed? */ -#ifndef MAX_NR_CONSOLES -# define MAX_NR_CONSOLES 64 /* this is always sure */ -#endif - -#define MAX_VC MAX_NR_CONSOLES /* doesn't work before 1.3.77 */ - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* all the default values */ -#define DEF_TYPE "ms" -#define DEF_DEV NULL /* use the type-related one */ -#define DEF_LUT "-a-zA-Z0-9_./\300-\326\330-\366\370-\377" -#define DEF_SEQUENCE "123" /* how buttons are reordered */ -#define DEF_CALIB NULL /* don't load calibration data */ -#define DEF_BAUD 1200 -#define DEF_SAMPLE 100 -#define DEF_DELTA 25 -#define DEF_ACCEL 2 -#define DEF_SCALE 10 -#define DEF_TIME 250 /* time interval (ms) for multiple clicks */ -#define DEF_THREE 0 /* have three buttons? */ -#define DEF_KERNEL 0 /* no kernel module, by default */ - -#define DEF_DMINX 0 -#define DEF_DMAXX 1 -#define DEF_DMINY 0 -#define DEF_DMAXY 1 - -#define DEF_OMINX 0 -#define DEF_OMAXX 1 -#define DEF_OMINY 0 -#define DEF_OMAXY 1 - -/* 10 on old computers (<=386), 0 on current machines */ -#define DEF_CLUSTER 0 /* maximum number of clustered events */ - -#define DEF_TEST 0 -#define DEF_PTRDRAG 1 /* double or triple click */ -#define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */ - -#endif /* _GPMCFG_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpmInt.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/gpmInt.h deleted file mode 100644 index 05ed6341..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/gpmInt.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * gpmInt.h - server-only stuff for gpm - * - * Copyright (C) 1994-1999 Alessandro Rubini - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - ********/ - -#ifndef _GPMINT_INCLUDED -#define _GPMINT_INCLUDED - -#include /* time_t */ /* for whom ???? FIXME */ - -#include "gpm.h" - -#if !defined(__GNUC__) -# define inline -#endif - -/*....................................... old gpmCfg.h */ -/* timeout for the select() syscall */ -#define SELECT_TIME 86400 /* one day */ - -#ifdef HAVE_LINUX_TTY_H -#include -#endif - -/* How many buttons may the mouse have? */ -/* #define MAX_BUTTONS 3 ===> not used, it is hardwired :-( */ - -/* misc :) */ -#define GPM_NULL_DEV "/dev/null" -#define GPM_SYS_CONSOLE "/dev/console" -#define GPM_DEVFS_CONSOLE "/dev/vc/0" -#define GPM_OLD_CONSOLE "/dev/tty0" - -/*....................................... Structures */ - -// looks unused; delete -//typedef struct Opt_struct_type {int a,B,d,i,p,r,V,A;} Opt_struct_type; - -/* the other variables */ - -extern int opt_kill; -extern int opt_kernel, opt_explicittype; -extern int opt_aged; -extern time_t opt_age_limit; - -/*....................................... Prototypes */ - - /* mice.c */ -extern int M_listTypes(void); - /* special.c */ -int processSpecial(Gpm_Event *event); - -/*....................................... Dirty hacks */ - -#undef GPM_USE_MAGIC /* magic token foreach message? */ -#define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0)) /* startup_daemon */ - - -#ifdef GPM_USE_MAGIC -#define MAGIC_P(code) code -#else -#define MAGIC_P(code) -#endif - -#endif /* _GPMINT_INCLUDED */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/message.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/message.h deleted file mode 100644 index b7bbc672..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/message.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * defines used for messaging - * - * Copyright (c) 2001,2002 Nico Schottelius - * - * 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. - */ - -#ifndef _MESSAGE_H -#define _MESSAGE_H - -/* printing / reporting */ -#define FL __LINE__,__FILE__ -#define FLS "[%s(%d)]: " -#define FLP FLS,file,line - -/* for switch (intern) */ -#define GPM_STAT_DEBUG 2 -#define GPM_STAT_INFO 3 -#define GPM_STAT_ERR 4 -#define GPM_STAT_WARN 5 -#define GPM_STAT_OOPS 6 - -/* for print (extern) */ -#define GPM_PR_DEBUG FL,GPM_STAT_DEBUG -#define GPM_PR_INFO FL,GPM_STAT_INFO -#define GPM_PR_ERR FL,GPM_STAT_ERR -#define GPM_PR_WARN FL,GPM_STAT_WARN -#define GPM_PR_OOPS FL,GPM_STAT_OOPS - -/* messages */ -#define GPM_TEXT_INFO "*** info " -#define GPM_TEXT_WARN "*** warning " -#define GPM_TEXT_DEBUG "*** debug " -#define GPM_TEXT_ERR "*** err " -#define GPM_TEXT_OOPS "Ooo.ps(): " - -/* strings */ -#define GPM_STRING_INFO GPM_TEXT_INFO FLP -#define GPM_STRING_WARN GPM_TEXT_WARN FLP -#define GPM_STRING_DEBUG GPM_TEXT_DEBUG FLP -#define GPM_STRING_ERR GPM_TEXT_ERR FLP -#define GPM_STRING_OOPS GPM_TEXT_OOPS FLP - -/* running situations */ -#define GPM_RUN_STARTUP 0 -#define GPM_RUN_DAEMON 1 -#define GPM_RUN_DEBUG 2 - -/* messages */ - -/* info */ -#define GPM_MESS_VERSION "gpm " PACKAGE_VERSION -#define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." -#define GPM_MESS_KILLED "Killed gpm(%d)." -#define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" -#define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" -#define GPM_MESS_NO_MAGIC "No magic" -#define GPM_MESS_CONECT_AT "Connecting at fd %i" -#define GPM_MESS_USAGE "Usage: %s [options]\n" \ - " Valid options are (not all of them are implemented)\n" \ - " -a accel sets the acceleration (default %d)\n" \ - " -A [limit] start with selection disabled (`aged')\n" \ - " -b baud-rate sets the baud rate (default %d)\n" \ - " -B sequence allows changing the buttons (default '%s')\n" \ - " -c calib-file load calibration data for absolute devices from calib-file\n" \ - " -d delta sets the delta value (default %d) (must be 2 or more)\n" \ - " -D debug mode: don't auto-background\n" \ - " -g tap-button sets the button (1-3) that is emulated by tapping on\n" \ - " a glidepoint mouse, none by default. (mman/ps2 only)\n" \ - " -i interval max time interval for multiple clicks (default %i)\n" \ - " -k kill a running gpm, to start X with a busmouse\n" \ - " -l charset loads the inword() LUT (default '%s')\n" \ - " -m mouse-device sets mouse device\n" \ - " -M enable multiple mice. Following options refer to\n" \ - " the second device. Forces \"-R\"\n" \ - " -o options decoder-specific options (e.g.: \"dtr\", \"rts\")\n" \ - " -p draw the pointer while striking a selection\n" \ - " -q quit after changing mouse behaviour\n" \ - " -r number sets the responsiveness (default %i)\n" \ - " -R mouse-type enter repeater mode. X should read /dev/gpmdata\n" \ - " like it was a mouse-type device. Default is MouseSystems.\n" \ - " You can also specify \"raw\" to relay the raw device data.\n" \ - " -s sample-rate sets the sample rate (default %d)\n" \ - " -S [commands] enable special commands (see man page)\n" \ - " -t mouse-type sets mouse type (default '%s')\n" \ - " Use a non-existent type (e.g. \"help\") to get a list\n" \ - " -T test: read mouse, no clients\n" \ - " -v print version and exit\n" \ - " Examples:\n\n" \ - " gpm -m /dev/misc/psaux -t ps2 to start with a ps2 mouse\n" \ - " gpm -m /dev/tts/0 -t mman to use mouse man on COM1\n\n" - -/* Later ... but first when it's running */ -/* " -u autodetect mice [not implemented yet]\n" \ */ - -#define GPM_MESS_IMPS2_AUTO "imps2: Auto-detected intellimouse PS/2" -#define GPM_MESS_IMPS2_PS2 "imps2: Auto-detected standard PS/2" -#define GPM_MESS_AVAIL_MYT "Available mouse types are:\n\n" \ - "r name synonym description\n\n" -#define GPM_MESS_SYNONYM "%c %-8s %s\n Synonyms: %s\n" - -/* generic messages */ -#define GPM_MESS_DOUBLE_S "%s: %s" -#define GPM_MESS_DOUBLE_I "%i - %i:" -#define GPM_MESS_X_Y_VAL "x %i, y %i" - - -/* mem */ -#define GPM_MESS_NO_MEM "I couln't get any memory! I die! :(" -#define GPM_MESS_ALLOC_FAILED "allocation failed!" - -/* files */ -#define GPM_MESS_SOCKET "socket(): %s" -#define GPM_MESS_TEMPNAM "tempnam(): %s" -#define GPM_MESS_OPEN "Could not open %s." -#define GPM_MESS_CREATE_FIFO "Creating FIFO %s failed." -#define GPM_MESS_STALE_PID "Removing stale pid file %s" -#define GPM_MESS_MKSTEMP_FAILED "mkstemp failed with file %s!" -#define GPM_MESS_NOTWRITE "Can you write to %s?" -#define GPM_MESS_WRITE_ERR "write(): %s" -#define GPM_MESS_OPEN_CON "Opening console failed." -#define GPM_MESS_OPEN_SERIALCON "We seem to be on a serial console." -#define GPM_MESS_READ_FIRST "Error in read()ing first: %s" -#define GPM_MESS_READ_REST "Error in read()ing rest: %s" -#define GPM_MESS_REMOVE_FILES "Removing files %s and %s" -#define GPM_MESS_READ_PROB "Problem reading from %s" -#define GPM_MESS_CLOSE "Closing" - -/* error */ -#define GPM_MESS_CANT_KILL "Couldn't kill gpm(%d)!" -#define GPM_MESS_FSTAT "fstat()" -#define GPM_MESS_SETSID_FAILED "Setsid failed" -#define GPM_MESS_CHDIR_FAILED "change directory failed" -#define GPM_MESS_FORK_FAILED "Fork failed." -#define GPM_MESS_VCCHECK "Failed on virtual console check." -#define GPM_MESS_PROT_ERR "Error in protocol" -#define GPM_MESS_ROOT "You should be root to run gpm!" -#define GPM_MESS_SPEC_ERR "Error in the %s specification. Try \"%s -h\".\n" -#define GPM_MESS_ALREADY_RUN "gpm is already running as pid %d" -#define GPM_MESS_NO_REPEAT "Repeating into %s protocol not yet implemented :-(" -#define GPM_MESS_GET_SHIFT_STATE "get_shift_state" -#define GPM_MESS_GET_CONSOLE_STAT "get_console_status" -#define GPM_MESS_DISABLE_PASTE "disabling pasting per request from virtual console (%d)" -#define GPM_MESS_UNKNOWN_FD "Unknown fd selected" -#define GPM_MESS_ACCEPT_FAILED "accept() failed: %s" -#define GPM_MESS_ADDRES_NSOCKET "Address %s not a socket in processConn" -#define GPM_MESS_SOCKET_OLD "Socket too old in processConn" -#define GPM_MESS_GETSOCKOPT "getsockopt(SO_PEERCRED): %s" -#define GPM_MESS_STAT_FAILS "stat on %s fails in processConn" -#define GPM_MESS_NEED_MDEV "Please use -m /dev/mouse -t protocol" -#define GPM_MESS_MOUSE_INIT "mouse initialization failed" -#define GPM_MESS_SOCKET_PROB "socket()" -#define GPM_MESS_BIND_PROB "Problem binding %s" -#define GPM_MESS_SELECT_PROB "Problem with select" -#define GPM_MESS_SELECT_STRING "select(): %s" -#define GPM_MESS_SELECT_TIMES "selected %i times" - -#define GPM_MESS_OPTION_NO_ARG "%s: Option \"%s\" takes no argument: ignoring \"%s\"" -#define GPM_MESS_INVALID_ARG "%s: Invalid arg. \"%s\" to \"%s\"" -#define GPM_MESS_CONT_WITH_ERR "%s: Continuing despite errors in option parsing" -#define GPM_MESS_TOO_MANY_OPTS "%s: Too many options for \"-t %s\"" - -#define GPM_MESS_NETM_NO_ACK "netmouse: No acknowledge (got %d)" -#define GPM_MESS_NETM_INV_MAGIC "netmouse: Invalid reply magic (got %d,%d,%d)" -#define GPM_MESS_WACOM_MACRO "WACOM Macro: %d" -#define GPM_MESS_GUNZE_INV_PACK "gunze: invalid packet \"%s\"" -#define GPM_MESS_MMAN_DETECTED "MouseMan detected" -#define GPM_MESS_INIT_GENI "initializing genitizer" -#define GPM_MESS_WACOM_MOD "WACOM Mode: %c Modell: %s (Answer: %s)" -#define GPM_MESS_IMPS2_INIT "imps2: PS/2 mouse failed init" -#define GPM_MESS_IMPS2_FAILED "imps2: PS/2 mouse failed (3 button) init" -#define GPM_MESS_IMPS2_MID_FAIL "imps2: PS/2 mouse failed to read id, assuming standard PS/2" -#define GPM_MESS_IMPS2_SETUP_FAIL "imps2: PS/2 mouse failed setup, continuing..." -#define GPM_MESS_IMPS2_BAD_ID "imps2: Auto-detected unknown mouse type %d, assuming standard PS/2" -#define GPM_MESS_GUNZE_WRONG_BAUD "%s: %s: wrong baud rate, using 19200" -#define GPM_MESS_GUNZE_CALIBRATE "%s: gunze: calibration data absent or invalid,using defaults" -#define GPM_MESS_TOO_MANY_SPECIAL "%s: too many special functions (max is %i)" -#define GPM_MESS_SYNTAX_1 "%s: %s :%i: Syntax error" -#define GPM_MESS_UNKNOWN_MOD_1 "%s: %s :%i: Unknown modifier \"%s\"" -#define GPM_MESS_INCORRECT_COORDS "%s: %s :%i: Incorrect chord \"%s\"" -#define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" -#define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" -#define GPM_MESS_ELO_CALIBRATE "%s: etouch: calibration file %s absent or invalid, using defaults" - -/* warnings */ -#define GPM_MESS_REQUEST_ON "Request on vc %i > %i" -#define GPM_MESS_FAILED_CONNECT "Failed gpm connect attempt by uid %d for vc %s" -#define GPM_MESS_ZERO_SCREEN_DIM "zero screen dimension, assuming 80x25" -#define GPM_MESS_STRANGE_DATA "Data on strange file descriptor %d" -#define GPM_MESS_RESIZING "%s pid %i is resizing :-)" -#define GPM_MESS_KILLED_BY "%s pid %i killed by a new %s" -#define GPM_MESS_REDEF_COORDS "%s: %s :%i: Warning: Chord \"%s%s%s\" redefined" - -/* IOCTL */ -#define GPM_MESS_IOCTL_KDGETMODE "ioctl(KDGETMODE)" -#define GPM_MESS_IOCTL_TIOCLINUX "ioctl(TIOCLINUX)" -#define GPM_MESS_IOCTL_TIOCSTI "%s: ioctl(TIOCSTI): %s" - -/* debug */ -#define GPM_MESS_PEER_SCK_UID "peer socket uid = %d" -#define GPM_MESS_LONG_STATUS "Pid %i, vc %i, ev %02X, def %02X, minm %02X, maxm %02X" -#define GPM_MESS_SKIP_DATAP "Skipping a data packet: Data %02x %02x %02x %02x" -#define GPM_MESS_KILLING "Trying to kill gpm running at pid %d" - -/* other */ -#define GPM_MESS_SKIP_PASTE "Skipping paste; selection has aged" -#define GPM_EXTRA_DATA "Extra %02x" -#define GPM_MESS_SIGNED "Signed." -#define GPM_MESS_CSELECT "is your kernel compiled with CONFIG_SELECTION on?" -#define GPM_MESS_NOTHING_MORE "Nothing more" -#define GPM_MESS_CON_REQUEST "Request on %i (console %i)" -#define GPM_MESS_SCREEN_SIZE "Screen size: %d - %d" -/* #define GPM_MESS_ "" */ - -/* functions */ -void gpm_report(int line, char *file, int stat, char *text, ... ); - -/* rest of wd.h */ -#ifdef HAVE_SYSLOG_H -#include -#else -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 -#endif - -#endif /* _MESSAGE_H */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/mice.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/mice.h deleted file mode 100644 index 982f1d09..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/mice.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Mice related - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_MICE_H -#define _GPM_MICE_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Event */ -#include "types.h" /* Gpm_Type */ - - -/************************************************************************* - * Macros - */ - -#define STD_FLG (CREAD|CLOCAL|HUPCL) -#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) -#define REALPOS_MAX 16383 /* min 0 max=16383, but due to change. */ - -/*** mouse commands ***/ -#define GPM_AUX_SEND_ID 0xF2 -#define GPM_AUX_ID_ERROR -1 -#define GPM_AUX_ID_PS2 0 -#define GPM_AUX_ID_IMPS2 3 - -/* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ -#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ -#define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ -#define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ -#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ -#define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ -#define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ -#define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ -#define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ -#define GPM_AUX_RESET 0xFF /* Reset aux device */ -#define GPM_AUX_ACK 0xFA /* Command byte ACK. */ - -#define GPM_AUX_BUF_SIZE 2048 /* This might be better divisible by - three to make overruns stay in sync - but then the read function would need - a lock etc - ick */ - -#define GPM_EXTRA_MAGIC_1 0xAA -#define GPM_EXTRA_MAGIC_2 0x55 - -#define abs(value) ((value) < 0 ? -(value) : (value)) - -/************************************************************************* - * Global variables - */ -extern int realposx; -extern int realposy; - - -/************************************************************************* - * Mice functions - */ - -int check_no_argv(int argc, char **argv); -int option_modem_lines(int fd, int argc, char **argv); -int parse_argv(argv_helper *info, int argc, char **argv); -int read_mouse_id(int fd); -int setspeed(int fd,int old,int new,int needtowrite,unsigned short flags); -int write_to_mouse(int fd, unsigned char *data, size_t len); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/synaptics.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/synaptics.h deleted file mode 100644 index 1c4c869f..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/synaptics.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * synaptics.h - support for the synaptics serial and ps2 touchpads - * - * Copyright 1999 hdavies@ameritech.net (Henry Davies - * - * 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. - ********/ - -/* -** Design/Goals -** I want to use the Synaptics Serial touchpad as a cursor device under -** Linux (gpm). With this device I want to support operations similar -** to those supported by the Synaptics WinDOS driver, and some others -** of my own devising. -** -** Features: -** Corner Clicks -** This recognizes taps on the touchpad in the corner(s) and -** translates them into specific actions. Initially I am looking -** at actions on the order of alternate button clicks. Other -** alternatives include drags and whatnot. -** Edge Extensions -** This recognizes that the finger has moved from the center region -** of the touchpad and dragged to the edge area. At which point -** I want to be able to extend the motion by automatically moving -** in the direction of the edge. -** Toss n Catch -** This recognizes a quick motion of the finger on the touchpad and -** uses that to define a velocity vector for the cursor. A tap -** on the touchpad at a later time catches (stops) the cursor. -** Tap n Drag -** A quick tap of the touchpad followed by finger motion on the -** touchpad initiates what would be a drag with a normal mouse -** type device. -** Pressure Sensitive Velocity -** The Synaptics touchpad indicates the touch pressure of the finger -** (really an interface area) this is used to accelerate the cursor -** motion. This can be used in the normal motion, Tap n Drag, or -** Edge Extension modes. In normal motion and Tap n Drag this may -** be awkward due to increased friction caused by the pressure. -*/ - - -#ifndef _SYNAPTICS_H_ -#define _SYNAPTICS_H_ - - -/* -** syn_process_serial_data -** -** Process the touchpad 6/7/8 byte data. -*/ -void syn_process_serial_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_process_ps2_data -** -** Process the touchpad 6 byte data. -*/ -void syn_process_ps2_data (Gpm_Event *state, - unsigned char *data); - - - -/* -** syn_serial_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6/7/8 byte packets, -** select 9600 baud, and select high packet rate. -** Return how many bytes in a packet. -*/ -int syn_serial_init (int fd); - - - -/* -** syn_ps2_init -** -** Initialize the synaptics touchpad. Read model and identification. -** Determine the size of the touchpad in "pixels". Select 6 byte packets, -** and select high packet rate. -*/ -void syn_ps2_init (int fd); - - -/* -** syn_ps2_reset -** -** Reset the synaptics touchpad. Touchpad ends in relative mode. -*/ -void syn_ps2_reset (int fd); - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/twiddler.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/twiddler.h deleted file mode 100644 index 642651de..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/twiddler.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#ifndef _GPM_TWIDDLER_H -#define _GPM_TWIDDLER_H - -/* definition of the twiddler protocol */ - -/* - * 2400,8,n,1 5-bytes - * - * bit 7 6 5 4 3 2 1 0 - * 0 4L 3M 3L 2M 2L 1M 1L - * 1 Mo Al Co Fn Nm Sh 4M - * 1 V6 V5 V4 V3 V2 V1 V0 - * 1 H4 H3 H2 H1 H0 V8 V7 - * 1 0 0 0 H8 H7 H6 H5 - * H and V are two complement: up and left is positive - */ - -#define TW_L1 0x0001 -#define TW_M1 0x0002 -#define TW_R1 0x0003 -#define TW_ANY1 0x0003 -#define TW_L2 0x0004 -#define TW_M2 0x0008 -#define TW_R2 0x000C -#define TW_ANY2 0x000C -#define TW_L3 0x0010 -#define TW_M3 0x0020 -#define TW_R3 0x0030 -#define TW_ANY3 0x0030 -#define TW_L4 0x0040 -#define TW_M4 0x0080 -#define TW_R4 0x00C0 -#define TW_ANY4 0x00C0 - -#define TW_MOD_0 0x0000 -#define TW_MOD_S 0x0100 -#define TW_MOD_N 0x0200 -#define TW_MOD_F 0x0400 -#define TW_MOD_C 0x0800 -#define TW_MOD_A 0x1000 -#define TW_MOD_M 0x2000 - -#define TW_ANY_KEY 0x3fff /* any button or modifier */ -#define TW_ANY_MOD 0x3f00 /* any modifier */ - - -#define TW_V_SHIFT 14 -#define TW_H_SHIFT 23 -#define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ -#define TW_M_BIT 0x100 - -#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" -#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" - - -int twiddler_key(unsigned long message); -int twiddler_key_init(void); - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/headers/types.h b/software/gpm/browse_source/gpm-1.99.7/src/headers/types.h deleted file mode 100644 index 4e18bab1..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/headers/types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Types used by gpm internally only - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - */ - -#ifndef _GPM_TYPE_H -#define _GPM_TYPE_H - -/************************************************************************* - * Includes - */ -#include "gpm.h" /* Gpm_Connect */ - -/************************************************************************* - * Types / structures - */ - -typedef struct Gpm_Cinfo { - Gpm_Connect data; - int fd; - struct Gpm_Cinfo *next; -} Gpm_Cinfo; - - -/* and this is the entry in the mouse-type table */ -typedef struct Gpm_Type { - char *name; - char *desc; /* a descriptive line */ - char *synonyms; /* extra names (the XFree name etc) as a list */ - /* mouse specific event handler: */ - int (*fun)(Gpm_Event *state, unsigned char *data); - - /* mouse specific initialisation function: */ - struct Gpm_Type *(*init)(int fd, unsigned short flags, - struct Gpm_Type *type, int argc, char **argv); - - unsigned short flags; - unsigned char proto[4]; - int packetlen; - int howmany; /* how many bytes to read at a time */ - int getextra; /* does it get an extra byte? (only mouseman) */ - int absolute; /* flag indicating absolute pointing device */ - - /* repeat this event into fd */ - int (*repeat_fun)(Gpm_Event *state, int fd); -} Gpm_Type; - -struct micetab { - struct micetab *next; - char *device; - char *protocol; - char *options; -}; - -struct options { - int autodetect; /* -u [aUtodetect..'A' is unavailable] */ - int no_mice; /* number of mice */ - int repeater; /* repeat data */ - char *repeater_type; /* repeat data as which mouse type */ - int run_status; /* startup/daemon/debug */ - char *progname; /* hopefully gpm ;) */ - struct micetab *micelist; /* mice and their options */ - char *consolename; /* /dev/tty0 || /dev/vc/0 */ -}; - -/* this structure is used to hide the dual-mouse stuff */ -struct mouse_features { - char *opt_type, - *opt_dev, - *opt_sequence, - *opt_calib, - *opt_options; /* extra textual configuration */ - int fd, - opt_baud, - opt_sample, - opt_delta, - opt_accel, - opt_scale, - opt_scaley, - opt_time, - opt_cluster, - opt_three, - opt_glidepoint_tap, - opt_dminx, - opt_dmaxx, - opt_dminy, - opt_dmaxy, - opt_ominx, - opt_omaxx, - opt_ominy, - opt_omaxy; - Gpm_Type *m_type; -}; - -/*======================================================================== - * Parsing argv: helper dats struct function - *========================================================================*/ -enum argv_type { - ARGV_BOOL = 1, - ARGV_INT, /* "%i" */ - ARGV_DEC, /* "%d" */ - ARGV_STRING, - /* other types must be added */ - ARGV_END = 0 -}; - -typedef struct argv_helper { - char *name; - enum argv_type type; - union u { - int *iptr; /* used for int and bool arguments */ - char **sptr; /* used for string arguments, by strdup()ing the value */ - } u; - int value; /* used for boolean arguments */ -} argv_helper; - - -#endif diff --git a/software/gpm/browse_source/gpm-1.99.7/src/lib/libcurses.c b/software/gpm/browse_source/gpm-1.99.7/src/lib/libcurses.c deleted file mode 100644 index 4e8867bd..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/lib/libcurses.c +++ /dev/null @@ -1,208 +0,0 @@ - -/* - * libcurses.c - client library - curses level (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright 2002 nico@schottelius.org (Nico Schottelius) - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include /* select(); */ -#include /* timeval */ -#include /* socket() */ - -#include "gpmInt.h" - -#ifdef HAVE_NCURSES_H -# include -#else -# ifdef HAVE_NCURSES_CURSES_H -# include -# else -# ifdef HAVE_CURSES_H -# include -# endif /* HAVE_CURSES_H */ -# endif /* HAVE_NCURSES_CURSES_H */ -#endif /* HAVE_NCURSES_H */ - -#define GET(win) ((win) ? wgetch(win) : getch()) - -int Gpm_Wgetch(WINDOW * win) -{ - fd_set selSet; - - int max, flag, result; - - int fd = STDIN_FILENO; - - static Gpm_Event ev; - - if(!gpm_flag || gpm_fd == -1) - return GET(win); - if(gpm_morekeys) - return (*gpm_handler) (&ev, gpm_data); - gpm_hflag = 0; - - max = (gpm_fd > fd) ? gpm_fd : fd; - -/*...................................................................*/ - if(gpm_fd >= 0) /* linux */ - while(1) { - if(gpm_visiblepointer) - GPM_DRAWPOINTER(&ev); - do { - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - FD_SET(gpm_fd, &selSet); - if(gpm_fd > -1) - FD_SET(gpm_fd, &selSet); - gpm_timeout.tv_sec = SELECT_TIME; - flag = - select(max + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &gpm_timeout); - } - while(!flag); - - if(FD_ISSET(fd, &selSet)) - return GET(win); - - if(flag == -1) - continue; - - if(Gpm_GetEvent(&ev) && gpm_handler - && (result = (*gpm_handler) (&ev, gpm_data))) { - gpm_hflag = 1; - return result; - } - } else - -/*...................................................................*/ - if(gpm_fd == -2) { /* xterm */ -#define DELAY_MS 100 - static struct timeval to = { 0, DELAY_MS * 1000 }; - static fd_set selSet; - -/* JD patch 11/08/1998 */ -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ - static int nbprevchar = 0, prevchar[MAXNBPREVCHAR]; - - extern int gpm_convert_event(unsigned char *data, Gpm_Event * event); - - int c; - - unsigned char mdata[4]; - -/* JD patch 11/08/1998 */ - if(nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - -/* if ungetc() didn't suffice... */ - -/* if ((c=prevchar)!=EOF) - { - prevchar=EOF; - return c; - } -*/ - - while(1) { - do { - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - gpm_timeout.tv_sec = SELECT_TIME; - flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &gpm_timeout); - } - while(!flag); - - if((c = GET(win)) != 0x1b) - return c; - - /* - * escape: go on - */ - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - to.tv_usec = DELAY_MS * 1000; - if((flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &to)) == 0) - return c; - if((c = GET(win)) != '[') { - prevchar[nbprevchar++] = c; - return 0x1B; - } - - /* - * patche par JD 11/08/1998 - */ - /* - * {ungetc(c,stdin); return 0x1B;} - */ - /* - * '[': go on - */ - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - to.tv_usec = DELAY_MS * 1000; - - if((flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &to)) == 0) { - prevchar[nbprevchar++] = c; - return 0x1B; - } - - /* - * patche par JD 11/08/1998 - */ - /* - * {ungetc(c,stdin); return 0x1B;} - */ - if((c = GET(win)) != 'M') - /* - * patche par JD 11/08/1998 NOTICE: prevchar is a lifo ! - */ - { - prevchar[nbprevchar++] = c; - prevchar[nbprevchar++] = '['; - return 0x1B; - } - /* - * {ungetc(c,stdin);prevchar='['; return 0x1B;} - */ - - /* - * now, it surely is a mouse event - */ - - for(c = 0; c < 3; c++) - mdata[c] = GET(win); - gpm_convert_event(mdata, &ev); - - if(gpm_handler && (result = (*gpm_handler) (&ev, gpm_data))) { - gpm_hflag = 1; - return result; - } - } /* while(1) */ - } - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/lib/libhigh.c b/software/gpm/browse_source/gpm-1.99.7/src/lib/libhigh.c deleted file mode 100644 index e4c1a067..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/lib/libhigh.c +++ /dev/null @@ -1,234 +0,0 @@ - -/* - * libhigh.c - client library - high level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include - -#include "gpmInt.h" - -Gpm_Roi *gpm_roi = NULL; - -Gpm_Roi *gpm_current_roi = NULL; - -Gpm_Handler *gpm_roi_handler = NULL; - -void *gpm_roi_data; - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PushRoi(int x, int y, int X, int Y, int mask, - Gpm_Handler * fun, void *xtradata) -{ - Gpm_Roi *new; - - /* - * create a Roi and push it - */ - new = (Gpm_Roi *) malloc(sizeof(Gpm_Roi)); - if(!new) - return NULL; - - /* - * use the roi handler, if still null - */ - if(!gpm_roi && !gpm_handler) - gpm_handler = Gpm_HandleRoi; - - new->xMin = x; - new->xMax = X; - new->yMin = y; - new->yMax = Y; - new->minMod = 0; - new->maxMod = ~0; - new->prev = new->next = NULL; - new->eventMask = mask; - new->owned = 0; /* use free() */ - new->handler = fun; - new->clientdata = xtradata ? xtradata : (void *) new; - return Gpm_RaiseRoi(new, NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_UseRoi(Gpm_Roi * new) -{ - /* - * use a Roi by pushing it - */ - new->prev = new->next = NULL; - new->owned = 1; /* don't free() */ - - /* - * use the roi handler, if still null - */ - if(!gpm_roi && !gpm_handler) - gpm_handler = Gpm_HandleRoi; - - return Gpm_RaiseRoi(new, NULL); -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_PopRoi(Gpm_Roi * which) -{ - /* - * extract the Roi and remove it - */ - if(which->prev) - which->prev->next = which->next; - if(which->next) - which->next->prev = which->prev; - if(gpm_roi == which) - gpm_roi = which->next; - - if(which->owned == 0) - free(which); - if(gpm_current_roi == which) - gpm_current_roi = NULL; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_RaiseRoi(Gpm_Roi * which, Gpm_Roi * before) -{ - /* - * raise a Roi above another, or to top-of-stack - */ - if(!gpm_roi) - return gpm_roi = which; - if(!before) - before = gpm_roi; - if(before == which) - return gpm_roi; - - if(which->prev) - which->prev->next = which->next; - if(which->next) - which->next->prev = which->prev; - if(gpm_roi == which) - gpm_roi = which->next; - - which->prev = before->prev; - before->prev = which; - which->next = before; - - if(which->prev) - which->prev->next = which; - else - gpm_roi = which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*-------------------------------------------------------------------*/ -Gpm_Roi *Gpm_LowerRoi(Gpm_Roi * which, Gpm_Roi * after) -{ - /* - * lower a Roi below another, or to bottom-of-stack - */ - if(!after) - for(after = gpm_roi; after->next; after = after->next) ; - if(after == which) - return gpm_roi; - if(which->prev) - which->prev->next = which->next; - if(which->next) - which->next->prev = which->prev; - if(gpm_roi == which) - gpm_roi = which->next; - - which->next = after->next; - after->next = which; - which->prev = after; - - if(which->next) - which->next->prev = which; - - return gpm_roi; /* return the new top-of-stack */ -} - -/*===================================================================* - * This function is in care of all event dispatching. - * It generates also GPM_ENTER and GPM_LEAVE events. - */ - -int Gpm_HandleRoi(Gpm_Event * ePtr, void *clientdata) -{ - static Gpm_Event backEvent; - - Gpm_Roi *roi = gpm_current_roi; - - clientdata = NULL; /* FIXME: gpm 1.99.13 */ - -/* - * If motion or press, look for the interested roi. - * Drag and release will be reported to the old roi. - */ - - if(ePtr->type & (GPM_MOVE | GPM_DOWN)) - for(roi = gpm_roi; roi; roi = roi->next) { - if(roi->xMin > ePtr->x || roi->xMax < ePtr->x) - continue; - if(roi->yMin > ePtr->y || roi->yMax < ePtr->y) - continue; - if((roi->minMod & ePtr->modifiers) < roi->minMod) - continue; - if((roi->maxMod & ePtr->modifiers) < ePtr->modifiers) - continue; - break; - } - -/* - * Now generate the leave/enter events - */ - - if(roi != gpm_current_roi) { - if(gpm_current_roi && (gpm_current_roi->eventMask & GPM_LEAVE)) { - backEvent.type = GPM_LEAVE; - (*(gpm_current_roi->handler)) (&backEvent, - gpm_current_roi->clientdata); - } - if(roi && (roi->eventMask & GPM_ENTER)) { - backEvent.type = GPM_ENTER; - (*(roi->handler)) (&backEvent, roi->clientdata); - } - } - gpm_current_roi = roi; - - /* - * events not requested are discarded - */ - if(roi && (GPM_BARE_EVENTS(ePtr->type) & roi->eventMask) == 0) - return 0; - - backEvent = *ePtr; /* copy it, so the main one is unchanged */ - if(!roi) { - if(gpm_roi_handler) - return (*gpm_roi_handler) (&backEvent, gpm_roi_data); - return 0; - } - -/* - * Ok, now report the event as it is, after modifying x and y - */ - - backEvent.x -= roi->xMin; - backEvent.y -= roi->yMin; - return (*(roi->handler)) (&backEvent, roi->clientdata); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/lib/liblow.c b/software/gpm/browse_source/gpm-1.99.7/src/lib/liblow.c deleted file mode 100644 index 509d64d7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/lib/liblow.c +++ /dev/null @@ -1,817 +0,0 @@ - -/* - * - * liblow.c - client library - low level (gpm) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright 2001-2008 Nico Schottelius (nico-gpm2008 at schottelius.org) - * - * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) - * - * 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. - ********/ - -#include -#include -#include -#include /* strncmp */ -#include /* select(); */ -#include -#include /* timeval */ -#include /* socket() */ -#include /* socket() */ -#include /* struct sockaddr_un */ -#include /* O_RDONLY */ -#include /* stat() */ - -#ifdef SIGTSTP /* true if BSD system */ -# include -# include -#endif - -#include -#include /* VT_GETSTATE */ -#include /* KDGETMODE */ -#include /* winsize */ - -#include "gpmInt.h" -#include "message.h" - -#ifndef min -# define min(a,b) ((a)<(b) ? (a) : (b)) -# define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/*....................................... Stack struct */ -typedef struct Gpm_Stst { - Gpm_Connect info; - struct Gpm_Stst *next; -} Gpm_Stst; - -/*....................................... Global variables */ -int gpm_flag = 0; /* almost unuseful now -- where was it used for - * ? can we remove it now ? FIXME */ -int gpm_tried = 0; - -int gpm_fd = -1; - -int gpm_hflag = 0; - -Gpm_Stst *gpm_stack = NULL; -struct timeval gpm_timeout = { 10, 0 }; - -Gpm_Handler *gpm_handler = NULL; - -void *gpm_data = NULL; - -int gpm_zerobased = 0; - -int gpm_visiblepointer = 0; - -int gpm_mx, gpm_my; /* max x and y (1-based) to fit margins */ - -unsigned char _gpm_buf[6 * sizeof(short)]; - -unsigned short *_gpm_arg = (unsigned short *) _gpm_buf + 1; - -int gpm_consolefd = -1; /* used to invoke ioctl() */ - -int gpm_morekeys = 0; - -int gpm_convert_event(unsigned char *mdata, Gpm_Event * ePtr); - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static inline int putdata(int where, Gpm_Connect * what) -{ -#ifdef GPM_USE_MAGIC - static int magic = GPM_MAGIC; - - if(write(where, &magic, sizeof(int)) != sizeof(int)) { - gpm_report(GPM_PR_ERR, GPM_MESS_WRITE_ERR, strerror(errno)); - return -1; - } -#endif - if(write(where, what, sizeof(Gpm_Connect)) != sizeof(Gpm_Connect)) { - gpm_report(GPM_PR_ERR, GPM_MESS_WRITE_ERR, strerror(errno)); - return -1; - } - return 0; -} - -#if (defined(SIGWINCH)) - -/* itz Wed Mar 18 11:19:52 PST 1998 hook window change as well */ - -/* Old SIGWINCH handler. */ - -static struct sigaction gpm_saved_winch_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_winch_hook(int signum) -{ - struct winsize win; - - if(SIG_IGN != gpm_saved_winch_hook.sa_handler && - SIG_DFL != gpm_saved_winch_hook.sa_handler) { - gpm_saved_winch_hook.sa_handler(signum); - } /* if */ - if(ioctl(gpm_consolefd, TIOCGWINSZ, &win) == -1) { - return; - } /* if */ - if(!win.ws_col || !win.ws_row) { - win.ws_col = 80; - win.ws_row = 25; - } /* if */ - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; -} - -#endif /* SIGWINCH */ - -#if (defined(SIGTSTP)) - -/* itz: support for SIGTSTP */ - -/* Old SIGTSTP handler. */ - -static struct sigaction gpm_saved_suspend_hook; - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -static void gpm_suspend_hook(int success) -{ /* misuse the parameter */ - Gpm_Connect gpm_connect; - - sigset_t old_sigset; - - sigset_t new_sigset; - - struct sigaction sa; - - sigemptyset(&new_sigset); - sigaddset(&new_sigset, SIGTSTP); - sigprocmask(SIG_BLOCK, &new_sigset, &old_sigset); - - /* - * Open a completely transparent gpm connection - */ - gpm_connect.eventMask = 0; - gpm_connect.defaultMask = ~0; - gpm_connect.minMod = ~0; - gpm_connect.maxMod = 0; - /* - * cannot do this under xterm, tough - */ - success = (Gpm_Open(&gpm_connect, 0) >= 0); - - /* - * take the default action, whatever it is (probably a stop :) - */ - sigprocmask(SIG_SETMASK, &old_sigset, 0); - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); - kill(getpid(), SIGTSTP); - - /* - * in bardo here - */ - - /* - * Reincarnation. Prepare for another death early. - */ - sigemptyset(&sa.sa_mask); - sa.sa_handler = gpm_suspend_hook; - sa.sa_flags = SA_NOMASK; - sigaction(SIGTSTP, &sa, 0); - - /* - * Pop the gpm stack by closing the useless connection - */ - /* - * but do it only when we know we opened one.. - */ - if(success) { - Gpm_Close(); - } /* if */ -} -#endif /* SIGTSTP */ - -/*----------------------------------------------------------------------------* - * nice description - *----------------------------------------------------------------------------*/ -int Gpm_Open(Gpm_Connect * conn, int flag) -{ - char *tty = NULL; - - char *term = NULL; - - int i; - - struct sockaddr_un addr; - - struct winsize win; - - Gpm_Stst *new = NULL; - - char *sock_name = 0; - - static char *consolename = NULL; - - int gpm_is_disabled = 0; - - /* - * ....................................... First of all, check xterm - */ - - if((term = (char *) getenv("TERM")) && !strncmp(term, "xterm", 5)) { - if(gpm_tried) - return gpm_fd; /* no stack */ - gpm_fd = -2; - GPM_XTERM_ON; - gpm_flag = 1; - return gpm_fd; - } - /* - * ....................................... No xterm, go on - */ - - /* - * check whether we know what name the console is: what's with the lib??? - */ - if(!consolename) { - consolename = Gpm_get_console(); - if(!consolename) { - gpm_report(GPM_PR_ERR, - "unable to open gpm console, check your /dev filesystem!\n"); - goto err; - } - } - - /* - * So I chose to use the current tty, instead of /dev/console, which - * has permission problems. (I am fool, and my console is - * readable/writeable by everybody. - * - * However, making this piece of code work has been a real hassle. - */ - - if(!gpm_flag && gpm_tried) - return -1; - gpm_tried = 1; /* do or die */ - - if((new = (Gpm_Stst *) malloc(sizeof(Gpm_Stst))) == NULL) - return -1; - - new->next = gpm_stack; - gpm_stack = new; - - conn->pid = getpid(); /* fill obvious values */ - - if(new->next) - conn->vc = new->next->info.vc; /* inherit */ - else { - conn->vc = 0; /* default handler */ - if(flag > 0) { /* forced vc number */ - conn->vc = flag; - if((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL) - gpm_report(GPM_PR_OOPS, GPM_MESS_NO_MEM); - memcpy(tty, consolename, strlen(consolename) - 1); - sprintf(&tty[strlen(consolename) - 1], "%i", flag); - } else if(flag == 0) { /* use your current vc */ - if(isatty(0)) - tty = ttyname(0); /* stdin */ - if(!tty && isatty(1)) - tty = ttyname(1); /* stdout */ - if(!tty && isatty(2)) - tty = ttyname(2); /* stderr */ - if(tty == NULL) { - gpm_report(GPM_PR_ERR, "checking tty name failed"); - goto err; - } - - conn->vc = atoi(&tty[strlen(consolename) - 1]); - } else /* a default handler -- use console */ - tty = strdup(consolename); - - if(gpm_consolefd == -1) - if((gpm_consolefd = open(tty, O_WRONLY)) < 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_DOUBLE_S, tty, strerror(errno)); - goto err; - } - } - - new->info = *conn; - - /* - * ....................................... Get screen dimensions - */ - - ioctl(gpm_consolefd, TIOCGWINSZ, &win); - - if(!win.ws_col || !win.ws_row) { - fprintf(stderr, "libgpm: zero screen dimension, assuming 80x25.\n"); - win.ws_col = 80; - win.ws_row = 25; - } - gpm_mx = win.ws_col - gpm_zerobased; - gpm_my = win.ws_row - gpm_zerobased; - - /* - * ....................................... Connect to the control socket - */ - - if(!(gpm_flag++)) { - if((gpm_fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - gpm_report(GPM_PR_ERR, GPM_MESS_SOCKET, strerror(errno)); - goto err; - } -#ifndef SO_PEERCRED - memset((char *) &addr, 0, sizeof(addr)); - addr.sun_family = AF_UNIX; - if(!(sock_name = tempnam(0, "gpm"))) { - gpm_report(GPM_PR_ERR, GPM_MESS_TEMPNAM, strerror(errno)); - goto err; - } - strncpy(addr.sun_path, sock_name, sizeof(addr.sun_path)); - if(bind(gpm_fd, (struct sockaddr *) &addr, - sizeof(addr.sun_family) + strlen(addr.sun_path)) == -1) { - gpm_report(GPM_PR_ERR, GPM_MESS_DOUBLE_S, sock_name, strerror(errno)); - goto err; - } -#endif - - memset((char *) &addr, 0, sizeof(addr)); - addr.sun_family = AF_UNIX; - strcpy(addr.sun_path, GPM_NODE_CTL); - i = sizeof(addr.sun_family) + strlen(GPM_NODE_CTL); - - if(connect(gpm_fd, (struct sockaddr *) (&addr), i) < 0) { - struct stat stbuf; - - if(errno == ENOENT) { - gpm_report(GPM_PR_DEBUG, "cannot find %s; ignoring (gpm disabled?)", - GPM_NODE_CTL); - gpm_is_disabled++; - } else { - gpm_report(GPM_PR_INFO, GPM_MESS_DOUBLE_S, GPM_NODE_CTL, - strerror(errno)); - } - /* - * Well, try to open a chr device called /dev/gpmctl. This should - * be forward-compatible with a kernel server - */ - close(gpm_fd); /* the socket */ - if((gpm_fd = open(GPM_NODE_DEV, O_RDWR)) == -1) { - if(errno == ENOENT) { - gpm_report(GPM_PR_DEBUG, - "Cannot find %s; ignoring (gpm disabled?)", - GPM_NODE_DEV); - gpm_is_disabled++; - } else { - gpm_report(GPM_PR_ERR, GPM_MESS_DOUBLE_S, GPM_NODE_DEV, - strerror(errno)); - } - goto err; - } - if(fstat(gpm_fd, &stbuf) == -1 || (stbuf.st_mode & S_IFMT) != S_IFCHR) { - goto err; - } - } - } - /* - * ....................................... Put your data - */ - - if(putdata(gpm_fd, conn) != -1) { - /* - * itz Wed Dec 16 23:22:16 PST 1998 use sigaction, the old code caused a - * signal loop under XEmacs - */ - struct sigaction sa; - - sigemptyset(&sa.sa_mask); - -#if (defined(SIGWINCH)) - /* - * And the winch hook .. - */ - sa.sa_handler = gpm_winch_hook; - sa.sa_flags = 0; - sigaction(SIGWINCH, &sa, &gpm_saved_winch_hook); -#endif - -#if (defined(SIGTSTP)) - if(gpm_flag == 1) { - /* - * Install suspend hook - */ - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, &gpm_saved_suspend_hook); - - /* - * if signal was originally ignored, job control is not supported - */ - if(gpm_saved_suspend_hook.sa_handler != SIG_IGN) { - sa.sa_flags = SA_NOMASK; - sa.sa_handler = gpm_suspend_hook; - sigaction(SIGTSTP, &sa, 0); - } - } -#endif - - } - return gpm_fd; - - /* - * ....................................... Error: free all memory - */ - err: - if(gpm_is_disabled < 2) /* be quiet if no gpmctl socket found */ - gpm_report(GPM_PR_ERR, "Oh, oh, it's an error! possibly I die! "); - while(gpm_stack) { - new = gpm_stack->next; - free(gpm_stack); - gpm_stack = new; - } - if(gpm_fd >= 0) - close(gpm_fd); - if(sock_name) { - unlink(sock_name); - free(sock_name); - sock_name = 0; - } - gpm_flag = 0; - return -1; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Close(void) -{ - Gpm_Stst *next; - - gpm_tried = 0; /* reset the error flag for next time */ - if(gpm_fd == -2) /* xterm */ - GPM_XTERM_OFF; - else { /* linux */ - - if(!gpm_flag) - return 0; - next = gpm_stack->next; - free(gpm_stack); - gpm_stack = next; - if(next) - putdata(gpm_fd, &(next->info)); - - if(--gpm_flag) - return -1; - } - - if(gpm_fd >= 0) - close(gpm_fd); - gpm_fd = -1; -#ifdef SIGTSTP - sigaction(SIGTSTP, &gpm_saved_suspend_hook, 0); -#endif -#ifdef SIGWINCH - sigaction(SIGWINCH, &gpm_saved_winch_hook, 0); -#endif - close(gpm_consolefd); - gpm_consolefd = -1; - return 0; -} - -/*-------------------------------------------------------------------*/ -int Gpm_GetEvent(Gpm_Event * event) -{ - int count; - - MAGIC_P((int magic)); - - if(!gpm_flag) - return 0; - -#ifdef GPM_USE_MAGIC - if((count = read(gpm_fd, &magic, sizeof(int))) != sizeof(int)) { - if(count == 0) { - gpm_report(GPM_PR_INFO, "Warning: closing connection"); - Gpm_Close(); - return 0; - } - gpm_report(GPM_PR_INFO, "Read too few bytes (%i) at %s:%d", count, - __FILE__, __LINE__); - return -1; - } -#endif - - if((count = read(gpm_fd, event, sizeof(Gpm_Event))) != sizeof(Gpm_Event)) { -#ifndef GPM_USE_MAGIC - if(count == 0) { - gpm_report(GPM_PR_INFO, "Warning: closing connection"); - Gpm_Close(); - return 0; - } -#endif - /* - * avoid to send the message if there is no data; sometimes it makes - * sense to poll the mouse descriptor any now an then using a - * non-blocking descriptor - */ - if(count != -1 || errno != EAGAIN) - gpm_report(GPM_PR_INFO, "Read too few bytes (%i) at %s:%d", - count, __FILE__, __LINE__); - return -1; - } - - event->x -= gpm_zerobased; - event->y -= gpm_zerobased; - - return 1; -} - -#define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ -static int nbprevchar = 0, prevchar[MAXNBPREVCHAR]; - -/*-------------------------------------------------------------------*/ -int Gpm_CharsQueued() -{ - return nbprevchar; -} - -/*-------------------------------------------------------------------*/ -int Gpm_Getc(FILE * f) -{ - fd_set selSet; - - int max, flag, result; - - static Gpm_Event ev; - - int fd = fileno(f); - - static int count; - - /* - * Hmm... I must be sure it is unbuffered - */ - if(!(count++)) - setvbuf(f, NULL, _IONBF, 0); - - if(!gpm_flag) - return getc(f); - - /* - * If the handler asked to provide more keys, give them back - */ - if(gpm_morekeys) - return (*gpm_handler) (&ev, gpm_data); - gpm_hflag = 0; - - max = (gpm_fd > fd) ? gpm_fd : fd; - - /* - * ................................................................... - */ - if(gpm_fd >= 0) /* linux */ - while(1) { - if(gpm_visiblepointer) - GPM_DRAWPOINTER(&ev); - do { - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - if(gpm_fd > -1) - FD_SET(gpm_fd, &selSet); - gpm_timeout.tv_sec = SELECT_TIME; - flag = - select(max + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &gpm_timeout); - } - while(!flag); - - if(flag == -1) - continue; - - if(FD_ISSET(fd, &selSet)) - return fgetc(f); - - if(Gpm_GetEvent(&ev) && gpm_handler - && (result = (*gpm_handler) (&ev, gpm_data))) { - gpm_hflag = 1; - return result; - } - } else - /* - * ................................................................... - */ - if(gpm_fd == -2) { /* xterm */ -#define DELAY_MS 100 - static struct timeval to = { 0, DELAY_MS * 1000 }; - static fd_set selSet; - - extern int gpm_convert_event(unsigned char *data, Gpm_Event * event); - - int c; - - unsigned char mdata[4]; - - if(nbprevchar) /* if there are some consumed char ... */ - return prevchar[--nbprevchar]; - - while(1) { - do { - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - gpm_timeout.tv_sec = SELECT_TIME; - flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &gpm_timeout); - } - while(!flag); - - if((c = fgetc(f)) != 0x1b) - return c; - - /* - * escape: go on - */ - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - to.tv_usec = DELAY_MS * 1000; - if((flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &to)) == 0) - return c; - if((c = fgetc(f)) != '[') { - prevchar[nbprevchar++] = c; - return 0x1B; - } - - /* - * patche par JD 11/08/1998 - */ - /* - * '[': go on - */ - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - to.tv_usec = DELAY_MS * 1000; - if((flag = - select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, - &to)) == 0) { - prevchar[nbprevchar++] = c; - return 0x1B; - } /* patche par JD 11/08/1998 */ - if((c = fgetc(f)) != 'M') - /* - * patche par JD 11/08/1998 NOTICE: prevchar is a lifo ! - */ - { - prevchar[nbprevchar++] = c; - prevchar[nbprevchar++] = '['; - return 0x1B; - } - - /* - * now, it surely is a mouse event - */ - - for(c = 0; c < 3; c++) - mdata[c] = fgetc(f); - gpm_convert_event(mdata, &ev); - - if(gpm_handler && (result = (*gpm_handler) (&ev, gpm_data))) { - gpm_hflag = 1; - return result; - } - } /* while(1) */ - } - - /* - * ................................................................... - */ - else - return fgetc(f); /* no mouse available */ -} - -/*-------------------------------------------------------------------*/ -int Gpm_Repeat(int msec) -{ - struct timeval to = { 0, 1000 * msec }; - int fd; - - fd_set selSet; - - fd = gpm_fd >= 0 ? gpm_fd : 0; /* either the socket or stdin */ - - FD_ZERO(&selSet); - FD_SET(fd, &selSet); - return (select(fd + 1, &selSet, (fd_set *) NULL, (fd_set *) NULL, &to) == 0); -} - -/*-------------------------------------------------------------------*/ -int Gpm_FitValuesM(int *x, int *y, int margin) -{ - if(margin == -1) { - *x = min(max(*x, !gpm_zerobased), gpm_mx); - *y = min(max(*y, !gpm_zerobased), gpm_my); - return 0; - } - switch (margin) { - case GPM_TOP: - (*y)++; - break; - case GPM_BOT: - (*y)--; - break; - case GPM_RGT: - (*x)--; - break; - case GPM_LFT: - (*x)++; - break; - } - return 0; -} - -/*-------------------------------------------------------------------*/ -int gpm_convert_event(unsigned char *mdata, Gpm_Event * ePtr) -{ - static struct timeval tv1 = { 0, 0 }, tv2; - static int clicks = 0; - - int c; - -#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) -#define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ - (t2.tv_usec-t1.tv_usec)/1000) - - /* - * Variable btn has following meaning: - */ - c = mdata[0] - 32; /* 0="1-down", 1="2-down", 2="3-down", 3="up" */ - - if(c == 3) { - ePtr->type = GPM_UP | (GPM_SINGLE << clicks); - /* - * ePtr->buttons = 0; - *//* - * no, keep info from press event - */ - GET_TIME(tv1); - clicks = 0; - } else { - ePtr->type = GPM_DOWN; - GET_TIME(tv2); - if(tv1.tv_sec && (DIF_TIME(tv1, tv2) < 250)) { /* 250ms for double - * click */ - clicks++; - clicks %= 3; - } else - clicks = 0; - - switch (c) { - case 0: - ePtr->buttons = GPM_B_LEFT; - break; - case 1: - ePtr->buttons = GPM_B_MIDDLE; - break; - case 2: - ePtr->buttons = GPM_B_RIGHT; - break; - default: /* Nothing */ - break; - } - } - /* - * Coordinates are 33-based - */ - /* - * Transform them to 1-based - */ - ePtr->x = mdata[1] - 32 - gpm_zerobased; - ePtr->y = mdata[2] - 32 - gpm_zerobased; - return 0; -} - -/* Local Variables: */ - -/* c-indent-level: 3 */ - -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/lib/libxtra.c b/software/gpm/browse_source/gpm-1.99.7/src/lib/libxtra.c deleted file mode 100644 index 901bbffa..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/lib/libxtra.c +++ /dev/null @@ -1,139 +0,0 @@ - -/* - * libxtra.c - client library - extra functions (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * xterm management is mostly by Miguel de Icaza - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include - -#include "gpmInt.h" -#include "message.h" - -/*-------------------------------------------------------------------*/ - -/* - * these two functions return version information - */ - -//static char *gpml_ver_s = GPM_ABI_FULL; -//static int gpml_ver_i = 0; - -char *Gpm_GetLibVersion(int *where) -{ - if(where) - *where = GPM_ABI_LEV * 10000 + GPM_ABI_AGE * 100 + GPM_ABI_REV; - return GPM_ABI_FULL; -} - -static char gpm_ver_s[16]; - -static int gpm_ver_i = 0; - -char *Gpm_GetServerVersion(int *where) -{ - char line[128]; - - FILE *f; - - int i, j, k = 0; - - if(!gpm_ver_s[0]) { - f = popen(SBINDIR "/gpm -v", "r"); - if(!f) - return NULL; - fgets(line, 128, f); - if(pclose(f)) - return 0; - sscanf(line, "%*s %s", gpm_ver_s); /* "gpm-Linux 0.98, March 1995" - */ - gpm_ver_s[strlen(gpm_ver_s) - 1] = '\0'; /* cut the ',' */ - - sscanf(gpm_ver_s, "%d.%d.%d", &i, &j, &k); - gpm_ver_i = i * 10000 + j * 100 + k; - } - - if(where) - *where = gpm_ver_i; - return gpm_ver_s; -} - -/*-------------------------------------------------------------------*/ - -/* - * This returns all the available information about the current situation: - * The return value is the number of buttons, as known to the server, - * the ePtr, if any, is filled with information on the current state. - */ -int Gpm_GetSnapshot(Gpm_Event * ePtr) -{ - Gpm_Connect conn; - - Gpm_Event event; - - fd_set sillySet; - struct timeval to = { 0, 0 }; - int i; - - if(!gpm_ver_i) { - if(0 == Gpm_GetServerVersion(NULL)) { - gpm_report(GPM_PR_WARN, "can't get gpm server version"); - } /* if */ - gpm_report(GPM_PR_INFO, "libgpm: got server version as %i", gpm_ver_i); - } - if(gpm_ver_i < 9802) { - gpm_report(GPM_PR_INFO, - "gpm server version too old to obtain status info"); - return -1; /* error */ - } - if(gpm_fd <= 0) { - gpm_report(GPM_PR_INFO, - "gpm connection must be open to obtain status info"); - return -1; /* error */ - } - - conn.pid = 0; /* this signals a request */ - if(ePtr) - conn.vc = GPM_REQ_SNAPSHOT; - else { - conn.vc = GPM_REQ_BUTTONS; - ePtr = &event; - } - - if(gpm_fd == -1) - return -1; - FD_ZERO(&sillySet); - FD_SET(gpm_fd, &sillySet); - if(select(gpm_fd + 1, &sillySet, NULL, NULL, &to) == 1) - return 0; - write(gpm_fd, &conn, sizeof(Gpm_Connect)); - - if((i = Gpm_GetEvent(ePtr)) != 1) - return -1; - - i = ePtr->type; - ePtr->type = 0; - return i; /* number of buttons */ -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/lib/report-lib.c b/software/gpm/browse_source/gpm-1.99.7/src/lib/report-lib.c deleted file mode 100644 index 6f3816de..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/lib/report-lib.c +++ /dev/null @@ -1,76 +0,0 @@ - -/* - * report-lib.c: the exported version of gpm_report. used in Gpm_Open and co. - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* exit() */ - -#include "message.h" - -void gpm_report(int line, char *file, int stat, char *text, ...) -{ - char *string = NULL; - - int log_level = LOG_DEBUG; - - va_list ap; - - line = 0; /* FIXME: gpm 1.99.13 */ - file = NULL; - - if(stat == GPM_STAT_DEBUG) - return; - va_start(ap, text); - - switch (stat) { - case GPM_STAT_INFO: - string = GPM_TEXT_INFO; - log_level = LOG_INFO; - break; - case GPM_STAT_WARN: - string = GPM_TEXT_WARN; - log_level = LOG_WARNING; - break; - case GPM_STAT_ERR: - string = GPM_TEXT_ERR; - log_level = LOG_ERR; - break; - case GPM_STAT_DEBUG: - string = GPM_TEXT_DEBUG; - log_level = LOG_DEBUG; - break; - case GPM_STAT_OOPS: - string = GPM_TEXT_OOPS; - log_level = LOG_CRIT; - break; - } -#ifdef HAVE_VSYSLOG - syslog(log_level, string); - vsyslog(log_level, text, ap); -#else - fprintf(stderr, "%s[%s(%d)]:\n", string, file, line); - vfprintf(stderr, text, ap); - fprintf(stderr, "\n"); -#endif - - if(stat == GPM_STAT_OOPS) - exit(1); /* may a lib function call exit ???? */ -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/mice.c b/software/gpm/browse_source/gpm-1.99.7/src/mice.c deleted file mode 100644 index ca341270..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/mice.c +++ /dev/null @@ -1,244 +0,0 @@ - -/* - * mice.c - table of mice for gpm - * - * Copyright (C) 1993 Andrew Haylett - * Copyright (C) 1994-2000 Alessandro Rubini - * Copyright (C) 1998,1999 Ian Zimmerman - * Copyright (C) 2001-2008 Nico Schottelius - * - * 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. - * - ********/ - -#include /* for FLAGS */ - -#include "mice.h" -#include "drivers.h" - - /* - * For those who are trying to add a new type, here a brief - * description of the structure. Please refer to mice.h and drivers/ - * for more information: - * - * The first three strings are the name, an help line, a long name (if any) - * Then come the functions: the decoder and the initializazion function - * (called I_* and M_*) - * - * Follows an array of four bytes: it is the protocol-identification, based - * on the first two bytes of a packet: if - * "((byte0 & proto[0]) == proto[1]) && ((byte1 & proto[2]) == proto[3])" - * then we are at the beginning of a packet. - * - * The following numbers are: - * bytes-per-packet, - * bytes-to-read (use 1, bus mice are pathological) - * has-extra-byte (boolean, for mman pathological protocol) - * is-absolute-coordinates (boolean) - * - * Finally, a pointer to a repeater function, if any. - * - */ - -Gpm_Type mice[] = { - {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", - "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ - {0x40, 0x40, 0x40, 0x00} - , 3, 1, 1, 0, 0} - , - {"ms", "The original ms protocol, with a middle-button extension.", - "", M_ms, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00} - , 3, 1, 0, 0, 0} - , - {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00} - , 7, 1, 0, 1, 0} - , - {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", - "Microsoft", M_bare, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00} - , 3, 1, 0, 0, 0} - , - {"bm", "Micro$oft busmice and compatible devices.", - "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ - {0xf8, 0x80, 0x00, 0x00} - , 3, 3, 0, 0, 0} - , - {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", - "", M_brw, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00} - , 4, 1, 0, 0, 0} - , - {"cal", "Calcomp UltraSlate", - "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00} - , 6, 6, 0, 1, 0} - , - {"calr", "Calcomp UltraSlate - relative mode", - "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, - {0x80, 0x80, 0x80, 0x00} - , 6, 6, 0, 0, 0} - , - {"etouch", "EloTouch touch-screens (only button-1 events, by now)", - "", M_etouch, I_etouch, STD_FLG, - {0xFF, 0x55, 0xFF, 0x54} - , 7, 1, 0, 1, NULL} - , -#ifdef HAVE_LINUX_INPUT_H - {"evdev", "Linux Event Device", - "", M_evdev, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} - , 16, 16, 0, 0, NULL} - , - {"evabs", "Linux Event Device - absolute mode", - "", M_evabs, I_empty, STD_FLG, - {0x00, 0x00, 0x00, 0x00} - , 16, 16, 0, 1, NULL} - , -#endif /* HAVE_LINUX_INPUT_H */ - {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", - "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00} - , 4, 1, 0, 0, 0} - , -#ifdef HAVE_LINUX_JOYSTICK_H - {"js", "Joystick mouse emulation", - "Joystick", M_js, NULL, 0, - {0xFC, 0x00, 0x00, 0x00} - , 12, 12, 0, 0, 0} - , -#endif - {"genitizer", "\"Genitizer\" tablet, in relative mode.", - "", M_geni, I_serial, CS8 | PARENB | PARODD, - {0x80, 0x80, 0x00, 0x00} - , 3, 1, 0, 0, 0} - , - {"gunze", "Gunze touch-screens (only button-1 events, by now)", - "", M_gunze, I_gunze, STD_FLG, - {0xF9, 0x50, 0xF0, 0x30} - , 11, 1, 0, 1, NULL} - , - {"imps2", "Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", - "", M_imps2, I_imps2, STD_FLG, - {0xC0, 0x00, 0x00, 0x00} - , 4, 1, 0, 0, R_imps2} - , - {"logi", "Used in some Logitech devices (only serial).", - "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, - {0xe0, 0x80, 0x80, 0x00} - , 3, 3, 0, 0, 0} - , - {"logim", "Turn logitech into Mouse-Systems-Compatible.", - "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00} - , 5, 1, 0, 0, 0} - , - {"mm", "MM series. Probably an old protocol...", - "MMSeries", M_mm, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00} - , 3, 1, 0, 0, 0} - , - {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", - "", M_ms3, I_pnp, CS7 | STD_FLG, - {0xc0, 0x40, 0xc0, 0x00} - , 4, 1, 0, 0, R_ms3} - , - {"ms+", "Like 'ms', but allows dragging with the middle button.", - "", M_ms_plus, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00} - , 3, 1, 0, 0, 0} - , - {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", - "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00} - , 3, 1, 0, 0, 0} - , - {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", - "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00} - , 5, 1, 0, 0, R_msc} - , - {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", - "", M_mtouch, I_mtouch, STD_FLG, - {0x80, 0x80, 0x80, 0x00} - , 5, 1, 0, 1, NULL} - , - {"ncr", "Ncr3125pen, found on some laptops", - "", M_ncr, NULL, STD_FLG, - {0x08, 0x08, 0x00, 0x00} - , 7, 7, 0, 1, 0} - , - {"netmouse", "Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", - "", M_netmouse, I_netmouse, CS7 | STD_FLG, - {0xc0, 0x00, 0x00, 0x00} - , 4, 1, 0, 0, 0} - , - {"pnp", "Plug and pray. New mice may not run with '-t ms'.", - "", M_bare, I_pnp, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00} - , 3, 1, 0, 0, 0} - , - {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", - "PS/2", M_ps2, I_ps2, STD_FLG, - {0xc0, 0x00, 0x00, 0x00} - , 3, 1, 0, 0, R_ps2} - , - {"sun", "'msc' protocol, but only 3 bytes per packet.", - "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, - {0xf8, 0x80, 0x00, 0x00} - , 3, 1, 0, 0, R_sun} - , - {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", - "", M_summa, I_summa, STD_FLG, - {0x80, 0x80, 0x00, 0x00} - , 5, 1, 0, 1, R_summa} - , - {"syn", "The \"Synaptics\" serial TouchPad.", - "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, - {0x40, 0x40, 0x40, 0x00} - , 6, 6, 1, 0, 0} - , - {"synps2", "The \"Synaptics\" PS/2 TouchPad", - "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, - {0x80, 0x80, 0x00, 0x00} - , 6, 1, 1, 0, 0} - , - {"twid", "Twidddler keyboard", - "", M_twid, I_twid, CS8 | STD_FLG, - {0x80, 0x00, 0x80, 0x80} - , 5, 1, 0, 0, 0} - , - {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", - "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, - {0xe0, 0x80, 0x80, 0x00} - , 3, 1, 0, 0, 0} - , - {"wacom", "Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", - "", M_wacom, I_wacom, STD_FLG, - {0x80, 0x80, 0x80, 0x00} - , 7, 1, 0, 0, 0} - , - {"wp", "Genius WizardPad tablet", - "wizardpad", M_wp, I_wp, STD_FLG, - {0xFA, 0x42, 0x00, 0x00} - , 10, 1, 0, 1, 0} - , - {"", "", - "", NULL, NULL, 0, - {0x00, 0x00, 0x00, 0x00} - , 0, 0, 0, 0, 0} -}; diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/disable-paste.c b/software/gpm/browse_source/gpm-1.99.7/src/prog/disable-paste.c deleted file mode 100644 index 82e1d07a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/disable-paste.c +++ /dev/null @@ -1,63 +0,0 @@ - -/* - * disable-paste.c - trivial program to stop gpm from pasting the - * current selection until the next user action - * - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "gpm.h" -#include "gpmInt.h" - -int main() -{ - Gpm_Connect conn; - - const int len = sizeof(Gpm_Connect); - - int exit_status = 0; - - conn.eventMask = (unsigned short) (-1); - conn.defaultMask = 0; - conn.minMod = 0; - conn.maxMod = (unsigned short) (-1); - - if(0 > Gpm_Open(&conn, 0)) { - fprintf(stderr, "disable-paste: cannot open mouse connection\n"); - exit(1); - } - conn.vc = GPM_REQ_NOPASTE; - conn.pid = 0; - if(len > write(gpm_fd, &conn, len)) { - fprintf(stderr, "disable-paste: cannot write request\n"); - exit_status = 2; - } - Gpm_Close(); - exit(exit_status); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/display-buttons.c b/software/gpm/browse_source/gpm-1.99.7/src/prog/display-buttons.c deleted file mode 100644 index 09cc0462..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/display-buttons.c +++ /dev/null @@ -1,120 +0,0 @@ - -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-buttons -lgpm display-buttons.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * left/middle/right button - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event * event) -{ - static time_t last = 0; - - time_t now = time(NULL); - - int delta; - - delta = now - last; - last = now; - - /* - * display time, delta time - */ - printf("[%ld] delta: %ds", now, delta); - - /* - * display mouse information - */ - printf(": p=%d, l=%1d, m=%1d, r=%1d, clicks=%d\n", - event->type & GPM_DOWN, - event->buttons & GPM_B_LEFT, - event->buttons & GPM_B_MIDDLE, - event->buttons & GPM_B_RIGHT, event->clicks); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - - Gpm_Connect conn; /* connection to gpm */ - - fd_set fds; - - /* - * select virtual console, 0 if not set - */ - vc = (argc == 2) ? strtol(argv[1], NULL, 10) : 0; - - conn.eventMask = GPM_DRAG | GPM_DOWN | GPM_UP; - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn, vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - printf("\tp=pressed (0=release)\n\tl=left\n\tm=middle\n\tr=right\n"); - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if(select(gpm_fd + 1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if(FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - - if(Gpm_GetEvent(&evt) > 0) { - display_data(&evt); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/display-coords.c b/software/gpm/browse_source/gpm-1.99.7/src/prog/display-coords.c deleted file mode 100644 index 83c9f23b..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/display-coords.c +++ /dev/null @@ -1,116 +0,0 @@ - -/* - * display-coords.c - a very simple gpm client - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -o display-coords -lgpm display-coords.c - * - ********/ - -/* - * This client is connects to gpm and displays the following values until - * it is killed by control+c: - * - * x/y coords on the screen - * dx, dy: deltas - * time: when packet was recievesd - * dtime: delta to the last packet - * - */ - -#include /* write, read, open */ -#include /* strtol() */ -#include /* printf() */ -#include /* time() */ -#include /* errno */ -#include /* gpm information */ - -/* display resulting data */ -int display_data(Gpm_Event * event) -{ - static time_t last = 0; - - time_t now = time(NULL); - - int delta; - - delta = now - last; - last = now; - - /* - * display time, delta time - */ - printf("[%ld] delta: %ds", now, delta); - - /* - * display mouse information - */ - printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, - event->dy); - - return 0; -} - -int main(int argc, char **argv) -{ - int vc; /* argv: console number */ - - Gpm_Connect conn; /* connection to gpm */ - - fd_set fds; - - /* - * select virtual console, 0 if not set - */ - vc = (argc == 2) ? strtol(argv[1], NULL, 10) : 0; - - conn.eventMask = GPM_MOVE; /* read only moves */ - conn.defaultMask = ~GPM_HARD; /* inverted GPM_HARD mask */ - conn.minMod = 0; - conn.maxMod = ~0; - - if(Gpm_Open(&conn, vc) == -1) { - printf("Cannot connect to gpm!\n"); - return 1; - } - if(gpm_fd == -2) { - printf("I must be run on the console\n"); - return 1; - } - - while(1) { /* read data */ - FD_ZERO(&fds); - FD_SET(gpm_fd, &fds); - - if(select(gpm_fd + 1, &fds, 0, 0, 0) < 0 && errno == EINTR) - continue; - if(FD_ISSET(gpm_fd, &fds)) { - Gpm_Event evt; - - if(Gpm_GetEvent(&evt) > 0) { - display_data(&evt); - } else { - printf("Gpm_GetEvent failed\n"); - } - } - } - - Gpm_Close(); /* close connection */ - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/get-versions.c b/software/gpm/browse_source/gpm-1.99.7/src/prog/get-versions.c deleted file mode 100644 index 8d040b2a..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/get-versions.c +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * Get gpm library and server version - * - * Copyright 2007-2008 Nico Schottelius - * - * 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. - * - * Compile and link with: gcc -lgpm - * - ********/ - -#include /* printf() */ -#include /* gpm information */ - -int main() -{ - char *ver; - - int intver; - - ver = Gpm_GetLibVersion(&intver); - printf("lib: %s, %d\n", ver, intver); - - ver = Gpm_GetServerVersion(&intver); - printf("srv: %s, %d\n", ver, intver); - - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/gpm-root.y b/software/gpm/browse_source/gpm-1.99.7/src/prog/gpm-root.y deleted file mode 100644 index f657c494..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/gpm-root.y +++ /dev/null @@ -1,1320 +0,0 @@ -/* - * gpm-root.y - a default-handler for mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:16:45 +0000, modified by James Troup : - * (get_winsize): use /dev/tty0 not /dev/console. - * gpm-root.y (f.debug): disable undocumented f.debug function because it uses a - * file in /tmp in a fashion which invites symlink abuse. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ********/ - -%{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* sigaction() */ -#include /* pwd entries */ -#include /* initgroups() */ -#include /* KDGETMODE */ -#include /* fstat() */ -#include /* uname() */ -#include /* winsize */ -#include /* VT_ACTIVATE */ -#include /* K_SHIFT */ -#include -#include - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#else -#define major(dev) (((unsigned) (dev))>>8) -#define minor(dev) ((dev)&0xff) -#endif - - -#define GPM_NULL_DEV "/dev/null" - -#ifdef HAVE_LINUX_MAJOR_H -#include -#else -#define VCS_MAJOR 7 -#endif - -#define MAX_NR_USER_CONSOLES 63 /* needs __KERNEL__ */ - -#include "message.h" -#include "gpm.h" - -#ifdef DEBUG -#define YYDEBUG 1 -#else -#undef YYDEBUG -#endif - -#define USER_CFG ".gpm-root" -#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" - -#define DEFAULT_FORE 7 -#define DEFAULT_BACK 0 -#define DEFAULT_BORD 7 -#define DEFAULT_HEAD 7 - -/* These macros are useful to avoid curses. The program is unportable anyway */ -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) -#define FORECOLOR(f,c) fprintf(f,"\x1B[%i;3%cm",(c)&8?1:22,colLut[(c)&7]+'0') -#define BACKCOLOR(f,c) fprintf(f,"\x1B[4%cm",colLut[(c)&7]+'0') - -/* These defines are ugly hacks but work */ -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - -int colLut[]={0,4,2,6,1,5,3,7}; - -char *prgname; -char *consolename; -int run_status = GPM_RUN_STARTUP; -struct winsize win; -int disallocFlag=0; -struct node {char *name; int flag;}; - -struct node tableMod[]= { - {"shift", 1< T_STRING -%token T_BACK T_FORE T_BORD T_HEAD -%token T_BRIGHT T_COLOR T_NAME - -%token T_BUTTON -%token T_FUNC T_FUN2 -%type bright button -%type menu file -%type item items itemlist -%% /* begin grammar #########################################################*/ - -file: /* empty */ {$$=cfgall=NULL;} - | file button menu {$3->buttons=$2; $3->next=$1; $$=cfgall=$3;} - ; - -button: T_BUTTON '1' {$$=GPM_B_LEFT;} - | T_BUTTON '2' {$$=GPM_B_MIDDLE;} - | T_BUTTON '3' {$$=GPM_B_RIGHT;} - ; - -menu: '{' {$$=cfgcurrent=cfg_alloc();} - configs itemlist '}' {$$=$2; $$->menu=$4;} - ; - -configs: /* empty */ | configs cfgpair ; - -cfgpair: T_NAME T_STRING {cfgcurrent->title=$2;} - | T_BACK T_COLOR {cfgcurrent->back=$2;} - | T_FORE bright T_COLOR {cfgcurrent->fore=$3|$2;} - | T_BORD bright T_COLOR {cfgcurrent->bord=$3|$2;} - | T_HEAD bright T_COLOR {cfgcurrent->head=$3|$2;} - ; - -bright: /* empty */ {$$=0;} | T_BRIGHT {$$=8;} ; - -itemlist: item items {$$=cfg_cat($1,$2);} ; - -items: /* empty */ {$$=NULL;} - | items item {$$= $1 ? cfg_cat($1,$2) : $2;} - ; - -item: T_STRING T_FUNC {$$=cfg_makeitem('F',$1,$2, NULL);} - | T_STRING T_FUN2 T_STRING {$$=cfg_makeitem('2',$1,$2, $3);} - | T_STRING menu {$$=cfg_makeitem('M',$1,NULL,$2);} - ; - -%% /* end grammar ###########################################################*/ - -int yyerror(char *s) -{ - fprintf(stderr,"%s:%s(%i): %s\n",prgname,cfgname,cfglineno,s); - return 1; -} - -int yywrap() -{ - return 1; -} - -struct tokenName { - char *name; - int token; - int value; - }; -struct tokenName tokenList[] = { - {"foreground",T_FORE,0}, - {"background",T_BACK,0}, - {"border", T_BORD,0}, - {"head", T_HEAD,0}, - {"name", T_NAME,0}, - {"button", T_BUTTON,0}, - {"black", T_COLOR,0}, - {"blue", T_COLOR,1}, - {"green", T_COLOR,2}, - {"cyan", T_COLOR,3}, - {"red", T_COLOR,4}, - {"magenta", T_COLOR,5}, - {"yellow", T_COLOR,6}, - {"white", T_COLOR,7}, - {"bright", T_BRIGHT,0}, - {NULL,0,0} - }; - -struct funcName { - char *name; - int token; - int (*fun)(); - }; -struct funcName funcList[] = { - {"f.bgcmd",T_FUN2,f_bgcmd}, - {"f.jptty",T_FUN2,f_jptty}, - {"f.mktty",T_FUNC,f_mktty}, - {"f.menu",T_FUNC,f_menu}, - {"f.load",T_FUNC,f_load}, - {"f.free",T_FUNC,f_free}, - {"f.time",T_FUNC,f_time}, - {"f.pipe",T_FUN2,f_pipe}, - {"f.nop",T_FUNC,NULL}, - {NULL,0,NULL} -}; - -/*---------------------------------------------------------------------*/ -int yylex(void) -{ - int c,i; - char s[80]; - struct tokenName *tn; - struct funcName *fn; - - while(1) { - i=0; - switch(c=getc(cfgfile)) { - case EOF: fclose(cfgfile); return 0; - case '\"': - do { - s[i]=getc(cfgfile); - if ((s[i])=='\n') { - yyerror("unterminated string"); - cfglineno++; - } - if (s[i]=='\\') s[i]=getc(cfgfile); - } /* get '"' as '\"' */ while (s[i++]!='\"' && s[i-2] !='\\') ; - s[i-1]=0; - yylval.string=(char *)strdup(s); - return T_STRING; - - case '#': while ( (c=getc(cfgfile)!='\n') && c!=EOF) ; - case '\n': cfglineno++; - case ' ': /* fall through */ - case '\t': continue; - default: if (!isalpha(c)) return(c); - } - /* get a single word and convert it */ - do { - s[i++]=c; - } while (isalnum(c=getc(cfgfile)) || c=='.'); - ungetc(c,cfgfile); - s[i]=0; - for (tn=tokenList; tn->name; tn++) - if (tn->name[0]==s[0] && !strcmp(tn->name,s)) { - yylval.silly=tn->value; - return tn->token; - } - for (fn=funcList; fn->name; fn++) - if (fn->name[0]==s[0] && !strcmp(fn->name,s)) { - yylval.fun=fn->fun; - return fn->token; - } - yylval.string=(char *)strdup(s); return T_STRING; - } -} - -/*---------------------------------------------------------------------*/ -void cfg_free(Draw *what) -{ - Draw *ptr; - DrawItem *item; - - for (ptr=what; ptr; ptr=ptr->next) { - if (ptr->title) free(ptr->title); - for (item=ptr->menu; item; item=item->next) { - if (item->name) free(item->name); - if (item->arg) free(item->arg); - if (item->type=='M' && item->clientdata) { - ((Draw *)(item->clientdata))->next=NULL; /* redundant */ - cfg_free(item->clientdata); - } - if (item->clientdata) free(item->clientdata); - } - } -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty Draw */ -Draw *cfg_alloc(void) -{ - Draw *new=calloc(1,sizeof(Draw)); - - if (!new) return NULL; - new->back=DEFAULT_BACK; - new->fore=DEFAULT_FORE; - new->bord=DEFAULT_BORD; - new->head=DEFAULT_HEAD; - - return new; -} - -/*---------------------------------------------------------------------*/ -/* malloc an empty DrawItem and fill it */ -DrawItem *cfg_makeitem(int mode, char *msg, int(*fun)(), void *detail) -{ - DrawItem *new=calloc(1,sizeof(DrawItem)); - - if (!new) return NULL; - - new->name=(char *)strdup(msg); - new->type=mode; - switch(mode) { - case '2': /* a function with one arg */ - new->arg=(char *)strdup(detail); - /* fall through */ - - case 'F': /* a function without args */ - new->fun=fun; - if (fun) fun(F_CREATE,new); - break; - - case 'M': - new->clientdata=detail; - new->fun=f_menu; - break; - - default: fprintf(stderr,"%s: unknown item type (can't happen)\n",prgname); - } - - return new; -} - -/*---------------------------------------------------------------------*/ -/* concatenate two item lists */ -DrawItem *cfg_cat(DrawItem *d1, DrawItem *d2) -{ - DrawItem *tmp; - - for (tmp=d1; tmp->next; tmp=tmp->next) ; - tmp->next=d2; - return d1; -} - -/*====================================================================*/ -void f__fix(struct passwd *pass) -{ - if (setgid(pass->pw_gid) < 0 || - initgroups(pass->pw_name, pass->pw_gid) < 0 || - setuid(pass->pw_uid) < 0) - exit(1); - setenv("HOME", pass->pw_dir, 1); - setenv("LOGNAME", pass->pw_name,1); - setenv("USER", pass->pw_name,1); -} - -/*---------------------------------------------------------------------*/ -int f_bgcmd(int mode, DrawItem *self, int uid) -{ - int i; - struct passwd *pass; - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - switch(fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: - pass=getpwuid(uid); - if (!pass) exit(1); - f__fix(pass); /* setgid(), setuid(), setenv(), ... */ - close(0); close(1); close(2); - open("/dev/null",O_RDONLY); /* stdin */ - open(consolename,O_WRONLY); /* stdout */ - dup(1); /* stderr */ - int open_max = sysconf(_SC_OPEN_MAX); - if (open_max == -1) open_max = 1024; - for (i=3;iarg,(char *)NULL); - exit(1); /* shouldn't happen */ - default: return 0; - - } - } - return 0; -} -/*---------------------------------------------------------------------*/ -int f_jptty(int mode, DrawItem *self, int uid) -{ - int i,fd; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - switch (mode) { - case F_CREATE: - case F_POST: break; - case F_INVOKE: - i=atoi(self->arg); - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_ACTIVATE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_WAITACTIVE, i)<0) { - gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno)); - return 1; - } - default: return 0; - } - return 0; /* silly gcc -Wall */ -} - -/*---------------------------------------------------------------------*/ -/* This array registers spawned consoles */ -static int consolepids[1+MAX_NR_USER_CONSOLES]; - -int f_mktty(int mode, DrawItem *self, int uid) -{ - int fd, pid; - int vc; - char name[10]; - switch (mode) { - case F_CREATE: self->arg=malloc(8); - case F_POST: break; - case F_INVOKE: - fd=open(consolename,O_RDWR); - if (fd<0) { - gpm_report(GPM_PR_ERR,"%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - if (ioctl(fd, VT_OPENQRY, &vc)<0) { - gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno)); - return 1; - } /*if*/ - switch(pid=fork()) { - case -1: - gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno)); - return 1; - case 0: /* child: exec getty */ - sprintf(name,"tty%i",vc); - execl("/sbin/mingetty","mingetty",name,(char *)NULL); - exit(1); /* shouldn't happen */ - default: /* father: jump to the tty */ - gpm_report(GPM_PR_INFO,"Registering child %i on console %i" - ,pid,vc); - consolepids[vc]=pid; - sprintf(self->arg,"%i",vc); - return f_jptty(mode,self,uid); - } - default: return 0; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_menu(int mode, DrawItem *self, int uid) -{ - mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ - return 0; /* just a placeholder, recursion is performed in main() */ -} - - -/*---------------------------------------------------------------------*/ -int f_load(int mode, DrawItem *self, int uid) -{ - uid = 0; /* FIXME: gpm 1.99.13 */ - FILE *f; - double l1,l2,l3; - - l1=l2=l3=0.0; - - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+20); - self->name=realloc(self->name,strlen(self->name)+20); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2f %5.2f %5.2f"); - sprintf(self->name,self->clientdata,l1,l2,l3); - break; - - case F_POST: - if (!(f=fopen("/proc/loadavg","r"))) return 1; - fscanf(f,"%lf %lf %lf",&l1,&l2,&l3); - sprintf(self->name,self->clientdata,l1,l2,l3); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_free(int mode, DrawItem *self, int uid) -{ - FILE *f; - long l1,l2; - char s[80]; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - l1=l2=0; - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=malloc(strlen(self->name)+30); - self->name=realloc(self->name,strlen(self->name)+30); - strcpy(self->clientdata,self->name); - strcat(self->clientdata," %5.2fM mem + %5.2fM swap"); - sprintf(self->name,self->clientdata,(double)l1,(double)l2); - break; - - case F_POST: - if (!(f=fopen("/proc/meminfo","r"))) return 1; - fgets(s,80,f); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l1); - fgets(s,80,f); sscanf(s,"%*s %*s %*s %li",&l2); - sprintf(self->name,self->clientdata, - (double)l1/1024/1024,(double)l2/1024/1024); - fclose(f); - - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_time(int mode, DrawItem *self, int uid) { - char s[128]; - struct tm *broken; - time_t t; - - uid = 0; /* FIXME: gpm 1.99.13 */ - - time(&t); broken=localtime(&t); - switch (mode) { - case F_CREATE: /* modify name, just to fake its length */ - self->clientdata=self->name; - strftime(s,110,self->clientdata,broken); - strcat(s,"1234567890"); /* names can change length */ - self->name=(char *)strdup(s); - /* rewrite the right string */ - strftime(self->name,110,self->clientdata,broken); - break; - - case F_POST: strftime(self->name,120,self->clientdata,broken); - case F_INVOKE: break; - } - return 0; -} - -/*---------------------------------------------------------------------*/ -int f_pipe(int mode, DrawItem *self, int uid) -{ - mode = 0; self = NULL; uid = 0; /* FIXME: gpm 1.99.13 */ - return 0; -} - -/*====================================================================*/ -int fixone(Draw *ptr, int uid) -{ - int hei,wid; - DrawItem *item; - - ptr->uid=uid; - hei=0; wid= ptr->title? strlen(ptr->title)+2 : 0; - - /* calculate width and height */ - for (item=ptr->menu; item; item=item->next) { - hei++; - wid= wid > (int) strlen(item->name) ? wid : (int) strlen(item->name); - } - ptr->height=hei+2; - ptr->width=wid+2; - - /* fix paddings and recurse */ - for (item=ptr->menu; item; item=item->next) { - item->pad=(ptr->width-strlen(item->name ? item->name : ""))/2; - if (item->fun==f_menu) fixone((Draw *)item->clientdata,uid); - } - return 0; -} - - -/* read menus from a file, and return a list or NULL */ -Draw *cfg_read(int uid) -{ - Draw *ptr; - - if (!(cfgfile=fopen(cfgname,"r"))) { - gpm_report(GPM_PR_ERR, "%s: %s", cfgname, strerror(errno)); - return NULL; - } - gpm_report(GPM_PR_INFO,"Reading file %s",cfgname); - cfglineno=1; - if (yyparse()) { - cfg_free(cfgall); - cfgall=NULL; - return NULL; - } - - /* handle recursion */ - for (ptr=cfgall; ptr; ptr=ptr->next) { - fixone(ptr,uid); - } - - return cfgall; -} - - -/*---------------------------------------------------------------------*/ -/* the return value tells whether it has been newly loaded or not */ -int getdraw(int uid, int buttons, time_t mtime1, time_t mtime2) -{ - struct passwd *pass; - struct stat buf; - Draw *new, *np, *op, *pp; - int retval=0; - time_t mtime; - - gpm_report(GPM_PR_DEBUG,"getdraw: %i %i %li %li",uid,buttons,mtime1,mtime2); - pass=getpwuid(uid); - - /* deny personal cfg to root for security reasons */ - if (pass==NULL || !uid || !opt_user) { - mtime=mtime2; uid=-1; - strcpy(cfgname,SYSTEM_CFG); - } else { - mtime=mtime1; - strcpy(cfgname,pass->pw_dir); - strcat(cfgname,"/" USER_CFG); - } - - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_DEBUG,"stat (%s) failed",cfgname); - /* try the system wide */ - mtime=mtime2; uid = -1; - strcpy(cfgname,SYSTEM_CFG); - if (stat(cfgname,&buf)==-1) { - gpm_report(GPM_PR_ERR,"stat (%s) failed",cfgname); - return 0; - } - } - - if (buf.st_mtime <= mtime) return 0; - - /* else, read the new drawing tree */ - new=cfg_read(uid); - if (!new) return 0; - - /* scan old data to remove duplicates */ - for (np=pp=new; np; pp=np, np=np->next) { - np->mtime=buf.st_mtime; - if (np->buttons==buttons) retval++; - for (op=drawList; op; op=op->next) - if (op->uid==np->uid && op->buttons==np->buttons) - op->buttons=0; /* mark for deletion */ - } - - /* chain in */ - pp->next=drawList; drawList=new; - - /* actually remove fake entries */ - for (np=drawList; np; pp=np, np=np->next) - if (!np->buttons) { - pp->next=np->next; - np->next=NULL; - cfg_free(np); - np=pp; - } - return retval; /* found or not */ -} - - -/*---------------------------------------------------------------------*/ -Draw *retrievedraw(int uid, int buttons) -{ - Draw *drawPtr, *genericPtr=NULL; - - /* retrieve a drawing by scanning the list */ - do { - for (drawPtr=drawList; drawPtr; drawPtr=drawPtr->next) { - if (drawPtr->uid==uid && drawPtr->buttons==buttons) break; - if (drawPtr->uid==-1 && drawPtr->buttons==buttons) genericPtr=drawPtr; - } - } while (getdraw(uid,buttons, - drawPtr ? drawPtr->mtime : 0, - genericPtr ? genericPtr->mtime :0)); - - - return drawPtr ? drawPtr : genericPtr; -} - - -/*=====================================================================*/ -int usage(void) -{ - printf( GPM_MESS_VERSION "\n" - "Usage: %s [options]\n",prgname); - printf(" Valid options are\n" - " -m modifier to use\n" - " -u inhibit user configuration files\n" - " -D don't auto-background and run as daemon\n" - " -V increase amount of logged messages\n" - ); - - return 1; -} - -/*------------*/ -int getmask(char *arg, struct node *table) -{ - int last=0, value=0; - char *cur; - struct node *n; - - if (isdigit(arg[0])) return atoi(arg); - - while (1) { - while (*arg && !isalnum(*arg)) arg++; /* skip delimiters */ - cur=arg; - while(isalnum(*cur)) cur++; /* scan the word */ - if (!*cur) last++; - *cur=0; - - for (n=table;n->name;n++) - if (!strcmp(n->name,arg)) { - value |= n->flag; - break; - } - if(!n->name) fprintf(stderr,"%s: Incorrect flag \"%s\"\n",prgname,arg); - if (last) break; - cur++; arg=cur; - } - - return value; -} - -/*------------*/ -int cmdline(int argc, char **argv) -{ - int opt; - - run_status = GPM_RUN_STARTUP; - while ((opt = getopt(argc, argv,"m:uDV::")) != -1) { - switch (opt) { - case 'm': opt_mod=getmask(optarg, tableMod); break; - case 'u': opt_user=0; break; - case 'D': run_status = GPM_RUN_DEBUG; break; - case 'V': - /*gpm_debug_level += (0==optarg ? 1 : strtol(optarg,0,0)); */ - break; - default: return 1; - } - - } - return 0; -} - - - -/*------------* - * This buffer is passed to set_selection, and the only meaningful value - * is the last one, which is the mode: 4 means "clear_selection". - * however, the byte just before the 1th short must be 2 which denotes - * the selection-related stuff in ioctl(TIOCLINUX). - */ - -static unsigned short clear_sel_args[6]={0, 0,0, 0,0, 4}; -static unsigned char *clear_sel_arg= (unsigned char *)clear_sel_args+1; - -/*------------*/ -static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int dumpfd; - char dumpname[20]; - - f = NULL; - - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_RDONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - read(dumpfd,buffer,4); - read(dumpfd,buffer+4,2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*------------*/ -static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc) -{ - int x,y, dumpfd; - char dumpname[20]; - - f = NULL; - - x=buffer[2]; y=buffer[3]; - - /* WILL NOT WORK WITH DEVFS! FIXME! */ - sprintf(dumpname,"/dev/vcsa%i",vc); - dumpfd=open(dumpname,O_WRONLY); - if (dumpfd<0) { - gpm_report(GPM_PR_ERR,"%s: %s", dumpname, strerror(errno)); - return; - } /*if*/ - clear_sel_arg[0]=2; /* clear_selection */ - ioctl(fd,TIOCLINUX,clear_sel_arg); - write(dumpfd,buffer,4+2*buffer[0]*buffer[1]); - close(dumpfd); -} - -/*===================================================================*/ -/* post and unpost menus from the screen */ -static int postcount; -static Posted *activemenu; - -#if __BYTE_ORDER == __BIG_ENDIAN -#define bigendian 1 -#else -#define bigendian 0 -#endif - -Posted *postmenu(int fd, FILE *f, Draw *draw, int x, int y, int console) -{ - Posted *new; - DrawItem *item; - unsigned char *dump; - unsigned char *curr, *curr2; - int i; - short lines,columns; - - new=calloc(1,sizeof(Posted)); - if (!new) return NULL; - new->draw=draw; - new->dump=dump=malloc(opt_buf); - scr_dump(fd,f,dump,console); - lines=dump[0]; columns=dump[1]; - i=(columns*dump[3]+dump[2])*2+1; /* where to get it */ - if (i<0) i=1; - new->colorcell=dump[4+i-bigendian]; - gpm_report(GPM_PR_DEBUG,"Colorcell=%02x (at %i,%i = %i)", - new->colorcell,dump[2],dump[3],i-bigendian); - - /* place the box relative to the mouse */ - if (!postcount) x -= draw->width/2; else x+=2; - y++; - - /* fit inside the screen */ - if (x<1) x=1; - if (x+draw->width >= columns) x=columns-1-draw->width; - if (y+draw->height > lines+1) y=lines+1-draw->height; - new->x=x; new->X=x+draw->width-1; - new->y=y; new->Y=y+draw->height-1; - - /* these definitions are dirty hacks, but they help in writing to the screen */ -#if __BYTE_ORDER == __BIG_ENDIAN -#define PUTC(c,f,b) (*(curr++)=((b)<<4)+(f),*(curr++)=(c)) -#else -#define PUTC(c,f,b) (*(curr++)=(c),*(curr++)=((b)<<4)+(f)) -#endif -#define PUTS(s,f,b) for(curr2=s;*curr2;PUTC(*(curr2++),f,b)) -#define GOTO(x,y) (curr=dump+4+2*((y)*columns+(x))) - - x--; y--; /* /dev/vcs is zero based */ - ioctl(fd,TCXONC,TCOOFF); /* inhibit further prints */ - dump=malloc(opt_buf); - memcpy(dump,new->dump,opt_buf); /* dup the buffer */ - /* top border */ - GOTO(x,y); - PUTC(ULCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(URCORNER,draw->bord,draw->back); - if (draw->title) { - GOTO(x+(draw->width-strlen(draw->title))/2,y); - PUTC(' ',draw->head,draw->back); - PUTS((unsigned char *)draw->title,draw->head,draw->back); - PUTC(' ',draw->head,draw->back); - } - /* sides and items */ - for (item=draw->menu; y++, item; item=item->next) { - if (item->fun) (*(item->fun))(F_POST,item); - GOTO(x,y); PUTC(VERLINE,draw->bord,draw->back); - for (i=0;ipad;i++) PUTC(' ',draw->fore,draw->back); - PUTS((unsigned char *)item->name,draw->fore,draw->back); i+=strlen(item->name); - while (i++width) PUTC(' ',draw->fore,draw->back); - PUTC(VERLINE,draw->bord,draw->back); - } - /* bottom border */ - GOTO(x,y); - PUTC(LLCORNER,draw->bord,draw->back); - for (i=0; iwidth; i++) PUTC(HORLINE,draw->bord,draw->back); - PUTC(LRCORNER,draw->bord,draw->back); - - scr_restore(fd,f,dump,console); - free(dump); - -#undef PUTC -#undef PUTS -#undef GOTO - - new->prev=activemenu; - activemenu=new; - postcount++; - return new; -} - -Posted *unpostmenu(int fd, FILE *f, Posted *which, int vc) -{ - Posted *prev=which->prev; - - scr_restore(fd,f,which->dump, vc); - ioctl(fd,TCXONC,TCOON); /* activate the console */ - free(which->dump); - free(which); - activemenu=prev; - postcount--; - return prev; -} - - -void reap_children(int signo) -{ - int i, pid; - signo = 0; /* FIXME in 1.99.13 */ - pid=wait(&i); - gpm_report(GPM_PR_INFO,"pid %i exited %i",pid,i); - - if (disallocFlag) - gpm_report(GPM_PR_INFO,"Warning, overriding logout from %i",disallocFlag); - for (i=1;i<=MAX_NR_USER_CONSOLES; i++) - if (consolepids[i]==pid) { - disallocFlag=i; - consolepids[i]=0; - gpm_report(GPM_PR_INFO,"Registering disallocation of console %i",i); - break; - } -} - - -void get_winsize(void) -{ - int fd; - - if ((fd=open(consolename,O_RDONLY))<0) { - fprintf(stderr,"%s: ",prgname); perror(consolename); - exit(1); - } - ioctl(fd, TIOCGWINSZ, &win); - opt_buf=win.ws_col*win.ws_row; - close(fd); - - opt_buf +=4; /* 2:size, 1:terminator, 1:alignment */ - opt_buf*=2; /* the new scrdump and /dev/vcsa returns color info as well */ -} - - -/*===================================================================*/ -static int do_resize=0; -#if defined(__GLIBC__) -__sighandler_t winchHandler(int errno); -#else /* __GLIBC__ */ -void winchHandler(int errno); -#endif /* __GLIBC__ */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - Gpm_Event ev; - int vc, fd=-1 ,uid=-1; - FILE *f=NULL; - struct stat stbuf; - Draw *draw=NULL; - DrawItem *item; - char s[80]; - int posty = 0, postx, postX; - struct sigaction childaction; - int evflag; - int recursenow=0; /* not on first iteration */ - - prgname=argv[0]; - consolename = Gpm_get_console(); - setuid(0); /* if we're setuid, force it */ - - if (getuid()) { - fprintf(stderr,"%s: Must be root\n", prgname); - exit(1); - } - - /* - * Now, first of all we need to check that /dev/vcs is there. - * But only if the kernel is new enough. vcs appeared in 1.1.82. - * If an actual open fails, a message on syslog will be issued. - */ - { - struct utsname linux_info; - int v1,v2,v3; - struct stat sbuf; - - if (uname(&linux_info)) { - fprintf(stderr,"%s: uname(): %s\n",prgname,strerror(errno)); - exit(1); - } - sscanf(linux_info.release,"%d.%d.%d",&v1,&v2,&v3); - if (v1*1000000 + v2*1000 +v3 < 1001082) { - fprintf(stderr,"%s: can't run with linux < 1.1.82\n",prgname); - exit(1); - } - - /* problems with devfs! FIXME! */ - if (stat("/dev/vcs0",&sbuf)<0 && stat("/dev/vcs",&sbuf)<0) { - fprintf(stderr,"%s: /dev/vcs0: %s\n",prgname,strerror(errno)); - fprintf(stderr,"%s: do you have vcs devices? Refer to the manpage\n", - prgname); - exit(1); - } else if (!S_ISCHR(sbuf.st_mode) || - VCS_MAJOR != major(sbuf.st_rdev) || - 0 != minor(sbuf.st_rdev)) { - fprintf(stderr,"Your /dev/vcs device looks funny\n"); - fprintf(stderr,"Refer to the manpage and possibly run the" - "create_vcs script in gpm source directory\n"); - exit(1); - } - } - - if (cmdline(argc,argv)) exit(usage()); - - openlog(prgname, LOG_PID|LOG_CONS, run_status == GPM_RUN_DAEMON ? - LOG_DAEMON : LOG_USER); - /* reap your zombies */ - childaction.sa_handler=reap_children; -#if defined(__GLIBC__) - __sigemptyset(&childaction.sa_mask); -#else /* __GLIBC__ */ - childaction.sa_mask=0; -#endif /* __GLIBC__ */ - childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ - sigaction(SIGCHLD,&childaction,NULL); - - /*....................................... Connect and get your buffer */ - - conn.eventMask=GPM_DOWN; - conn.defaultMask=GPM_MOVE; /* only ctrl-move gets the default */ - conn.maxMod=conn.minMod=opt_mod; - - gpm_zerobased=1; - - for (vc=4; vc-->0;) - { - extern int gpm_tried; /* liblow.c */ - gpm_tried=0; /* to enable retryings */ - if (Gpm_Open(&conn,-1)!=-1) - break; - if (vc) - sleep(2); - } - if (!vc) - { - gpm_report(GPM_PR_OOPS,"can't open mouse connection"); - } - - conn.eventMask=~0; /* grab everything away form selection */ - conn.defaultMask=GPM_MOVE & GPM_HARD; - conn.minMod=0; - conn.maxMod=~0; - - chdir("/"); - - - get_winsize(); - - /*....................................... Go to background */ - - if (run_status != GPM_RUN_DEBUG) { - switch(fork()) { - case -1: gpm_report(GPM_PR_OOPS,"fork()"); /* error */ - case 0: run_status = GPM_RUN_DAEMON; break; /* child */ - default: _exit(0); /* parent */ - } - - /* redirect stderr to /dev/console -- avoided now. - we should really cleans this more up! */ - fclose(stdin); fclose(stdout); - if (!freopen(GPM_NULL_DEV,"w",stderr)) { - gpm_report(GPM_PR_OOPS,"freopen(stderr)"); - } - if (setsid()<0) - gpm_report(GPM_PR_OOPS,"setsid()"); - - } /*if*/ - - /*....................................... Loop */ - - while((evflag=Gpm_GetEvent(&ev))!=0) - { - if (do_resize) {get_winsize(); do_resize--;} - - if (disallocFlag) - { - struct utmp *uu; - struct utmp u; - char s[8]; - int i=0; - - gpm_report(GPM_PR_INFO,"Disallocating %i",disallocFlag); - ioctl(fileno(stdin),VT_DISALLOCATE,&i); /* all of them */ - - sprintf(s,"tty%i",disallocFlag); - setutent(); - strncpy(u.ut_line, s, sizeof(u.ut_line)); - if ((uu = getutline(&u)) != 0) - { - uu->ut_type = DEAD_PROCESS ; - pututline(uu); - } - disallocFlag=0; - } - - if (evflag==-1) continue; /* no real event */ - - /* get rid of spurious events */ - if (ev.type&GPM_MOVE) continue; - - vc=ev.vc; - gpm_report(GPM_PR_DEBUG,"%s: event on console %i at %i, %i", - prgname,ev.vc,ev.x,ev.y); - - if (!recursenow) /* don't open on recursion */ - { - sprintf(s,"/dev/tty%i",ev.vc); - if (stat(s,&stbuf)==-1) continue; - uid = stbuf.st_uid; - gpm_report(GPM_PR_DEBUG,"uid = %i",uid); - - draw=retrievedraw(uid,ev.buttons); - if (!draw) continue; - - if (stat(s,&stbuf)==-1 || !(f=fopen(s,"r+"))) /* used to draw */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - continue; - } - - if ((fd=open(s,O_RDWR))<0) /* will O_RDONLY be enough? */ - { - gpm_report(GPM_PR_ERR, "%s: %s", s, strerror(errno)); - exit(1); - } - - /* now change your connection information and manage the console */ - Gpm_Open(&conn,-1); - uid=stbuf.st_uid; - } - - /* the task now is drawing the box from user data */ - if (!draw) - { - /* itz Thu Jul 2 00:02:53 PDT 1998 this cannot happen, see - continue statement above?!? */ - gpm_report(GPM_PR_ERR,"NULL menu ptr while drawing"); - continue; - } - postmenu(fd,f,draw,ev.x,ev.y,vc); - - while(Gpm_GetEvent(&ev)>0 && ev.vc==vc) - { - Gpm_FitEvent(&ev); - if (ev.type&GPM_DOWN) - break; /* we're done */ - Gpm_DrawPointer(ev.x,ev.y,fd); - } - gpm_report(GPM_PR_DEBUG,"%i - %i",posty,ev.y); - - /* ok, redraw, close and return waiting */ - gpm_report(GPM_PR_DEBUG,"Active is %p",activemenu->draw); - posty=activemenu->y; - postx=activemenu->x; - postX=activemenu->X; - - recursenow=0; item=NULL; /* by default */ - posty=ev.y-posty; - if (postx<=ev.x && ev.x<=postX) /* look for it */ - { - for (item=draw->menu; posty-- && item; item=item->next) - gpm_report(GPM_PR_DEBUG,"item %s (%p)",item->name, item->fun); - if (item && item->fun && item->fun==f_menu) - { - recursenow++; - draw=item->clientdata; - continue; - } - } - - /* unpost them all */ - while (unpostmenu(fd,f,activemenu,vc)) - ; - close(fd); - fclose(f); - Gpm_Close(); - recursenow=0; /* just in case... */ - - /* invoke the item */ - if (item && item->fun) - (*(item->fun))(F_INVOKE,item,uid); - } - - /*....................................... Done */ - - while (Gpm_Close()) ; /* close all the stack */ - exit(0); -} - -/* developers chat: - * author1 (possibly alessandro): - "This is because Linus uses 4-wide tabstops, forcing me to use the same - default to manage kernel sources" - * ian zimmermann (alias itz) on Wed Jul 1 23:28:13 PDT 1998: - "I don't mind what anybody's physical tab size is, but when I load it into - the editor I don't want any wrapping lines." - * nico schottelius (january 2002): - "Although Linux document /usr/src/linux/Documentation/CodingStyle is mostly - correct, I agree with itz to avoid wrapping lines. Merging 4(alessandro) - /2(itz) spaces makes 3 which is the current standard." - */ - -/* Local Variables: */ -/* tab-width:3 */ -/* c-indent-level: 3 */ -/* End: */ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/hltest.c b/software/gpm/browse_source/gpm-1.99.7/src/prog/hltest.c deleted file mode 100644 index 75fe2ea7..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/hltest.c +++ /dev/null @@ -1,635 +0,0 @@ - -/* - * hltest.c - a demo program for the high-level library. - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * - * 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. - ********/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpm.h" - -#ifndef min -# define min(a,b) ((a)>(b)?(b):(a)) -# define max(a,b) ((a)>(b)?(a):(b)) -#endif - -/* - * If you happen to read this source to get insights about mouse - * management, note that most of this file is concerned with user - * interface and screen handling. The mouse-related part begines - * at "MOUSE-BEGIN" (so you can use your editor capabilities to - * look for strings). - * - * If you use parts of this program in your own one, I'd like some credit. - * If you want to overcome the gnu copyleft though using parts of this - * program, just tell me about it, and I'll change the copyright. - */ - -/* this is used as clientdata */ - -typedef struct WinInfo { - char color; - int number; - short hei, wid; - Gpm_Roi *roi; -} WinInfo; - -WinInfo left_cldata; /* for the msg bar */ - -int colors[] = { 0x40, 0x60, 0x20, 0x30, 0x47, 0x67, 0x27, 0x37 }; - -#define NR_COLORS 8 -#define LEFTWID 22 - -/* Dirty: use escape sequences and /dev/vcs (don't want to learn curses) */ - -#define CLEAR (printf("\x1b[H\x1b[J"),fflush(stdout)) - -int dev_vcs = -1; - -int wid, hei, vcsize; - -/* - * These two functions are only involved in the user interface: - * dump and restore the screen to keep things up to date. - */ - -unsigned short clear_sel_args[6] = { 0, 0, 0, 0, 0, 4 }; - -unsigned char *clear_sel_arg = (unsigned char *) clear_sel_args + 1; - -static inline int scrdump(char *buf) -{ - clear_sel_arg[0] = 2; /* clear_selection */ - ioctl(fileno(stdin), TIOCLINUX, clear_sel_arg); - lseek(dev_vcs, 0, SEEK_SET); - return read(dev_vcs, buf, vcsize); -} - -static inline int scrrestore(char *buf) -{ - clear_sel_arg[0] = 2; /* clear_selection */ - ioctl(fileno(stdin), TIOCLINUX, clear_sel_arg); - lseek(dev_vcs, 0, SEEK_SET); - return write(dev_vcs, buf, vcsize); -} - -/* I don't like curses, so I'm doing low level stuff here */ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin), &it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK | ISTRIP | IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin), TCSANOW, &it); - -} - -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin), &it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin), TCSANOW, &it); -} - -/* this one is the signal handler */ - -void killed(int signo) -{ - CLEAR; - fprintf(stderr, "hltest: killed by signal %i\r\n", signo); - noraw(); - exit(0); -} - -char *dumpbuf; - -char *dumpbuf_clean; - -#define DUMPCHAR(x,y) (dumpbuf+4+2*((y)*wid+(x))) -#define DUMPATTR(x,y) (dumpbuf+5+2*((y)*wid+(x))) - -/* - * This function draws one window on top of the others - */ - -static inline int drawwin(Gpm_Roi * which) -{ - char *curr; - - char name[5]; - -#define GOTO(x,y) (curr=DUMPCHAR(x,y)) -#define PUTC(c,a) (*(curr++)=(c),*(curr++)=a) -#define ULCORNER 0xc9 -#define URCORNER 0xbb -#define LLCORNER 0xc8 -#define LRCORNER 0xbc -#define HORLINE 0xcd -#define VERLINE 0xba - - int attrib = ((WinInfo *) which->clientdata)->color; - - int i, j; - - /* - * top border - */ - GOTO(which->xMin, which->yMin); - PUTC(ULCORNER, attrib); - for(i = which->xMin + 1; i < which->xMax; i++) - PUTC(HORLINE, attrib); - PUTC(URCORNER, attrib); - - /* - * sides and items - */ - for(j = which->yMin + 1; j < which->yMax; j++) { - GOTO(which->xMin, j); - PUTC(VERLINE, attrib); - for(i = which->xMin + 1; i < which->xMax; i++) - PUTC(' ', attrib); - PUTC(VERLINE, attrib); - } - - /* - * bottom border - */ - GOTO(which->xMin, which->yMax); - PUTC(LLCORNER, attrib); - for(i = which->xMin + 1; i < which->xMax; i++) - PUTC(HORLINE, attrib); - PUTC(LRCORNER, attrib); - - /* - * name - */ - sprintf(name, "%3i", ((WinInfo *) which->clientdata)->number); - GOTO(which->xMin + 1, which->yMin + 1); - for(i = 0; name[i]; i++) - PUTC(name[i], attrib); - return 0; -} - -/* and finally, draw them all (recursive) */ - -int drawthemall(Gpm_Roi * this) -{ - if(this->next) - drawthemall(this->next); - else - memcpy(dumpbuf, dumpbuf_clean, vcsize); - - return drawwin(this); -} - -/* - * This one writes all the messages in the right position - */ - -int newmsg(int window, char *msg) -{ - static char *data = NULL; - - static char **strings; - - static int current, last; - - static time_t t; - - int i, j; - - /* - * first time, alloc material - */ - if(!data) { - data = malloc((LEFTWID - 2) * (hei - 2)); - strings = malloc(hei * sizeof(char *)); - if(!data || !strings) { - perror("malloc()"); - exit(1); - } - memset(data, ' ', (LEFTWID - 2) * (hei - 2)); - for(i = 0; i < hei - 2; i++) - strings[i] = data + (LEFTWID - 2) * i, strings[i][19] = '\0'; - current = 0; - } - - if(msg) { /* if sth new */ - time(&t); - strftime(strings[current], 15, "%M:%S ", localtime(&t)); - sprintf(strings[current] + strlen(strings[current]), "%i: ", window); - strncat(strings[current], msg, LEFTWID - 2 - strlen(strings[current])); - for(i = strlen(strings[current]); i < 19; i++) - strings[current][i] = ' '; - strings[current][i] = 0; - last = current; - current++; - current %= (hei - 2); - } else /* draw them all */ - for(i = 1, j = current; j %= (hei - 2), i < hei - 2; i++, j++) - printf("\x1B[%03i;%03iH%s", j + 2, 2, strings[j]); /* y and x */ - - /* - * write only the current one - */ - printf("\x1B[%03i;%03iH%s\x1B[%03i;%03iH%s", - last + 2, 2, strings[last], current + 2, 2, " "); - fflush(stdout); - return 0; -} - -/* - * Wrapper: refresh the whole screen - */ -static inline void dorefresh(void) -{ - static unsigned short clear_sel_args[6] = { 0, 0, 0, 0, 0, 4 }; - static unsigned char *clear_sel_arg = (unsigned char *) clear_sel_args + 1; - - drawthemall(gpm_roi); - clear_sel_arg[0] = 2; /* clear_selection */ - ioctl(fileno(stdin), TIOCLINUX, clear_sel_arg); - scrrestore(dumpbuf); - newmsg(0, NULL); -} - -/*============================================================ MOUSE-BEGIN */ - -/* - * In this sample program, I use only one handler, which reports on the - * screen any event it gets. The clientdata received is the one I pass to - * Gpm_PushRoi on creation, and is used to differentiate them - */ - -int handler(Gpm_Event * ePtr, void *clientdata) -{ - WinInfo *info = clientdata; - - int number = info->number; - - int delta; - - if(ePtr->type & GPM_ENTER) { - newmsg(number, "enter"); - return 0; - } - if(ePtr->type & GPM_LEAVE) { - newmsg(number, "leave"); - return 0; - } - if(ePtr->type & GPM_MOVE) { - newmsg(number, "move"); - return 0; - } - - if(ePtr->type & GPM_DOWN) { - newmsg(number, "press"); - return 0; - } - if(ePtr->type & GPM_DRAG) { - newmsg(number, "drag"); - if(!(ePtr->buttons & GPM_B_LEFT)) - return 0; - - /* - * Implement window motion - */ - delta = 0; - if(ePtr->dx < 0) - delta = max(ePtr->dx, LEFTWID - info->roi->xMin); - else if(ePtr->dx > 0) - delta = min(ePtr->dx, wid - 1 - info->roi->xMax); - if(delta) { - info->roi->xMin += delta; - info->roi->xMax += delta; - } - - delta = 0; - if(ePtr->dy < 0) - delta = max(ePtr->dy, 0 - info->roi->yMin); - else if(ePtr->dy > 0) - delta = min(ePtr->dy, hei - 1 - info->roi->yMax); - if(delta) { - info->roi->yMin += delta; - info->roi->yMax += delta; - } - Gpm_RaiseRoi(info->roi, NULL); - dorefresh(); - return 0; - } - - newmsg(number, "release"); - -/* - * "up" events can be double or triple, - * moreover, they can happen out of the region - */ - - if(!(ePtr->type & GPM_SINGLE)) - return 0; - if(ePtr->x < 0 || ePtr->y < 0) - return 0; - if(ePtr->x > info->wid - 1 || ePtr->y > info->hei - 1) - return 0; - -/* - * Ok, it is has been a double click, and it is within our area - */ - - switch (ePtr->buttons) { - case GPM_B_LEFT: - Gpm_RaiseRoi(info->roi, NULL); - break; - case GPM_B_MIDDLE: - Gpm_LowerRoi(info->roi, NULL); - break; - case GPM_B_RIGHT: - Gpm_PopRoi(info->roi); - free(info); - break; - } - dorefresh(); - return 0; -} - -/* - * the following function creates a window, with the four corners as - * specified by the arguments. - */ -int wincreate(int x, int y, int X, int Y) -{ - static int winno = 0; - - Gpm_Roi *roi; - - WinInfo *cldata; - - int tmp; - - if(X < x) - tmp = X, X = x, x = tmp; - if(Y < y) - tmp = Y, Y = y, y = tmp; - if(X - x < 5) - X = x + 4; - if(Y - y < 3) - Y = y + 2; - if(X >= wid) - X = wid - 1; - if(Y >= hei) - Y = hei - 1; - if(x < LEFTWID) - x = LEFTWID; - if(y < 0) - y = 0; - - cldata = malloc(sizeof(WinInfo)); - roi = Gpm_PushRoi(x, y, X, Y, - GPM_DOWN | GPM_UP | GPM_DRAG | GPM_ENTER | GPM_LEAVE, - handler, cldata); - if(!cldata || !roi) { - perror("malloc()"); - exit(1); - } - - /* - * don't get modifiers - */ - roi->maxMod = 0; - - /* - * put a backpointer - */ - cldata->roi = roi; - - /* - * init the window - */ - winno++; - cldata->number = winno; - cldata->color = colors[winno % NR_COLORS]; - cldata->wid = X - x + 1; - cldata->hei = Y - y + 1; - dorefresh(); - return 0; -} - -/* - * This extra handler is only used for the background and left bar - */ - -int xhandler(Gpm_Event * ePtr, void *clientdata) -{ - static int x = 0, y = 0; - - int back = 0; - - char msg[32]; - - msg[0] = '\0'; - if(ePtr->type == GPM_MOVE) - return 0; - if(!clientdata) - strcpy(msg, "bg"), back++; - - if(ePtr->type & GPM_DOWN) { - strcat(msg, " down"); - if(back) - x = ePtr->x, y = ePtr->y; - } - if(ePtr->type & GPM_UP) { - strcat(msg, " up"); - if(back) - wincreate(x, y, ePtr->x, ePtr->y); - } - - newmsg(0, msg); - -/* GPM_DRAWPOINTER(ePtr); useless, gpm_visiblepointer is set to 1 BUG */ - return 0; -} - -/*============================================================ MOUSE-END */ - -/* - * This function is not interesting, it is only involved in setting up - * things. The real work has already been done. - */ - -int main(int argc, char **argv) -{ - Gpm_Connect conn; - - char *s, t[4]; - - char devname[32]; /* very secure buffer ... */ - - int c; - - int vc; - - struct winsize win; - - if(argc > 1) { - fprintf(stderr, "%s: This program is meant to be interactive, " - "no option is needed\n", argv[0]); - exit(1); - } - - if(!(s = ttyname(fileno(stdin)))) { - perror("stdin"); - exit(1); - } - - /* - * retrieve everything - */ - conn.eventMask = ~0; - conn.defaultMask = GPM_MOVE | GPM_HARD; - conn.maxMod = ~0; - conn.minMod = 0; - - if(sscanf(s, "/dev/tty%d%s", &vc, t) != 1) { - if(sscanf(s, "/dev/vc/%d%s", &vc, t) != 1) { - fprintf(stderr, "stdin: not a system console\n"); - exit(1); - } - } - - /* - * open your dump/restore buffers - */ - - sprintf(devname, "/dev/vcs%i", vc); - if((dev_vcs = open(devname, O_RDWR)) < 0) { - perror(devname); - sprintf(devname, "/dev/vcc/%i", vc); - if((dev_vcs = open(devname, O_RDWR)) < 0) { - perror(devname); - exit(1); - } - } - - if(Gpm_Open(&conn, 0) == -1) { - fprintf(stderr, "%s: Can't open mouse connection\n", argv[0]); - exit(1); - } - - Gpm_Close(); /* don't be clubbered by events now */ - - signal(SIGWINCH, killed); /* don't handle winchange */ - signal(SIGINT, killed); /* control-C kills us */ - - CLEAR; - - printf("\t\t\t This program is a demonstration of the use of the\n" - "\t\t\t high level gpm library. It is a tiny application\n" - "\t\t\t not really useful, but you may be interested in\n" - "\t\t\t reading the source (as well as the docs).\n\n" - "\t\t\tWorkings:\n" - "\t\t\t You can create windows by clicking on the background\n" - "\t\t\t and dragging out the desired size (minimun is 5x3).\n" - "\t\t\t The first 20 columns are reserved for messages.\n" - "\t\t\t there is always one invisible window on the backgruond\n" - "\t\t\t which gets shift-mouse events. All the others are only\n" - "\t\t\t sensitive to mouse-only events (the library leaves you\n" - "\t\t\t free about that, but this program makes things simple\n" - "\n" - "\t\t\t The left button raises the window\n" - "\t\t\t The middle (if any) lowers the window\n" - "\t\t\t The right one destroys the window\n\n" - "\t\t\t Keyboard focus is changed by mouse motion\n" - "\t\t\t Control-C kills the program\n\n" - "\t\t\tEnjoy\n\t\t\t The Author\n\n"); - - /* - * Ok, now retrieve window info, go to raw mode, and start it all - */ - - ioctl(fileno(stdin), TIOCGWINSZ, &win); - wid = win.ws_col; - hei = win.ws_row; - vcsize = hei * wid * 2 + 4; - dumpbuf = malloc(vcsize); - dumpbuf_clean = malloc(vcsize); - if(!dumpbuf || !dumpbuf_clean) { - perror("malloc()"); - exit(1); - } - scrdump(dumpbuf_clean); - - gpm_zerobased = 1; - gpm_visiblepointer = 1; - if(Gpm_Open(&conn, 0) == -1) { - fprintf(stderr, "%s: Can't open mouse connection\n", argv[0]); - exit(1); - } - - /* - * Prepare the leftish roi, and the catch-all on the background - */ - left_cldata.color = 0x07; - left_cldata.number = 0; - left_cldata.hei = hei; - left_cldata.wid = LEFTWID; - Gpm_PushRoi(0, 0, LEFTWID - 1, hei - 1, - GPM_DOWN | GPM_DRAG | GPM_UP | GPM_ENTER | GPM_LEAVE, - xhandler, &left_cldata); - gpm_roi_handler = xhandler; - gpm_roi_data = NULL; - - raw(); - newmsg(0, NULL); /* init data structures */ - while((c = Gpm_Getchar()) != EOF) { - char s[32]; - - Gpm_Roi *roi; - - roi = gpm_current_roi; - sprintf(s, "0x%x", c); - if(c > 0x1f && c < 0x7f) - sprintf(s + strlen(s), " ('%c')", c); - newmsg(roi ? ((WinInfo *) roi->clientdata)->number : 0, s); - } - - noraw(); - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/mev.c b/software/gpm/browse_source/gpm-1.99.7/src/prog/mev.c deleted file mode 100644 index c8f1c17c..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/mev.c +++ /dev/null @@ -1,619 +0,0 @@ - -/* - * mev.c - simple client to print mouse events (gpm-Linux) - * - * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * - * 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. - ********/ - -/* - * This client is meant to be used both interactively to check - * that gpm is working, and as a background process to convert gpm events - * to textual strings. I'm using it to handle Linux mouse - * events to emacs - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include /* to use KG_SHIFT and so on */ - -#define ALL_KEY_MODS ((1<type, - event->x, event->y, - event->dx, event->dy, event->buttons, event->modifiers); - - if(event->type & (GPM_DRAG | GPM_DOWN)) { - if(0 != opt_pointer) { - GPM_DRAWPOINTER(event); - } /* if */ - } /* if */ - return 0; -} - -/*-------------------------------------------------------------------*/ -int emacs_handler(Gpm_Event * event, void *data) -{ - int i, j; - - static int dragX, dragY; - - static char buffer[64]; - - data = NULL; /* FIXME: unused */ - - /* - * itz Mon Mar 23 20:54:54 PST 1998 emacs likes the modifier bits in - * alphabetical order, so I'll use a lookup table instead of a loop; it is - * faster anyways - */ - /* - * static char *s_mod[]={"S-","M-","C-","M-",NULL}; - */ - static char *s_mod[] = { - "", /* 000 */ - "S-", /* 001 */ - "M-", /* 002 */ - "M-S-", /* 003 */ - "C-", /* 004 */ - "C-S-", /* 005 */ - "C-M-", /* 006 */ - "C-M-S-", /* 007 */ - /* - * idea: maybe we should map AltGr to Emacs Alt instead of Meta? - */ - "M-", /* 010 */ - "M-S-", /* 011 */ - "M-", /* 012 */ - "M-S-", /* 013 */ - "C-M-", /* 014 */ - "C-M-S-", /* 015 */ - "C-M-", /* 016 */ - "C-M-S-", /* 017 */ - }; - /* - * itz Mon Mar 23 08:23:14 PST 1998 what emacs calls a `drag' event is our - * `up' event with coordinates different from the `down' event. What gpm - * calls `drag' is just `mouse-movement' to emacs. - */ - - static char *s_type[] = - { "mouse-movement", "mouse-movement", "down-mouse-", "mouse-", NULL }; - static char *s_button[] = { "3", "2", "1", NULL }; - static char *s_multi[] = { "double-", "triple-", 0 }; - static char s_count[] = "23"; - - char count = '1'; - - struct timeval tv_cur; - - long timestamp; - - static long dragTime; - - /* - * itz Mon Mar 23 08:27:53 PST 1998 this flag is needed because even if the - * final coordinates of a drag are identical to the initial ones, it is - * still a drag if there was any movement in between. Sigh. - */ - static int dragFlag = 0; - - gettimeofday(&tv_cur, 0); - timestamp = ((short) tv_cur.tv_sec) * 1000 + (tv_cur.tv_usec / 1000); - if(opt_fit) - Gpm_FitEvent(event); - buffer[0] = 0; - - /* - * itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand modifiers on - * motion events. - */ - if(!(event->type & (GPM_MOVE | GPM_DRAG))) { - /* - * modifiers - */ - strcpy(buffer, s_mod[event->modifiers & ALL_KEY_MODS]); - /* - * multiple - */ - for(i = 0, j = GPM_DOUBLE; s_multi[i]; i++, j <<= 1) - if(event->type & j) { - count = s_count[i]; - strcat(buffer, s_multi[i]); - } /* if */ - } - /* - * if - */ - if(event->type & GPM_DRAG) { - dragFlag = 1; - } - - /* - * if - */ - /* - * itz Mon Mar 23 08:26:33 PST 1998 up-event after movement is a drag. - */ - if((event->type & GPM_UP) && dragFlag) { - strcat(buffer, "drag-"); - } - - /* - * if - */ - /* - * type - */ - for(i = 0, j = GPM_MOVE; s_type[i]; i++, j <<= 1) - if(event->type & j) - strcat(buffer, s_type[i]); - - /* - * itz Sun Mar 22 19:09:04 PST 1998 Emacs doesn't understand modifiers on - * motion events. - */ - if(!(event->type & (GPM_MOVE | GPM_DRAG))) - /* - * button - */ - for(i = 0, j = GPM_B_RIGHT; s_button[i]; i++, j <<= 1) - if(event->buttons & j) - strcat(buffer, s_button[i]); - - if((event->type & GPM_UP) && dragFlag) { - printf("(%s ((%i . %i) %ld) %c ((%i . %i) %ld))\n", - buffer, - event->x, event->y, timestamp, count, dragX, dragY, dragTime); - } else if(event->type & (GPM_DOWN | GPM_UP)) { - printf("(%s ((%i . %i) %ld) %c)\n", - buffer, event->x, event->y, timestamp, count); - } else if(event->type & (GPM_MOVE | GPM_DRAG)) { - printf("(%s ((%i . %i) %ld))\n", buffer, event->x, event->y, timestamp); - } - /* - * if - */ - if(event->type & GPM_DOWN) { - dragX = event->x; - dragY = event->y; - dragTime = timestamp; - dragFlag = 0; - } - /* - * if - */ - if(event->type & (GPM_DRAG | GPM_DOWN)) { - if(0 == opt_pointer) { - GPM_DRAWPOINTER(event); - } /* if */ - } - /* - * if - */ - return 0; -} - -/*===================================================================*/ -int usage(void) -{ - // printf( "(" GPM_NAME ") " GPM_RELEASE ", " GPM_DATE "\n" - printf("(" GPM_NAME ") , " GPM_DATE "\n" "Usage: %s [options]\n", prgname); - printf(" Valid options are\n" - " -C choose virtual console (beware of it)\n" - " -d choose the default mask\n" - " -e choose the eventMask\n" - " -E emacs-mode\n" - " -i accept commands from stdin\n" - " -f fit drag events inside the screen\n" - " -m minimum modifier mask\n" - " -M maximum modifier mask\n" - " -p show pointer while dragging\n" - " -u user-mode (default)\n"); - - return 1; -} - -/*===================================================================*/ -#define PARSE_EVENTS 0 -#define PARSE_MODIFIERS 1 -void getmask(char *arg, int which, int *where) -{ - int last = 0, value = 0; - - char *cur; - - struct node *table, *n; - - int mode = 0; /* 0 = set, 1 = add, 2 = subtract */ - - if('+' == arg[0]) { - mode = 1; - ++arg; - } else if('-' == arg[0]) { - mode = 2; - ++arg; - } - - if(isdigit(arg[0])) { - switch (mode) { - case 0: - *where = atoi(arg); - break; - case 1: - *where |= atoi(arg); - break; - case 2: - *where &= ~atoi(arg); - break; - } /* switch */ - return; - } - /* - * if - */ - table = (PARSE_MODIFIERS == which) ? tableMod : tableEv; - while(1) { - while(*arg && !isalnum(*arg)) - arg++; /* skip delimiters */ - cur = arg; - while(isalnum(*cur)) - cur++; /* scan the word */ - if(!*cur) - last++; - *cur = 0; - - for(n = table; n->name; n++) - if(!strcmp(n->name, arg)) { - value |= n->flag; - break; - } - if(!n->name) - fprintf(stderr, "%s: Incorrect flag \"%s\"\n", prgname, arg); - if(last) - break; - - cur++; - arg = cur; - } - - switch (mode) { - case 0: - *where = value; - break; - case 1: - *where |= value; - break; - case 2: - *where &= ~value; - break; - } /* switch */ -} - -/*===================================================================*/ -int cmdline(int argc, char **argv, char *options) -{ - int opt; - - while((opt = getopt(argc, argv, options)) != -1) { - switch (opt) { - /* - * itz Tue Mar 24 17:11:52 PST 1998 i hate options that do too - * much. Made them orthogonal. - */ - - case 'C': - sscanf(optarg, "%x", &opt_vc); - break; - case 'd': - getmask(optarg, PARSE_EVENTS, &opt_default); - break; - case 'e': - getmask(optarg, PARSE_EVENTS, &opt_mask); - break; - case 'E': - opt_emacs = 1; - break; - case 'i': - opt_intrct = 1; - break; - case 'f': - opt_fit = 1; - break; - case 'm': - getmask(optarg, PARSE_MODIFIERS, &opt_minMod); - break; - case 'M': - getmask(optarg, PARSE_MODIFIERS, &opt_maxMod); - break; - case 'p': - opt_pointer = 1; - break; - case 'u': - opt_emacs = 0; - break; - default: - return 1; - } - } - return 0; -} - -void do_snapshot() -{ - Gpm_Event event; - - int i = Gpm_GetSnapshot(&event); - - char *s; - - if(-1 == i) { - fprintf(stderr, "Warning: cannot get snapshot!\n"); - fprintf(stderr, "Have you run \"configure\" and \"make install\"?\n"); - return; - } - /* - * if - */ - fprintf(stderr, "Mouse has %d buttons\n", i); - fprintf(stderr, "Currently sits at (%d,%d)\n", event.x, event.y); - fprintf(stderr, "The window is %d columns by %d rows\n", event.dx, event.dy); - s = Gpm_GetLibVersion(&i); - fprintf(stderr, "The library is version \"%s\" (%i)\n", s, i); - s = Gpm_GetServerVersion(&i); - fprintf(stderr, "The daemon is version \"%s\" (%i)\n", s, i); - fprintf(stderr, "The current console is %d, with modifiers 0x%02x\n", - event.vc, event.modifiers); - fprintf(stderr, "The button mask is 0x%02X\n", event.buttons); -} - -/*===================================================================*/ -int interact(char *cmd) -{ /* returns 0 on success and !=0 on error */ - Gpm_Connect conn; - - int argc = 0; - - char *argv[20]; - - if(*cmd && cmd[strlen(cmd) - 1] == '\n') - cmd[strlen(cmd) - 1] = '\0'; - if(!*cmd) - return 0; - - /* - * Interaction is accomplished by building an argv and passing it to - * cmdline(), to use the same syntax used to invoke the program - */ - - while(argc < 19) { - while(isspace(*cmd)) - cmd++; - argv[argc++] = cmd; - while(*cmd && isgraph(*cmd)) - cmd++; - if(!*cmd) - break; - *cmd = 0; - cmd++; - } - argv[argc] = NULL; - - if(!strcmp(argv[0], "pop")) { - return (Gpm_Close() == 0 ? 1 : 0); /* a different convention on - * ret values */ - } - /* - * if - */ - if(!strcmp(argv[0], "info")) { - fprintf(stderr, "The stack of connection info is %i depth\n", gpm_flag); - return 0; - } - /* - * if - */ - if(!strcmp(argv[0], "quit")) { - exit(0); - } - /* - * if - */ - if(!strcmp(argv[0], "snapshot")) { - do_snapshot(); - return 0; - } - /* - * if - */ - optind = 0; /* scan the entire line */ - if(strcmp(argv[0], "push") || cmdline(argc, argv, "d:e:m:M:")) { - fprintf(stderr, "Syntax error in input line\n"); - return 0; - } - /* - * if - */ - conn.eventMask = opt_mask; - conn.defaultMask = opt_default; - conn.maxMod = opt_maxMod; - conn.minMod = opt_minMod; - - if(Gpm_Open(&conn, opt_vc) == -1) { - fprintf(stderr, "%s: Can't open mouse connection\r\n", argv[0]); - return 1; - } - return 0; -} - -/*===================================================================*/ -int main(int argc, char **argv) -{ - Gpm_Connect conn; - - char cmd[128]; - - Gpm_Handler *my_handler; /* not the real gpm handler! */ - - fd_set readset; - - prgname = argv[0]; - - if(cmdline(argc, argv, "C:d:e:Efim:M:pu")) - exit(usage()); - - gpm_zerobased = opt_emacs; - conn.eventMask = opt_mask; - conn.defaultMask = opt_default; - conn.maxMod = opt_maxMod; - conn.minMod = opt_minMod; - - if(Gpm_Open(&conn, opt_vc) == -1) { - gpm_report(GPM_PR_ERR, "%s: Can't open mouse connection\n", prgname); - exit(1); - } else if(gpm_fd == -2) { - gpm_report(GPM_PR_OOPS, - "%s: use rmev to see gpm events in xterm or rxvt\n", prgname); - } - - gpm_report(GPM_PR_DEBUG, "STILL RUNNING_1"); - - my_handler = opt_emacs ? emacs_handler : user_handler; - - /* - * itz Sun Mar 22 09:51:33 PST 1998 needed in case the output is a pipe - */ - setvbuf(stdout, 0, _IOLBF, 0); - setvbuf(stdin, 0, _IOLBF, 0); - - while(1) { /* forever */ - FD_ZERO(&readset); - FD_SET(gpm_fd, &readset); - if(opt_intrct) { - FD_SET(STDIN_FILENO, &readset); - } - - if(select(gpm_fd + 1, &readset, 0, 0, 0) < 0 && errno == EINTR) - continue; - if(FD_ISSET(STDIN_FILENO, &readset)) { - if(0 == fgets(cmd, sizeof(cmd), stdin) || interact(cmd)) { - exit(0); /* ^D typed on input */ - } /* if */ - } /* if */ - if(FD_ISSET(gpm_fd, &readset)) { - Gpm_Event evt; - - if(Gpm_GetEvent(&evt) > 0) { - my_handler(&evt, 0); - } else { - fprintf(stderr, "mev says : Oops, Gpm_GetEvent()\n"); - } - } - /* - * if - */ - } /* while */ - - /* - * ....................................... Done - */ - - while(Gpm_Close()) ; /* close all the stack */ - - exit(0); -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/mouse-test.c b/software/gpm/browse_source/gpm-1.99.7/src/prog/mouse-test.c deleted file mode 100644 index b842d0bb..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/mouse-test.c +++ /dev/null @@ -1,845 +0,0 @@ - -/* - * mouse-test.c - * - * Copyright 1995 rubini@linux.it (Alessandro Rubini) - * Copyright (C) 1998 Ian Zimmerman - * Copyright (C) 2002-2008 Nico Schottelius - * - * Tue, 5 Jan 1999 23:15:23 +0000, modified by James Troup : - * (main): exclude devices with a minor number of 130 from - * the device probe to avoid causing spontaneous reboots on machines - * where watchdog is used. Reported by Jim Studt - * [Debian bug report #22602] - * - * 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. - ********/ - -/* This code is horrible. Browse it at your risk */ - -/* hmm..read worse code before :) -nicos */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "message.h" /* to print */ -#include "gpmInt.h" /* to get mouse types */ -#include "daemon.h" /* FIXME: do not use that..rewrite mouse-test, - * anyway */ -#include "drivers.h" - -#ifndef min -# define min(a,b) ((a)>(b)?(b):(a)) -# define max(a,b) ((a)>(b)?(a):(b)) -#endif - -Gpm_Type *(*mt_I_serial) (int fd, unsigned short flags, struct Gpm_Type * type, - int argc, char **argv); - -int realposx = -1; - -int realposy = -1; - -/* this material is needed to pass options to mice.c */ -struct mouse_features mymouse = { - DEF_TYPE, DEF_DEV, DEF_SEQUENCE, DEF_CALIB, - (char *) NULL /* extra */ , - -1 /* fd */ , - DEF_BAUD, DEF_SAMPLE, DEF_DELTA, DEF_ACCEL, DEF_SCALE, - DEF_SCALE /* scaley */ , - DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, - DEF_DMINX, DEF_DMAXX, DEF_DMINY, DEF_DMAXY, - DEF_OMINX, DEF_OMAXX, DEF_OMINY, DEF_OMAXY, - (Gpm_Type *) NULL -}; - -/* and this is a workaroud */ -struct winsize win; - -/* this too */ -struct options option; - -struct mouse_features *which_mouse = &mymouse; - -char *progname; - -char *consolename; - -int devcount = 0; - -int typecount = 0; - -struct item { - Gpm_Type *this; - struct item *next; -}; - -struct device { - char *name; - int fd; - struct device *next; -}; - -static int message(void) -{ - printf("This program is designed to help you in detecting what type your\n" - "mouse is. Please follow the instructions of this program. If you're\n" - "bored before it is done, you can always press your 'Interrupt' key\n" - "(usually Ctrl-C)\n\n"); - printf - ("\t *** Remember: don't run any software which reads the mouse device\n" - "\t *** while making this test. This includes \"gpm\"," - "\"selection\", \"X\"\n\n"); - printf - ("Note that this program is by no means complete, and its main role is\n" - "to detect how does the middle button work on serial mice\n"); - return 0; -} - -/* I don't like curses, so I'm doing low level stuff here */ - -#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x) - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void raw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin), &it); - it.c_lflag &= ~(ICANON); - it.c_lflag &= ~(ECHO); - it.c_iflag &= ~(INPCK | ISTRIP | IXON); - it.c_oflag &= ~(OPOST); - it.c_cc[VMIN] = 1; - it.c_cc[VTIME] = 0; - - tcsetattr(fileno(stdin), TCSANOW, &it); - -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -static void noraw(void) -{ - struct termios it; - - tcgetattr(fileno(stdin), &it); - it.c_lflag |= ICANON; - it.c_lflag |= ECHO; - it.c_iflag |= IXON; - it.c_oflag |= OPOST; - - tcsetattr(fileno(stdin), TCSANOW, &it); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -void killed(int signo) -{ - fprintf(stderr, "mouse-test: killed by signal %i\r\n", signo); - noraw(); - exit(0); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -struct device **gpm_makedev(struct device **current, char *name) -{ - int fd; - - int modes; - - if((fd = open(name, O_RDWR | O_NONBLOCK)) == -1) { - perror(name); - return current; - } - modes = fcntl(fd, F_GETFL); - if(0 > fcntl(fd, F_SETFL, modes & ~O_NONBLOCK)) { - close(fd); - perror(name); - return current; - } - - *current = malloc(sizeof(struct device)); - if(!*current) - gpm_report(GPM_PR_OOPS, "malloc()"); - (*current)->name = strdup(name); - if(!(*current)->name) - gpm_report(GPM_PR_OOPS, "malloc()"); - (*current)->fd = fd; - (*current)->next = NULL; - devcount++; - return &((*current)->next); -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int mousereopen(int oldfd, char *name, Gpm_Type * type) -{ - int fd; - - if(!type) - type = mice + 1; /* ms */ - close(oldfd); - usleep(100000); - fd = open(name, O_RDWR); - if(fd < 0) - gpm_report(GPM_PR_OOPS, name); - (*mt_I_serial) (fd, type->flags, type, 1, &type->name); /* ms - * initialization - */ - return fd; -} - -int noneofthem(void) -{ - noraw(); - printf("\n\nSomething went wrong, I didn't manage to detect your" - "protocol\n\nFeel free to report your problems to the author\n"); - exit(1); -} - -/*************************************** - * This is the most useful function in - * the program: it build an array - * of data characters in order to run - * several protocols on the returned - * data. - */ - -int eventlist(int fd, unsigned char *buff, int buflen, int test, int readstep) -{ - fd_set selSet, readySet; - - struct timeval to; - - int active = 0; - - int pending; - - int got = 0; - - FD_ZERO(&readySet); - FD_SET(fd, &readySet); - FD_SET(fileno(stdin), &readySet); - to.tv_sec = to.tv_usec = 0; - - switch (test) { - case GPM_B_LEFT: - printf("\r\nNow please press and release several times\r\n" - "the left button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case GPM_B_MIDDLE: - printf("\r\nNow please press and release several times\r\n" - "the middle button of your mouse," - " *** trying not to move it ***\r\n\r\n"); - break; - - case 0: - printf("\r\nNow please move the mouse around, without pressing any\r\n" - "button. Move it both quickly and slowly\r\n\r\n"); - break; - - default: - printf("Unknown test to perform\r\n"); - return -1; - } - - printf("Press any key when you've done enough\r\n"); - - while(1) { - selSet = readySet; - if((pending = select(fd + 1, &selSet, NULL, NULL, &to)) < 0) - continue; - if(pending == 0 && !active) { - active++; - to.tv_sec = 10; - continue; - } - if(pending == 0) - return got; /* timeout */ - - if(FD_ISSET(0, &selSet)) { - getchar(); - if(active) - return got; - } - if(FD_ISSET(fd, &selSet)) { - if(active) - got += read(fd, buff + got, readstep); - else - read(fd, buff, buflen); - } - if(got > buflen - readstep) - readstep = buflen - got; - if(readstep == 0) - got--, readstep++; /* overwrite last char forever */ - - to.tv_sec = 30; - } -} - -/*----------------------------------------------------------------------------- - Place the description here. - -----------------------------------------------------------------------------*/ -int main(int argc, char **argv) -{ - struct item *list = NULL; - - struct item **nextitem; - - struct device *devlist = NULL; - - struct device **nextdev; - - Gpm_Type *cursor; - - int i, mousefd; - - char *mousename; - -#define BUFLEN 512 - unsigned char buf[BUFLEN]; - - struct timeval timeout; - - fd_set checkSet; - - int pending, maxfd; - - int trial, readamount, packetsize, got; - int baudtab[4] = { 1200, 9600, 4800, 2400 }; -#define BAUD(i) (baudtab[(i)%4]) - consolename = Gpm_get_console(); - - if(!isatty(fileno(stdin))) { - fprintf(stderr, "%s: stdin: not a tty\n", argv[0]); - exit(1); - } - - progname = argv[0]; - message(); - - /* - * init the list of possible devices - */ - - for(nextdev = &devlist, i = 1; i < argc; i++) - nextdev = gpm_makedev(nextdev, argv[i]); - - if(argc == 1) { /* no cmdline, get all devices */ - FILE *f; - - char s[64]; - - /* - * Skip 10, 130 (== watchdog) to avoid causing spontaneous reboots - */ - f = popen("ls -l /dev/* | " - "awk '/^c/ && $5==\"10,\" && $6!=\"130\" || $NF ~ \"ttyS[0-3]$\" {print $NF}'", - "r"); - if(!f) - gpm_report(GPM_PR_OOPS, "popen()"); - while(fgets(s, 64, f)) { - s[strlen(s) - 1] = '\0'; /* trim '\n' */ - nextdev = gpm_makedev(nextdev, s); - } - pclose(f); - } - - if(devcount == 0) { - fprintf(stderr, "%s: no devices found\n", progname); - exit(1); - } - - mt_I_serial = mice->init; /* the first one has I_serial */ - - signal(SIGINT, killed); /* control-C kills us */ - raw(); - -/*====================================== First of all, detect the device */ - - trial = 0; - while(devcount > 1) { - fd_set devSet, gotSet, savSet; - - struct device *cur; - - int gotthem; - - /* - * BUG - *//* - * Logitech initialization is not performed - */ - - (which_mouse->opt_baud) = BAUD(trial); - printf("\r\nTrying with %i baud\r\n", (which_mouse->opt_baud)); - trial++; - - FD_ZERO(&devSet); - FD_ZERO(&gotSet); - FD_SET(fileno(stdin), &devSet); - maxfd = fileno(stdin); - printf("\r\n The possible device nodes are:\r\n"); - for(nextdev = &devlist; *nextdev; nextdev = &((*nextdev)->next)) { - printf("\t%s\r\n", (*nextdev)->name); - FD_SET((*nextdev)->fd, &devSet); - maxfd = max((*nextdev)->fd, maxfd); - (*mt_I_serial) ((*nextdev)->fd, (mice + 1)->flags, mice + 1, 1, &(mice + 1)->name); /* try - * ms - * mode - */ - } - - savSet = devSet; - - printf("\r\n\r\nI've still %i devices which may be your mouse,\r\n", - devcount); - printf("Please move the mouse. Press any key when done\r\n" - " (You can specify your device name on cmdline, in order to\r\n" - " avoid this step\r\n. Different baud rates are tried at " - "different times\r\n"); - - timeout.tv_sec = 10; /* max test time */ - gotthem = 0; - while(1) { /* extract files from the list */ - devSet = savSet; - if((pending = select(maxfd + 1, &devSet, NULL, NULL, &timeout)) < 0) - continue; - if(pending == 0 || FD_ISSET(fileno(stdin), &devSet)) { - getchar(); - break; - } - for(nextdev = &devlist; *nextdev; nextdev = &((*nextdev)->next)) - if(FD_ISSET((*nextdev)->fd, &devSet)) { - gotthem++; - FD_CLR((*nextdev)->fd, &savSet); - FD_SET((*nextdev)->fd, &gotSet); - } - } - if(gotthem) - for(nextdev = &devlist; *nextdev; /* nothing */ ) { - cur = *nextdev; - if(!FD_ISSET(cur->fd, &gotSet)) { - printf("removing \"%s\" from the list\r\n", cur->name); - *nextdev = cur->next; - close(cur->fd); - free(cur->name); - free(cur); - devcount--; - } else { - read(cur->fd, buf, 80); /* flush */ - nextdev = &(cur->next); /* follow list */ - } - } - - } /* devcount>1 */ - - mousefd = devlist->fd; - mousename = devlist->name; - free(devlist); - printf("\r\nOk, so your mouse device is \"%s\"\r\n", mousename); - - /* - * now close and reopen it, complete with initialization - */ - (which_mouse->opt_baud) = BAUD(0); - mousefd = mousereopen(mousefd, mousename, NULL); - - FD_ZERO(&checkSet); - FD_SET(mousefd, &checkSet); - FD_SET(fileno(stdin), &checkSet); - maxfd = max(mousefd, fileno(stdin)); - -/*====================================== Identify mouse type */ - - /* - * init the list of possible types - */ - - printf("\r\n\r\nThe possible mouse types are:\r\n"); - for(nextitem = &list, cursor = mice; cursor->fun; cursor++) { - if(cursor->absolute) - continue; - *nextitem = malloc(sizeof(struct item)); - if(!*nextitem) - gpm_report(GPM_PR_OOPS, "malloc()"); - (*nextitem)->this = cursor; - (*nextitem)->next = NULL; - printf("\t%s", cursor->name); - if(cursor->synonyms && cursor->synonyms[0]) - printf(" (%s)", cursor->synonyms); - printf("\r\n"); - typecount++; - nextitem = &((*nextitem)->next); - } - -/*====================================== Packet size - first step */ - - printf("\r\nNow please press and release your left mouse button,\r\n" - "one time only\r\n\r\n"); - - i = read(mousefd, buf, 1); - if(i == -1 && errno == EINVAL) - readamount = 3; - else - readamount = 1; - - usleep(100000); - -#define REMOVETYPE(cur,reason) \ - do { \ - printf("\tRemoving type \"%s\" because of '%s'\r\n", \ - (cur)->this->name,reason); \ - (*nextitem)=(cur)->next; \ - free(cur); \ - typecount--; \ - } while(0) - - for(nextitem = &list; *nextitem; /* nothing */ ) { - struct item *cur = *nextitem; - - if(readamount != cur->this->howmany) - REMOVETYPE(cur, "different read() semantics"); - else - nextitem = &(cur->next); - } - read(mousefd, buf, BUFLEN); /* flush */ - -/*====================================== Packet size - second step */ - - printf("\r\nNow you will be asked to generate different kind of events,\r\n" - "in order to understand what protocol is your mouse speaking\r\n"); - - if(readamount == 1) - readamount = 10; - /* - * Otherwise, the packetsize is already known, but the different decoding - * alghorithm allows for further refinement. - */ - - packetsize = 1; - trial = 0; - while(packetsize == 1) { - int success3 = 0, success5 = 0; - - (which_mouse->opt_baud) = BAUD(trial); - printf("\tBaud rate is %i\r\n", (which_mouse->opt_baud)); - mousefd = mousereopen(mousefd, mousename, NULL); - - printf("\r\n==> Detecting the packet size\r\n"); - got = eventlist(mousefd, buf, BUFLEN, GPM_B_LEFT, readamount); - - /* - * try three -- look at repeating arrays of 6 bytes - */ - for(i = 0; i < got - 12; i++) - if(!memcmp(buf + i, buf + i + 6, 6)) - success3++; - - /* - * try five -- look at repeating arrays of 10 bytes - */ - for(i = 0; i < got - 20; i++) - if(!memcmp(buf + i, buf + i + 10, 10)) - success5++; - - printf("matches for 3 bytes: %i -- matches for 5 bytes: %i\r\n", - success3, success5); - if(success3 > 5 && success5 == 0) - packetsize = 3; - if(success5 > 5 && success3 == 0) - packetsize = 5; - if(packetsize == 1) - printf("\r\n ** Ambiguous, try again\r\n"); - trial++; - } - -/*====================================== Use that info to discard protocols */ - - for(nextitem = &list; *nextitem; /* nothing */ ) { - struct item *cur = *nextitem; - - int packetheads = 0; - - int match = 0; - - Gpm_Event event; - - if(packetsize != cur->this->packetlen) { - REMOVETYPE(cur, "different packet lenght"); - continue; - } - - /* - * try to decode button press and release - */ - for(i = 0; i < got; i++) { - if(((buf[i] & (cur->this->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i + 1] & (cur->this->proto)[2]) == (cur->this->proto)[3])) { - packetheads++; - if((*(cur->this->fun)) (&event, buf + i) == -1) { - packetheads--; - continue; - } - i += packetsize - 1; /* skip packet */ - if(event.dx || event.dy) - continue; - if(event.buttons == GPM_B_LEFT) - match++; - else if(event.buttons) - match--; - } - } - if(match <= 0) { - REMOVETYPE(cur, "incorrect button detected"); - continue; - } - if(packetheads < got / (packetsize + 2)) { - REMOVETYPE(cur, "too few events got decoded"); - continue; - } - printf("** type '%s' still possible\r\n", cur->this->name); - nextitem = &(cur->next); - } - -/*====================================== It's all done? */ - -/* - * At this point, msc, would be unique (and 3-button aware) due to the - * packet size; sun,mm and ps2 would be unique due to the different - * representation of buttons (and they usually are not dual mode). - */ - - /* - * why checking and not using return value ??? - */ - if(typecount == 0) - noneofthem(); - if(typecount == 1) { - noraw(); - printf("\n\n\nWell, it seems like your mouse is already detected:\n" - "it is on the device \"%s\", and speaks the protocol \"%s\"\n", - mousename, list->this->name); - exit(0); - } - -/* - * If it is in the "ms" family, however, three possibilities are still - * there, and all of them depend on the middle button - */ - - do { - printf("\r\nYour mouse is one of the ms family, " - "but do you have the middle button (y/n)? "); - putchar(i = getchar()); - printf("\r\n"); - } while(i != 'y' && i != 'n'); - - if(i == 'n') { - noraw(); - printf("\nThen, you should use the \"bare\" protocol on \"%s\"\n", - mousename); - exit(0); - } - -/* - * First trial: remove the "-t ms" extension if spurious buttons come in - */ - - got = eventlist(mousefd, buf, BUFLEN, 0, readamount); - pending = 0; - for(nextitem = &list; *nextitem; /* nothing */ ) { - struct item *cur = *nextitem; - - Gpm_Event event; - - /* - * try to decode button press and release - */ - for(i = 0; i < got; i++) { - if(((buf[i] & (cur->this->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i + 1] & (cur->this->proto)[2]) == (cur->this->proto)[3])) { - if((*(cur->this->fun)) (&event, buf + i) == -1) - continue; - i += packetsize - 1; - if(event.buttons) - pending--; - } - } - if(pending < 0) { - REMOVETYPE(cur, "spurious button reported"); - continue; - } - printf("** type '%s' still possible\r\n", cur->this->name); - nextitem = &(cur->next); - } - if(typecount == 0) - noneofthem(); - -/* - * Second trial: look if it is one of the two mman ways (In the second - * test, extended ms is caught as well - */ - - printf("\r\n==> Looking for '-t mman'and enhanced ms\r\n"); - mousefd = mousereopen(mousefd, mousename, mice /* mman */ ); - got = eventlist(mousefd, buf, BUFLEN, GPM_B_MIDDLE, readamount); - - /* - * if it uses the 4-byte protocol, find it in a rude way - */ - for(pending = 0, i = 0; i < got - 16; i++) - if(!memcmp(buf + i, buf + i + 8, 8)) - pending++; - if(pending > 3) { - noraw(); - printf("\nYour mouse seems to be a 'mman' one on \"%s\" (%i matches)\n", - mousename, pending); - exit(0); - } - - pending = 0; - for(nextitem = &list; *nextitem; /* nothing */ ) { - struct item *cur = *nextitem; - - Gpm_Event event; - - /* - * try to decode button press and release - */ - for(i = 0; i < got; i++) { - if(((buf[i] & (cur->this->proto)[0]) == (cur->this->proto)[1]) - && ((buf[i + 1] & (cur->this->proto)[2]) == (cur->this->proto)[3])) { - if((*(cur->this->fun)) (&event, buf + i) == -1) - continue; - i += packetsize - 1; - if(event.buttons && event.buttons != GPM_B_MIDDLE) - pending--; - if(event.buttons == GPM_B_MIDDLE) - pending++; - } - } - if(pending < 0) { - REMOVETYPE(cur, "spurious button reported"); - continue; - } - if(pending > 3) { - noraw(); - printf("\nYour mouse seems to be a '%s' one on \"%s\" (%i matches)\n", - cur->this->name, mousename, pending); - exit(0); - } - printf("** type '%s' still possible\r\n", cur->this->name); - nextitem = &(cur->next); - } - if(typecount == 0) - noneofthem(); - -/* - * Then, try to toggle dtr and rts - */ - - { - int toggle[3] = { TIOCM_DTR | TIOCM_RTS, TIOCM_DTR, TIOCM_RTS }; - char *tognames[3] = { "both", "dtr", "rts" }; - char *Xtognames[3] = - { "'ClearDTR' and 'ClearRTS'", "'ClearDTR'", "'ClearRTS'" }; - int alllines, lines, index; - - ioctl(mousefd, TIOCMGET, &alllines); - - printf("\r\nSome mice change protocol to three-buttons-aware if some\r\n" - "\r\ncontrol lines are toggled after opening\r\n"); - for(index = 0; index < 3; index++) { - mousereopen(mousefd, mousename, NULL); - lines = alllines & ~toggle[index]; - ioctl(mousefd, TIOCMSET, &lines); - printf("\r\n==> Trying with '-o %s'\r\n", tognames[index]); - got = eventlist(mousefd, buf, BUFLEN, GPM_B_MIDDLE, readamount); - - /* - * if it uses the 5-byte protocol, find it in a rude way - */ - for(pending = 0, i = 0; i < got - 20; i++) - if(!memcmp(buf + i, buf + i + 10, 10)) - pending++; - if(pending > 3) { - noraw(); - printf("\nYour mouse becomes a 3-buttons ('-t msc') one when\n" - "gpm gets '-o %s' on it command line, and X gets\n" - "%s in XF86Config\nThe device is \"%s\"", - tognames[index], Xtognames[index], mousename); - exit(0); - } - } - } - -/* - * still here? Then, the only resort is keeping the middle button - * pressed while initializing the mouse - */ - - printf("\r\nYour damned device doesn't respond to anything\r\n" - "the only remaining possibility is to keep presses the middle\r\n" - "button _while_the_mouse_is_being_opened. This is the worst thing\r\n" - "ever thought after caps-lock-near-the-A\r\n"); - - printf("\r\nNow please press the middle button, and then press any key\r\n" - "while keeping the button down. Wait to release it until the\r\n" - "next message.\r\n"); - - getchar(); - - got = eventlist(mousefd, buf, BUFLEN, GPM_B_MIDDLE, readamount); - - /* - * if it uses the 5-byte protocol, find it in a rude way - */ - for(pending = 0, i = 0; i < got - 20; i++) - if(!memcmp(buf + i, buf + i + 10, 10)) - pending++; - if(pending > 3) { - noraw(); - printf("\nWorked. You should keep the button pressed every time the\n" - "computer boots, and run gpm in '-R' mode in order to ignore\n" - "such hassle when starting X\n\nStill better, but a better mouse\n" - "\nThe current mouse device is \"%s\"\n", mousename); - - exit(0); - } - noraw(); - printf("\nI'm lost. Can't tell you how to use your middle button\n"); - return 0; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/prog/open_console.c b/software/gpm/browse_source/gpm-1.99.7/src/prog/open_console.c deleted file mode 100644 index 5a7e9859..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/prog/open_console.c +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * general purpose mouse (gpm) - * - * Copyright (c) 2008 Nico Schottelius - * - * 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. - * - ********/ - -#include - -#include "message.h" /* messaging in gpm */ -#include "daemon.h" /* daemon internals */ - -int open_console(const int mode) -{ - int fd; - - if((fd = open(option.consolename, mode)) < 0) - gpm_report(GPM_PR_OOPS, GPM_MESS_OPEN, option.consolename); - return fd; -} diff --git a/software/gpm/browse_source/gpm-1.99.7/src/report.c b/software/gpm/browse_source/gpm-1.99.7/src/report.c deleted file mode 100644 index dcf81dbb..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/report.c +++ /dev/null @@ -1,254 +0,0 @@ - -/* - * selects where we should report to - * TODO: - possibly include errno (%m) string in syslog - * - njak ... someone should optimize this code and remove double - * fragments.... (self) - * - * Copyright (c) 2001-2008 Nico Schottelius - * - * 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. - */ - -#include /* NULL */ -#include /* va_arg/start/... */ -#include /* alloc & co. */ -#include /* strlen/strcpy */ -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "gpmInt.h" -#include "message.h" -#include "daemon.h" /* FIXME: this is wrong; we need report fpr lib - * und daemon */ - -/* - * gpm_report - * - * Destinations: - * - syslog - * - current console (/dev/vc/0 || /dev/tty0) - * - system console (/dev/console) - * - stdout - * - stderr - * - * - * Items in [] are alternatives, if first destination is not present. - * - * Startup Mode: - * debug : - (ignore) - * info : syslog/stdout - * warn/err : syslog/stderr - * oops : syslog/stderr [exit] - * - * Running Mode: (daemon) - * debug : - (ignore) - * info : syslog - * warn : syslog+system console - * err : syslog+system console+current console - * oops : syslog/stderr [_exit] - * - * Debug Mode : - * debug/warn/err: stderr - * info : stdout - * oops : stderr [exit] - * - * Client Mode: (to use with mouse-test etc. ; NON SERVER ) - * debug/err/warn/info: like debugging mode! - * - */ - -void gpm_report(int line, char *file, int stat, char *text, ...) -{ - FILE *console = NULL; - - va_list ap, ap3; - -#ifdef HAVE_VSYSLOG - va_list ap2; -#endif - - va_start(ap, text); - va_copy(ap3, ap); -#ifdef HAVE_VSYSLOG - va_copy(ap2, ap); -#endif - - switch (option.run_status) { - - /******************** STARTUP *****************/ - case GPM_RUN_STARTUP: - switch (stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#else - fprintf(stderr, GPM_STRING_INFO); - vfprintf(stderr, text, ap); - fprintf(stderr, "\n"); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - fprintf(stderr, GPM_STRING_WARN); - vfprintf(stderr, text, ap); - fprintf(stderr, "\n"); -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - fprintf(stderr, GPM_STRING_ERR); - vfprintf(stderr, text, ap); - fprintf(stderr, "\n"); -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr, GPM_STRING_OOPS); - vfprintf(stderr, text, ap); - fprintf(stderr, "\n"); - - exit(1); /* we should have a oops()-function,but this - * works,too */ - break; - } - break; /* startup sequence */ - - /******************** RUNNING *****************/ - case GPM_RUN_DAEMON: - switch (stat) { - case GPM_STAT_INFO: -#ifdef HAVE_VSYSLOG - syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); - vsyslog(LOG_INFO | LOG_USER, text, ap2); -#endif - break; - - case GPM_STAT_WARN: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); - vsyslog(LOG_DAEMON | LOG_WARNING, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE, "a")) != NULL) { - fprintf(console, GPM_STRING_WARN); - vfprintf(console, text, ap); - fprintf(console, "\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_ERR: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#else - if((console = fopen(GPM_SYS_CONSOLE, "a")) != NULL) { - fprintf(console, GPM_STRING_ERR); - vfprintf(console, text, ap); - fprintf(console, "\n"); - fclose(console); - } - - if((console = fopen(option.consolename, "a")) != NULL) { - fprintf(console, GPM_STRING_ERR); - vfprintf(console, text, ap3); - fprintf(console, "\n"); - fclose(console); - } -#endif - break; - - case GPM_STAT_OOPS: -#ifdef HAVE_VSYSLOG - syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); - vsyslog(LOG_DAEMON | LOG_ERR, text, ap2); -#endif - fprintf(stderr, GPM_STRING_OOPS); - vfprintf(stderr, text, ap); - fprintf(stderr, "\n"); - - _exit(1); /* we are the fork()-child */ - break; - } - break; /* running gpm */ - - /******************** DEBUGGING and CLIENT *****************/ - case GPM_RUN_DEBUG: - switch (stat) { - case GPM_STAT_INFO: - console = stdout; - fprintf(console, GPM_STRING_INFO); - break; - case GPM_STAT_WARN: - console = stderr; - fprintf(console, GPM_STRING_WARN); - break; - case GPM_STAT_ERR: - console = stderr; - fprintf(console, GPM_STRING_ERR); - break; - case GPM_STAT_DEBUG: - console = stderr; - fprintf(console, GPM_STRING_DEBUG); - break; - case GPM_STAT_OOPS: - console = stderr; - fprintf(console, GPM_STRING_OOPS); - break; - } - - vfprintf(console, text, ap); - fprintf(console, "\n"); - - if(stat == GPM_STAT_OOPS) - exit(1); - - break; - } /* switch for current modus */ - - va_end(ap); - va_end(ap3); -#ifdef HAVE_VSYSLOG - va_end(ap2); -#endif -} /* gpm_report */ - -/* old interesting part from debuglog.c. - * interesting, if you want to include ERRNO into syslog message - * should possibly included again later...when sources are clean and - * there is no doubled strrer(errno) - -#if(defined(HAVE_VSYSLOG) && defined(HAVE_SYSLOG)) - static char fmt[] = ": %m"; - char* buf = alloca(strlen(s)+sizeof(fmt)); - strcpy(buf, s); strcat(buf, fmt); -#endif - -*/ diff --git a/software/gpm/browse_source/gpm-1.99.7/src/tools.c b/software/gpm/browse_source/gpm-1.99.7/src/tools.c deleted file mode 100644 index 30248433..00000000 --- a/software/gpm/browse_source/gpm-1.99.7/src/tools.c +++ /dev/null @@ -1,109 +0,0 @@ - -/* - * tools.c - tools which are needed by client and server - * - * Copyright (c) 2001 Nico Schottelius - * - * 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. - ********/ - -#include /* NULL */ -#include -#include -#include /* these three are */ -#include /* needed for */ -#include /* stat() */ - -#include "gpmInt.h" /* only used for some defines */ -#include "message.h" - -/***************************************************************************** - * check, whether devfs is used or not. - * See /usr/src/linux/Documentation/filesystems/devfs/ for details. - * Returns: the name of the console (/dev/tty0 or /dev/vc/0) - *****************************************************************************/ -char *Gpm_get_console(void) -{ - - char *back = NULL, *tmp = NULL; - - struct stat buf; - - /* - * first try the devfs device, because in the next time this will be the - * preferred one. If that fails, take the old console - */ - - /* - * Check for open new console - */ - if(stat(GPM_DEVFS_CONSOLE, &buf) == 0) - tmp = GPM_DEVFS_CONSOLE; - - /* - * Failed, try OLD console - */ - else if(stat(GPM_OLD_CONSOLE, &buf) == 0) - tmp = GPM_OLD_CONSOLE; - - if(tmp != NULL) - if((back = malloc(strlen(tmp) + sizeof(char))) != NULL) - strcpy(back, tmp); - - return (back); -} - -/* what's the english name for potenz ? */ -int Gpm_x_high_y(int base, int pot_y) -{ - int val = 1; - - if(pot_y == 0) - val = 1; - else if(pot_y < 0) - val = 0; /* ugly hack ;) */ - else - while(pot_y > 0) { - val = val * base; - pot_y--; - } - return val; -} - -/* return characters needed to display int */ -int Gpm_cnt_digits(int number) -{ - /* - * 0-9 = 1 10^0 <-> (10^1)-1 10 - 99 = 2 10^1 <-> (10^2)-1 100 - 999 = 3 - * 10^2 <-> (10^3)-1 1000 - 9999 = 4 ... - */ - - int ret = 0, num = 0; - - /* - * non negative, please - */ - if(number < 0) - number *= -1; - else if(number == 0) - ret = 1; - else - while(number > num) { - ret++; - num = (Gpm_x_high_y(10, ret) - 1); - } - - return (ret); -}